mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2026-05-04 21:23:36 +00:00
Improve test coverage.
This commit is contained in:
@@ -22,6 +22,7 @@
|
||||
namespace Tests\Unit\Console\Commands\Upgrade;
|
||||
|
||||
|
||||
use Amount;
|
||||
use FireflyConfig;
|
||||
use FireflyIII\Models\BudgetLimit;
|
||||
use FireflyIII\Models\Configuration;
|
||||
@@ -49,6 +50,11 @@ class BudgetLimitCurrencyTest extends TestCase
|
||||
{
|
||||
BudgetLimit::whereNull('transaction_currency_id')->forceDelete();
|
||||
|
||||
$false = new Configuration;
|
||||
$false->data = false;
|
||||
FireflyConfig::shouldReceive('get')->withArgs(['4780_bl_currency', false])->andReturn($false);
|
||||
FireflyConfig::shouldReceive('set')->withArgs(['4780_bl_currency', true]);
|
||||
|
||||
$this->artisan('firefly-iii:bl-currency')
|
||||
->expectsOutput('All budget limits are correct.')
|
||||
->assertExitCode(0);
|
||||
@@ -74,6 +80,9 @@ class BudgetLimitCurrencyTest extends TestCase
|
||||
FireflyConfig::shouldReceive('get')->withArgs(['4780_bl_currency', false])->andReturn($false);
|
||||
FireflyConfig::shouldReceive('set')->withArgs(['4780_bl_currency', true]);
|
||||
|
||||
$currency = $this->getEuro();
|
||||
Amount::shouldReceive('getDefaultCurrencyByUser')->atLeast()->once()->andReturn($currency);
|
||||
|
||||
$this->artisan('firefly-iii:bl-currency')
|
||||
->expectsOutput(
|
||||
sprintf('Budget limit #%d (part of budget "%s") now has a currency setting (%s).',
|
||||
|
||||
@@ -49,6 +49,12 @@ class RenameAccountMetaTest extends TestCase
|
||||
*/
|
||||
public function testHandle(): void
|
||||
{
|
||||
$false = new Configuration;
|
||||
$false->data = false;
|
||||
// check config
|
||||
FireflyConfig::shouldReceive('get')->withArgs(['4780_rename_account_meta', false])->andReturn($false);
|
||||
FireflyConfig::shouldReceive('set')->withArgs(['4780_rename_account_meta', true]);
|
||||
|
||||
// assume all is well.
|
||||
$this->artisan('firefly-iii:rename-account-meta')
|
||||
->expectsOutput('All account meta is OK.')
|
||||
|
||||
Reference in New Issue
Block a user