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