X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=tests%2Fupdater%2FUpdaterTest.php;h=5cfcd5db4f74c54bc0078129b86afbd4cb7ae26f;hb=c3fca560b624588d37508142ab73573caf467573;hp=a7dd70bfc4b1a386bf27b7d8964984a458e23607;hpb=af41d5ab5d2bd3ba64d052c997bc6afa6966a63c;p=github%2Fshaarli%2FShaarli.git diff --git a/tests/updater/UpdaterTest.php b/tests/updater/UpdaterTest.php index a7dd70bf..5cfcd5db 100644 --- a/tests/updater/UpdaterTest.php +++ b/tests/updater/UpdaterTest.php @@ -42,7 +42,7 @@ class UpdaterTest extends TestCase /** * Executed before each test. */ - public function setUp() + protected function setUp(): void { $this->refDB = new \ReferenceLinkDB(); $this->refDB->write(self::$testDatastore); @@ -89,10 +89,11 @@ class UpdaterTest extends TestCase * Test errors in UpdaterUtils::write_updates_file(): empty updates file. * * @expectedException Exception - * @expectedExceptionMessageRegExp /Updates file path is not set(.*)/ */ public function testWriteEmptyUpdatesFile() { + $this->expectExceptionMessageRegExp('/Updates file path is not set(.*)/'); + UpdaterUtils::write_updates_file('', array('test')); } @@ -100,10 +101,11 @@ class UpdaterTest extends TestCase * Test errors in UpdaterUtils::write_updates_file(): not writable updates file. * * @expectedException Exception - * @expectedExceptionMessageRegExp /Unable to write(.*)/ */ public function testWriteUpdatesFileNotWritable() { + $this->expectExceptionMessageRegExp('/Unable to write(.*)/'); + $updatesFile = $this->conf->get('resource.data_dir') . '/updates.txt'; touch($updatesFile); chmod($updatesFile, 0444); @@ -168,11 +170,11 @@ class UpdaterTest extends TestCase /** * Test Update failed. - * - * @expectedException \Exception */ public function testUpdateFailed() { + $this->expectException(\Exception::class); + $updates = array( 'updateMethodDummy1', 'updateMethodDummy2',