mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-11-19 16:10:00 +00:00
Improve test coverage.
This commit is contained in:
@@ -30,6 +30,7 @@ use FireflyIII\Support\Cronjobs\RecurringCronjob;
|
||||
use Illuminate\Support\Collection;
|
||||
use Log;
|
||||
use Mockery;
|
||||
use Preferences;
|
||||
use Tests\TestCase;
|
||||
|
||||
/**
|
||||
@@ -61,7 +62,7 @@ class CronControllerTest extends TestCase
|
||||
$job->shouldReceive('fire')->once()->andReturn(true);
|
||||
$repository = $this->mock(UserRepositoryInterface::class);
|
||||
$repository->shouldReceive('all')->andReturn($users);
|
||||
\Preferences::shouldReceive('getForUser')
|
||||
Preferences::shouldReceive('getForUser')
|
||||
->withArgs([Mockery::any(), 'access_token', null])
|
||||
->andReturn($preference)->once();
|
||||
$response = $this->get(route('cron.cron', ['token']));
|
||||
@@ -83,7 +84,7 @@ class CronControllerTest extends TestCase
|
||||
$job->shouldReceive('fire')->once()->andThrow(new FireflyException('Exception noted.'));
|
||||
$repository = $this->mock(UserRepositoryInterface::class);
|
||||
$repository->shouldReceive('all')->andReturn($users);
|
||||
\Preferences::shouldReceive('getForUser')
|
||||
Preferences::shouldReceive('getForUser')
|
||||
->withArgs([Mockery::any(), 'access_token', null])
|
||||
->andReturn($preference)->once();
|
||||
$response = $this->get(route('cron.cron', ['token']));
|
||||
@@ -105,7 +106,7 @@ class CronControllerTest extends TestCase
|
||||
$job->shouldReceive('fire')->once()->andReturn(false);
|
||||
$repository = $this->mock(UserRepositoryInterface::class);
|
||||
$repository->shouldReceive('all')->andReturn($users);
|
||||
\Preferences::shouldReceive('getForUser')
|
||||
Preferences::shouldReceive('getForUser')
|
||||
->withArgs([Mockery::any(), 'access_token', null])
|
||||
->andReturn($preference)->once();
|
||||
$response = $this->get(route('cron.cron', ['token']));
|
||||
|
||||
Reference in New Issue
Block a user