mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-11-17 07:08:19 +00:00
Improve test coverage.
This commit is contained in:
@@ -24,13 +24,10 @@ declare(strict_types=1);
|
||||
namespace Tests\Feature\Controllers\Account;
|
||||
|
||||
|
||||
use Amount;
|
||||
use FireflyIII\Models\AccountType;
|
||||
use FireflyIII\Models\Preference;
|
||||
use FireflyIII\Models\TransactionJournal;
|
||||
use FireflyIII\Repositories\Account\AccountRepositoryInterface;
|
||||
use FireflyIII\Repositories\Currency\CurrencyRepositoryInterface;
|
||||
use FireflyIII\Repositories\Journal\JournalRepositoryInterface;
|
||||
use FireflyIII\Repositories\User\UserRepositoryInterface;
|
||||
use Illuminate\Support\Collection;
|
||||
use Log;
|
||||
@@ -97,8 +94,8 @@ class CreateControllerTest extends TestCase
|
||||
{
|
||||
// mock stuff
|
||||
|
||||
$repository = $this->mock(AccountRepositoryInterface::class);
|
||||
$asset = $this->getRandomAsset();
|
||||
$repository = $this->mock(AccountRepositoryInterface::class);
|
||||
$asset = $this->getRandomAsset();
|
||||
|
||||
$repository->shouldReceive('store')->once()->andReturn($asset);
|
||||
|
||||
@@ -133,8 +130,8 @@ class CreateControllerTest extends TestCase
|
||||
public function testStoreAnother(): void
|
||||
{
|
||||
// mock stuff
|
||||
$repository = $this->mock(AccountRepositoryInterface::class);
|
||||
$asset = $this->getRandomAsset();
|
||||
$repository = $this->mock(AccountRepositoryInterface::class);
|
||||
$asset = $this->getRandomAsset();
|
||||
|
||||
$repository->shouldReceive('store')->once()->andReturn($asset);
|
||||
|
||||
@@ -149,7 +146,6 @@ class CreateControllerTest extends TestCase
|
||||
$this->mockDefaultSession();
|
||||
|
||||
|
||||
|
||||
Preferences::shouldReceive('mark')->atLeast()->once()->withNoArgs();
|
||||
|
||||
$this->session(['accounts.create.uri' => 'http://localhost']);
|
||||
@@ -175,9 +171,9 @@ class CreateControllerTest extends TestCase
|
||||
public function testStoreLiability(): void
|
||||
{
|
||||
// mock stuff
|
||||
$repository = $this->mock(AccountRepositoryInterface::class);
|
||||
$liability = $this->getRandomLoan();
|
||||
$loan = AccountType::where('type', AccountType::LOAN)->first();
|
||||
$repository = $this->mock(AccountRepositoryInterface::class);
|
||||
$liability = $this->getRandomLoan();
|
||||
$loan = AccountType::where('type', AccountType::LOAN)->first();
|
||||
$repository->shouldReceive('store')->once()->andReturn($liability);
|
||||
|
||||
// mock default session stuff
|
||||
|
||||
Reference in New Issue
Block a user