Various code coverage changes and code updates.

This commit is contained in:
James Cole
2018-07-12 21:32:58 +02:00
parent 0217d9396a
commit 5846431b34
20 changed files with 398 additions and 224 deletions

View File

@@ -59,10 +59,11 @@ class VersionCheckEventHandlerTest extends TestCase
// report on config variables:
FireflyConfig::shouldReceive('get')->withArgs(['permission_update_check', -1])->once()->andReturn($updateConfig);
FireflyConfig::shouldReceive('get')->withArgs(['last_update_check', Mockery::any()])->once()->andReturn($checkConfig);
FireflyConfig::shouldReceive('set')->withArgs(['last_update_check', Mockery::any()])->once()->andReturn($checkConfig);
// request thing:
$request->shouldReceive('call')->once();
$request->shouldReceive('getReleases')->once()->andThrow(new FireflyException('Errrr'));
$request->shouldReceive('call')->once()->andThrow(new FireflyException('Errrr'));
$request->shouldReceive('getReleases')->once();
$handler = new VersionCheckEventHandler;
@@ -140,6 +141,7 @@ class VersionCheckEventHandlerTest extends TestCase
// report on config variables:
FireflyConfig::shouldReceive('get')->withArgs(['permission_update_check', -1])->once()->andReturn($updateConfig);
FireflyConfig::shouldReceive('get')->withArgs(['last_update_check', Mockery::any()])->once()->andReturn($checkConfig);
FireflyConfig::shouldReceive('set')->withArgs(['last_update_check', Mockery::any()])->once()->andReturn($checkConfig);
$handler = new VersionCheckEventHandler;
$handler->checkForUpdates($event);
@@ -164,6 +166,7 @@ class VersionCheckEventHandlerTest extends TestCase
// report on config variables:
FireflyConfig::shouldReceive('get')->withArgs(['permission_update_check', -1])->once()->andReturn($updateConfig);
FireflyConfig::shouldReceive('get')->withArgs(['last_update_check', Mockery::any()])->once()->andReturn($checkConfig);
FireflyConfig::shouldReceive('set')->withArgs(['last_update_check', Mockery::any()])->once()->andReturn($checkConfig);
$handler = new VersionCheckEventHandler;
$handler->checkForUpdates($event);