X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=tests%2Flegacy%2FLegacyUpdaterTest.php;h=acfac5306c2756f370a175deaeca5a57c3ef0bae;hb=2b7a7bc928fb7fc171138e248d3aa1d86d5b62f9;hp=9b693dcb2eb21f46eceecbcb92b837640c337341;hpb=8f60e1206e45e67c96a7630d4ff94e72fe875f09;p=github%2Fshaarli%2FShaarli.git diff --git a/tests/legacy/LegacyUpdaterTest.php b/tests/legacy/LegacyUpdaterTest.php index 9b693dcb..acfac530 100644 --- a/tests/legacy/LegacyUpdaterTest.php +++ b/tests/legacy/LegacyUpdaterTest.php @@ -82,10 +82,11 @@ class LegacyUpdaterTest extends \PHPUnit\Framework\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')); } @@ -93,10 +94,11 @@ class LegacyUpdaterTest extends \PHPUnit\Framework\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); @@ -161,11 +163,11 @@ class LegacyUpdaterTest extends \PHPUnit\Framework\TestCase /** * Test Update failed. - * - * @expectedException \Exception */ public function testUpdateFailed() { + $this->expectException(\Exception::class); + $updates = array( 'updateMethodDummy1', 'updateMethodDummy2',