diff options
Diffstat (limited to 'tests/legacy/LegacyUpdaterTest.php')
-rw-r--r-- | tests/legacy/LegacyUpdaterTest.php | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/tests/legacy/LegacyUpdaterTest.php b/tests/legacy/LegacyUpdaterTest.php index acfac530..f7391b86 100644 --- a/tests/legacy/LegacyUpdaterTest.php +++ b/tests/legacy/LegacyUpdaterTest.php | |||
@@ -20,7 +20,7 @@ require_once 'inc/rain.tpl.class.php'; | |||
20 | * Class UpdaterTest. | 20 | * Class UpdaterTest. |
21 | * Runs unit tests against the updater class. | 21 | * Runs unit tests against the updater class. |
22 | */ | 22 | */ |
23 | class LegacyUpdaterTest extends \PHPUnit\Framework\TestCase | 23 | class LegacyUpdaterTest extends \Shaarli\TestCase |
24 | { | 24 | { |
25 | /** | 25 | /** |
26 | * @var string Path to test datastore. | 26 | * @var string Path to test datastore. |
@@ -80,11 +80,10 @@ class LegacyUpdaterTest extends \PHPUnit\Framework\TestCase | |||
80 | 80 | ||
81 | /** | 81 | /** |
82 | * Test errors in UpdaterUtils::write_updates_file(): empty updates file. | 82 | * Test errors in UpdaterUtils::write_updates_file(): empty updates file. |
83 | * | ||
84 | * @expectedException Exception | ||
85 | */ | 83 | */ |
86 | public function testWriteEmptyUpdatesFile() | 84 | public function testWriteEmptyUpdatesFile() |
87 | { | 85 | { |
86 | $this->expectException(\Exception::class); | ||
88 | $this->expectExceptionMessageRegExp('/Updates file path is not set(.*)/'); | 87 | $this->expectExceptionMessageRegExp('/Updates file path is not set(.*)/'); |
89 | 88 | ||
90 | UpdaterUtils::write_updates_file('', array('test')); | 89 | UpdaterUtils::write_updates_file('', array('test')); |
@@ -92,11 +91,10 @@ class LegacyUpdaterTest extends \PHPUnit\Framework\TestCase | |||
92 | 91 | ||
93 | /** | 92 | /** |
94 | * Test errors in UpdaterUtils::write_updates_file(): not writable updates file. | 93 | * Test errors in UpdaterUtils::write_updates_file(): not writable updates file. |
95 | * | ||
96 | * @expectedException Exception | ||
97 | */ | 94 | */ |
98 | public function testWriteUpdatesFileNotWritable() | 95 | public function testWriteUpdatesFileNotWritable() |
99 | { | 96 | { |
97 | $this->expectException(\Exception::class); | ||
100 | $this->expectExceptionMessageRegExp('/Unable to write(.*)/'); | 98 | $this->expectExceptionMessageRegExp('/Unable to write(.*)/'); |
101 | 99 | ||
102 | $updatesFile = $this->conf->get('resource.data_dir') . '/updates.txt'; | 100 | $updatesFile = $this->conf->get('resource.data_dir') . '/updates.txt'; |
@@ -725,7 +723,7 @@ $GLOBALS[\'privateLinkByDefault\'] = true;'; | |||
725 | $this->assertEquals(\Shaarli\Thumbnailer::MODE_ALL, $this->conf->get('thumbnails.mode')); | 723 | $this->assertEquals(\Shaarli\Thumbnailer::MODE_ALL, $this->conf->get('thumbnails.mode')); |
726 | $this->assertEquals(125, $this->conf->get('thumbnails.width')); | 724 | $this->assertEquals(125, $this->conf->get('thumbnails.width')); |
727 | $this->assertEquals(90, $this->conf->get('thumbnails.height')); | 725 | $this->assertEquals(90, $this->conf->get('thumbnails.height')); |
728 | $this->assertContains('You have enabled or changed thumbnails', $_SESSION['warnings'][0]); | 726 | $this->assertContainsPolyfill('You have enabled or changed thumbnails', $_SESSION['warnings'][0]); |
729 | } | 727 | } |
730 | 728 | ||
731 | /** | 729 | /** |