diff options
Diffstat (limited to 'tests/ApplicationUtilsTest.php')
-rw-r--r-- | tests/ApplicationUtilsTest.php | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/tests/ApplicationUtilsTest.php b/tests/ApplicationUtilsTest.php index 15388970..421d2dd9 100644 --- a/tests/ApplicationUtilsTest.php +++ b/tests/ApplicationUtilsTest.php | |||
@@ -17,7 +17,7 @@ class ApplicationUtilsTest extends \PHPUnit\Framework\TestCase | |||
17 | /** | 17 | /** |
18 | * Reset test data for each test | 18 | * Reset test data for each test |
19 | */ | 19 | */ |
20 | public function setUp() | 20 | protected function setUp(): void |
21 | { | 21 | { |
22 | FakeApplicationUtils::$VERSION_CODE = ''; | 22 | FakeApplicationUtils::$VERSION_CODE = ''; |
23 | if (file_exists(self::$testUpdateFile)) { | 23 | if (file_exists(self::$testUpdateFile)) { |
@@ -28,7 +28,7 @@ class ApplicationUtilsTest extends \PHPUnit\Framework\TestCase | |||
28 | /** | 28 | /** |
29 | * Remove test version file if it exists | 29 | * Remove test version file if it exists |
30 | */ | 30 | */ |
31 | public function tearDown() | 31 | protected function tearDown(): void |
32 | { | 32 | { |
33 | if (is_file('sandbox/version.php')) { | 33 | if (is_file('sandbox/version.php')) { |
34 | unlink('sandbox/version.php'); | 34 | unlink('sandbox/version.php'); |
@@ -145,10 +145,11 @@ class ApplicationUtilsTest extends \PHPUnit\Framework\TestCase | |||
145 | /** | 145 | /** |
146 | * Test update checks - invalid Git branch | 146 | * Test update checks - invalid Git branch |
147 | * @expectedException Exception | 147 | * @expectedException Exception |
148 | * @expectedExceptionMessageRegExp /Invalid branch selected for updates/ | ||
149 | */ | 148 | */ |
150 | public function testCheckUpdateInvalidGitBranch() | 149 | public function testCheckUpdateInvalidGitBranch() |
151 | { | 150 | { |
151 | $this->expectExceptionMessageRegExp('/Invalid branch selected for updates/'); | ||
152 | |||
152 | ApplicationUtils::checkUpdate('', 'null', 0, true, true, 'unstable'); | 153 | ApplicationUtils::checkUpdate('', 'null', 0, true, true, 'unstable'); |
153 | } | 154 | } |
154 | 155 | ||
@@ -261,20 +262,22 @@ class ApplicationUtilsTest extends \PHPUnit\Framework\TestCase | |||
261 | /** | 262 | /** |
262 | * Check a unsupported PHP version | 263 | * Check a unsupported PHP version |
263 | * @expectedException Exception | 264 | * @expectedException Exception |
264 | * @expectedExceptionMessageRegExp /Your PHP version is obsolete/ | ||
265 | */ | 265 | */ |
266 | public function testCheckSupportedPHPVersion51() | 266 | public function testCheckSupportedPHPVersion51() |
267 | { | 267 | { |
268 | $this->expectExceptionMessageRegExp('/Your PHP version is obsolete/'); | ||
269 | |||
268 | $this->assertTrue(ApplicationUtils::checkPHPVersion('5.3', '5.1.0')); | 270 | $this->assertTrue(ApplicationUtils::checkPHPVersion('5.3', '5.1.0')); |
269 | } | 271 | } |
270 | 272 | ||
271 | /** | 273 | /** |
272 | * Check another unsupported PHP version | 274 | * Check another unsupported PHP version |
273 | * @expectedException Exception | 275 | * @expectedException Exception |
274 | * @expectedExceptionMessageRegExp /Your PHP version is obsolete/ | ||
275 | */ | 276 | */ |
276 | public function testCheckSupportedPHPVersion52() | 277 | public function testCheckSupportedPHPVersion52() |
277 | { | 278 | { |
279 | $this->expectExceptionMessageRegExp('/Your PHP version is obsolete/'); | ||
280 | |||
278 | $this->assertTrue(ApplicationUtils::checkPHPVersion('5.3', '5.2')); | 281 | $this->assertTrue(ApplicationUtils::checkPHPVersion('5.3', '5.2')); |
279 | } | 282 | } |
280 | 283 | ||