mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-01-01 11:47:14 -06:00
Updated tests
This commit is contained in:
parent
68e7d45f63
commit
fb07c68132
@ -205,6 +205,7 @@ class PiggyBankControllerTest extends TestCase
|
||||
$repository->shouldReceive('getCurrentAmount')->andReturn('10');
|
||||
$repository->shouldReceive('setUser');
|
||||
$repository->shouldReceive('correctOrder');
|
||||
$repository->shouldReceive('getSuggestedMonthlyAmount')->andReturn('1');
|
||||
|
||||
|
||||
Steam::shouldReceive('balance')->twice()->andReturn('1');
|
||||
@ -332,8 +333,13 @@ class PiggyBankControllerTest extends TestCase
|
||||
// mock stuff
|
||||
$repository = $this->mock(PiggyBankRepositoryInterface::class);
|
||||
$journalRepos = $this->mock(JournalRepositoryInterface::class);
|
||||
$repository->shouldReceive('setUser')->once();
|
||||
$journalRepos->shouldReceive('firstNull')->once()->andReturn(new TransactionJournal);
|
||||
$repository->shouldReceive('getEvents')->andReturn(new Collection);
|
||||
$repository->shouldReceive('getSuggestedMonthlyAmount')->andReturn('1');
|
||||
$repository->shouldReceive('getCurrentAmount')->andReturn('1');
|
||||
|
||||
|
||||
|
||||
$this->be($this->user());
|
||||
$response = $this->get(route('piggy-banks.show', [1]));
|
||||
|
@ -50,6 +50,8 @@ class PiggyBankTransformerTest extends TestCase
|
||||
$repository = $this->mock(PiggyBankRepositoryInterface::class);
|
||||
$repository->shouldReceive('setUser')->once();
|
||||
$repository->shouldReceive('getCurrentAmount')->andReturn('12.34')->once();
|
||||
$repository->shouldReceive('getSuggestedMonthlyAmount')->andReturn('12.34')->once();
|
||||
|
||||
|
||||
// make new account and piggy
|
||||
$account = Account::create(
|
||||
@ -94,10 +96,12 @@ class PiggyBankTransformerTest extends TestCase
|
||||
$currencyRepos->shouldReceive('setUser')->once();
|
||||
$currencyRepos->shouldReceive('findNull')->withArgs([1])->andReturn(TransactionCurrency::find(1))->once();
|
||||
|
||||
|
||||
// mock repository:
|
||||
$repository = $this->mock(PiggyBankRepositoryInterface::class);
|
||||
$repository->shouldReceive('setUser')->once();
|
||||
$repository->shouldReceive('getCurrentAmount')->andReturn('12.34')->once();
|
||||
$repository->shouldReceive('getSuggestedMonthlyAmount')->andReturn('12.34')->once();
|
||||
|
||||
// make new account and piggy
|
||||
$account = Account::create(
|
||||
@ -155,6 +159,7 @@ class PiggyBankTransformerTest extends TestCase
|
||||
$repository = $this->mock(PiggyBankRepositoryInterface::class);
|
||||
$repository->shouldReceive('setUser')->once();
|
||||
$repository->shouldReceive('getCurrentAmount')->andReturn('12.34')->once();
|
||||
$repository->shouldReceive('getSuggestedMonthlyAmount')->andReturn('12.34')->once();
|
||||
|
||||
// make new account and piggy
|
||||
$account = Account::create(
|
||||
|
Loading…
Reference in New Issue
Block a user