From fe32fd86c5acce66fcd1b904769b5df97449164b Mon Sep 17 00:00:00 2001 From: Taras Machyshyn Date: Tue, 24 Sep 2019 11:28:08 +0300 Subject: [PATCH] Fix upgrade tests --- .../unit/Espo/Core/Upgrades/Actions/BaseTest.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tests/unit/Espo/Core/Upgrades/Actions/BaseTest.php b/tests/unit/Espo/Core/Upgrades/Actions/BaseTest.php index b17aa5cf38..285aeac1e9 100644 --- a/tests/unit/Espo/Core/Upgrades/Actions/BaseTest.php +++ b/tests/unit/Espo/Core/Upgrades/Actions/BaseTest.php @@ -145,6 +145,11 @@ class BaseTest extends \PHPUnit\Framework\TestCase ->method('getContents') ->will($this->returnValue($manifest)); + $this->objects['config'] + ->expects($this->once()) + ->method('get') + ->will($this->returnValue([])); + $this->reflection->invokeMethod('getManifest', array()); } @@ -222,6 +227,11 @@ class BaseTest extends \PHPUnit\Framework\TestCase $this->expectException('\Espo\Core\Exceptions\Error'); + $this->objects['config'] + ->expects($this->once()) + ->method('get') + ->will($this->returnValue([])); + $this->reflection->invokeMethod('checkVersions', array($versions, $currentVersion, 'error')); } @@ -262,7 +272,13 @@ class BaseTest extends \PHPUnit\Framework\TestCase { $this->expectException('\Espo\Core\Exceptions\Error'); + $this->objects['config'] + ->expects($this->once()) + ->method('get') + ->will($this->returnValue([])); + $this->reflection->setProperty('data', array('manifest' => array('type' => 'upgrade'))); + $this->assertTrue( $this->reflection->invokeMethod('checkPackageType') ); } }