mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-11-21 09:00:07 +00:00
Warn about expensive code in test environment.
This commit is contained in:
@@ -34,7 +34,7 @@ use Laravel\Passport\Passport;
|
||||
use Log;
|
||||
use Preferences;
|
||||
use Tests\TestCase;
|
||||
|
||||
use Amount;
|
||||
/**
|
||||
* Class CurrencyControllerTest
|
||||
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
|
||||
@@ -65,7 +65,7 @@ class CurrencyControllerTest extends TestCase
|
||||
$currency = TransactionCurrency::first();
|
||||
$repository = $this->mock(CurrencyRepositoryInterface::class);
|
||||
$transformer = $this->mock(CurrencyTransformer::class);
|
||||
$userRepository = $this->mock(UserRepositoryInterface::class);
|
||||
$this->mock(UserRepositoryInterface::class);
|
||||
|
||||
// mock transformer
|
||||
$transformer->shouldReceive('setParameters')->withAnyArgs()->atLeast()->once();
|
||||
@@ -74,6 +74,9 @@ class CurrencyControllerTest extends TestCase
|
||||
$transformer->shouldReceive('getAvailableIncludes')->withAnyArgs()->atLeast()->once()->andReturn([]);
|
||||
$transformer->shouldReceive('transform')->atLeast()->once()->andReturn(['id' => 5]);
|
||||
|
||||
// mock facades.
|
||||
Amount::shouldReceive('getDefaultCurrencyByUser')->atLeast()->once()->andReturn($currency);
|
||||
|
||||
// mock calls:
|
||||
$repository->shouldReceive('setUser')->once();
|
||||
$repository->shouldReceive('store')->andReturn($currency);
|
||||
|
||||
Reference in New Issue
Block a user