. */ declare(strict_types=1); namespace Tests\Feature\Controllers\Json; use FireflyIII\Repositories\PiggyBank\PiggyBankRepositoryInterface; use Illuminate\Support\Collection; use Tests\TestCase; /** * Class FrontpageControllerTest * * @SuppressWarnings(PHPMD.TooManyPublicMethods) * @SuppressWarnings(PHPMD.ExcessiveMethodLength) * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ class FrontpageControllerTest extends TestCase { /** * @covers \FireflyIII\Http\Controllers\Json\FrontpageController::piggyBanks */ public function testPiggyBanks() { $piggy = $this->user()->piggyBanks()->first(); $repository = $this->mock(PiggyBankRepositoryInterface::class); $repository->shouldReceive('getPiggyBanks')->andReturn(new Collection([$piggy])); $this->be($this->user()); $response = $this->get(route('json.fp.piggy-banks')); $response->assertStatus(200); } }