. */ declare(strict_types=1); namespace Tests\Feature\Controllers; use FireflyIII\Models\Account; use FireflyIII\Models\AccountType; use FireflyIII\Models\PiggyBank; use FireflyIII\Models\TransactionJournal; use FireflyIII\Repositories\Account\AccountRepositoryInterface; use FireflyIII\Repositories\Journal\JournalRepositoryInterface; use FireflyIII\Repositories\PiggyBank\PiggyBankRepositoryInterface; use Illuminate\Support\Collection; use Steam; use Tests\TestCase; /** * Class PiggyBankControllerTest * * @SuppressWarnings(PHPMD.TooManyPublicMethods) * @SuppressWarnings(PHPMD.ExcessiveMethodLength) * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ class PiggyBankControllerTest extends TestCase { /** * @covers \FireflyIII\Http\Controllers\PiggyBankController::add */ public function testAdd() { // mock stuff $piggyRepos = $this->mock(PiggyBankRepositoryInterface::class); $journalRepos = $this->mock(JournalRepositoryInterface::class); $journalRepos->shouldReceive('first')->once()->andReturn(new TransactionJournal); $piggyRepos->shouldReceive('getCurrentAmount')->andReturn('0'); $this->be($this->user()); $response = $this->get(route('piggy-banks.add', [1])); $response->assertStatus(200); } /** * @covers \FireflyIII\Http\Controllers\PiggyBankController::addMobile */ public function testAddMobile() { // mock stuff $piggyRepos = $this->mock(PiggyBankRepositoryInterface::class); $journalRepos = $this->mock(JournalRepositoryInterface::class); $journalRepos->shouldReceive('first')->once()->andReturn(new TransactionJournal); $piggyRepos->shouldReceive('getCurrentAmount')->andReturn('0'); $this->be($this->user()); $response = $this->get(route('piggy-banks.add-money-mobile', [1])); $response->assertStatus(200); $response->assertSee('