be($piggy->account->user); // data: $obj = new stdClass; $obj->sum = 100; $obj->date = '2015-01-01'; $set = [ $obj ]; // mock! $repository = $this->mock('FireflyIII\Repositories\PiggyBank\PiggyBankRepositoryInterface'); // fake! $repository->shouldReceive('getEventSummarySet')->andReturn($set); $this->call('GET', '/chart/piggyBank/' . $piggy->id); $this->assertResponseOk(); } }