mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-18 18:44:16 +00:00
Fix some tests.
This commit is contained in:
@@ -154,17 +154,6 @@ class ApplyRulesTest extends TestCase
|
||||
$ruleGroupRepos->shouldReceive('getActiveGroups')->atLeast()->once()->andReturn($groups);
|
||||
$ruleGroupRepos->shouldReceive('getActiveStoreRules')->atLeast()->once()->andReturn(new Collection);
|
||||
|
||||
|
||||
$collector->shouldReceive('setUser')->atLeast()->once()->andReturnSelf();
|
||||
$collector->shouldReceive('setAccounts')->atLeast()->once()->andReturnSelf();
|
||||
$collector->shouldReceive('setRange')->atLeast()->once()->andReturnSelf();
|
||||
$collector->shouldReceive('getExtractedJournals')->atLeast()->once()->andReturn([[], [], []]);
|
||||
|
||||
$ruleEngine->shouldReceive('setUser')->atLeast()->once();
|
||||
$ruleEngine->shouldReceive('setRulesToApply')->atLeast()->once();
|
||||
$ruleEngine->shouldReceive('processJournalArray')->times(3);
|
||||
$ruleEngine->shouldReceive('setTriggerMode')->atLeast()->once()->withArgs([RuleEngine::TRIGGER_STORE]);
|
||||
|
||||
$parameters = [
|
||||
'--user=1',
|
||||
'--token=token',
|
||||
@@ -179,8 +168,7 @@ class ApplyRulesTest extends TestCase
|
||||
|
||||
$this->artisan('firefly-iii:apply-rules ' . implode(' ', $parameters))
|
||||
->expectsOutput('No rules or rule groups have been included.')
|
||||
->expectsOutput('Done!')
|
||||
->assertExitCode(0);
|
||||
->assertExitCode(1);
|
||||
}
|
||||
|
||||
|
||||
|
@@ -81,13 +81,14 @@ class OtherCurrenciesCorrectionsTest extends TestCase
|
||||
|
||||
// account repos
|
||||
$accountRepos->shouldReceive('setUser')->atLeast()->once();
|
||||
$accountRepos->shouldReceive('getMetaValue')->atLeast()->once()
|
||||
->withArgs([Mockery::any(), 'currency_id'])->andReturn('1');
|
||||
$accountRepos->shouldReceive('getAccountCurrency')->atLeast()->once()->andReturn($euro);
|
||||
#$accountRepos->shouldReceive('getMetaValue')->atLeast()->once()
|
||||
# ->withArgs([Mockery::any(), 'currency_id'])->andReturn('1');
|
||||
|
||||
// collect currency
|
||||
$currencyRepos->shouldReceive('setUser')->atLeast()->once();
|
||||
$currencyRepos->shouldReceive('findNull')->atLeast()->once()
|
||||
->withArgs([1])->andReturn($euro);
|
||||
#$currencyRepos->shouldReceive('findNull')->atLeast()->once()
|
||||
# ->withArgs([1])->andReturn($euro);
|
||||
|
||||
// configuration
|
||||
$false = new Configuration;
|
||||
@@ -157,13 +158,12 @@ class OtherCurrenciesCorrectionsTest extends TestCase
|
||||
|
||||
// account repos
|
||||
$accountRepos->shouldReceive('setUser')->atLeast()->once();
|
||||
$accountRepos->shouldReceive('getMetaValue')->atLeast()->once()
|
||||
->withArgs([Mockery::any(), 'currency_id'])->andReturn('1');
|
||||
$accountRepos->shouldReceive('getAccountCurrency')->atLeast()->once()->andReturn($euro);
|
||||
|
||||
// collect currency
|
||||
$currencyRepos->shouldReceive('setUser')->atLeast()->once();
|
||||
$currencyRepos->shouldReceive('findNull')->atLeast()->once()
|
||||
->withArgs([1])->andReturn($euro);
|
||||
#$currencyRepos->shouldReceive('findNull')->atLeast()->once()
|
||||
# ->withArgs([1])->andReturn($euro);
|
||||
|
||||
// configuration
|
||||
$false = new Configuration;
|
||||
@@ -242,13 +242,13 @@ class OtherCurrenciesCorrectionsTest extends TestCase
|
||||
|
||||
// account repos
|
||||
$accountRepos->shouldReceive('setUser')->atLeast()->once();
|
||||
$accountRepos->shouldReceive('getMetaValue')->atLeast()->once()
|
||||
->withArgs([Mockery::any(), 'currency_id'])->andReturn('1');
|
||||
|
||||
#$accountRepos->shouldReceive('getMetaValue')->atLeast()->once()
|
||||
# ->withArgs([Mockery::any(), 'currency_id'])->andReturn('1');
|
||||
$accountRepos->shouldReceive('getAccountCurrency')->atLeast()->once()->andReturn($euro);
|
||||
// collect currency
|
||||
$currencyRepos->shouldReceive('setUser')->atLeast()->once();
|
||||
$currencyRepos->shouldReceive('findNull')->atLeast()->once()
|
||||
->withArgs([1])->andReturn($euro);
|
||||
#$currencyRepos->shouldReceive('findNull')->atLeast()->once()
|
||||
# ->withArgs([1])->andReturn($euro);
|
||||
|
||||
// configuration
|
||||
$false = new Configuration;
|
||||
|
@@ -106,14 +106,15 @@ class TransferCurrenciesCorrectionsTest extends TestCase
|
||||
->atLeast()->once()->andReturn(new Collection([$transfer]));
|
||||
|
||||
// account repos
|
||||
$accountRepos->shouldReceive('getMetaValue')
|
||||
->atLeast()->once()
|
||||
->withArgs([Mockery::any(), 'currency_id'])->andReturn('1');
|
||||
#$accountRepos->shouldReceive('getMetaValue')
|
||||
# ->atLeast()->once()
|
||||
# ->withArgs([Mockery::any(), 'currency_id'])->andReturn('1');
|
||||
$accountRepos->shouldReceive('getAccountCurrency')->atLeast()->once()->andReturn($euro);
|
||||
|
||||
// currency repos
|
||||
$currencyRepos->shouldReceive('findNull')
|
||||
->atLeast()->once()
|
||||
->withArgs([1])->andReturn($euro);
|
||||
#$currencyRepos->shouldReceive('findNull')
|
||||
# ->atLeast()->once()
|
||||
# ->withArgs([1])->andReturn($euro);
|
||||
|
||||
// configuration
|
||||
$false = new Configuration;
|
||||
@@ -151,14 +152,15 @@ class TransferCurrenciesCorrectionsTest extends TestCase
|
||||
->atLeast()->once()->andReturn(new Collection([$transfer]));
|
||||
|
||||
// account repos
|
||||
$accountRepos->shouldReceive('getMetaValue')
|
||||
->atLeast()->once()
|
||||
->withArgs([Mockery::any(), 'currency_id'])->andReturn('1');
|
||||
#$accountRepos->shouldReceive('getMetaValue')
|
||||
# ->atLeast()->once()
|
||||
# ->withArgs([Mockery::any(), 'currency_id'])->andReturn('1');
|
||||
$accountRepos->shouldReceive('getAccountCurrency')->atLeast()->once()->andReturn($euro);
|
||||
|
||||
// currency repos
|
||||
$currencyRepos->shouldReceive('findNull')
|
||||
->atLeast()->once()
|
||||
->withArgs([1])->andReturn($euro);
|
||||
#$currencyRepos->shouldReceive('findNull')
|
||||
# ->atLeast()->once()
|
||||
# ->withArgs([1])->andReturn($euro);
|
||||
|
||||
// configuration
|
||||
$false = new Configuration;
|
||||
@@ -202,16 +204,7 @@ class TransferCurrenciesCorrectionsTest extends TestCase
|
||||
->withArgs([[TransactionType::TRANSFER]])
|
||||
->atLeast()->once()->andReturn(new Collection([$transfer]));
|
||||
|
||||
// account repos
|
||||
$accountRepos->shouldReceive('getMetaValue')
|
||||
->atLeast()->once()
|
||||
->withArgs([Mockery::any(), 'currency_id'])->andReturn('1', $dollar->id);
|
||||
|
||||
// currency repos
|
||||
$currencyRepos->shouldReceive('findNull')
|
||||
->atLeast()->once()
|
||||
->withArgs([1])->andReturn($euro);
|
||||
|
||||
$accountRepos->shouldReceive('getAccountCurrency')->atLeast()->once()->andReturn($euro);
|
||||
$currencyRepos->shouldReceive('findNull')
|
||||
->atLeast()->once()
|
||||
->withArgs([$dollar->id])->andReturn($dollar);
|
||||
|
Reference in New Issue
Block a user