diff options
author | ArthurHoaro <arthur@hoa.ro> | 2020-10-03 12:59:16 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-03 12:59:16 +0200 |
commit | 7b18876361f2223672f3a2cac9fc0da16d12d69f (patch) | |
tree | 03a655c46d801d56211fb05cc2930824dace4565 /tests/legacy/LegacyUpdaterTest.php | |
parent | ee07b7283faa197fc062ed85f4f96f98e8e77b03 (diff) | |
parent | d246e2c5129fe8d3f8e1429b4e8ff8e3e486c779 (diff) | |
download | Shaarli-7b18876361f2223672f3a2cac9fc0da16d12d69f.tar.gz Shaarli-7b18876361f2223672f3a2cac9fc0da16d12d69f.tar.zst Shaarli-7b18876361f2223672f3a2cac9fc0da16d12d69f.zip |
Merge pull request #1575 from ArthurHoaro/feature/php8
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 | /** |