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/LegacyLinkDBTest.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/LegacyLinkDBTest.php')
-rw-r--r-- | tests/legacy/LegacyLinkDBTest.php | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/tests/legacy/LegacyLinkDBTest.php b/tests/legacy/LegacyLinkDBTest.php index 819bc272..df2cad62 100644 --- a/tests/legacy/LegacyLinkDBTest.php +++ b/tests/legacy/LegacyLinkDBTest.php | |||
@@ -18,7 +18,7 @@ require_once 'tests/utils/ReferenceLinkDB.php'; | |||
18 | /** | 18 | /** |
19 | * Unitary tests for LegacyLinkDBTest | 19 | * Unitary tests for LegacyLinkDBTest |
20 | */ | 20 | */ |
21 | class LegacyLinkDBTest extends \PHPUnit\Framework\TestCase | 21 | class LegacyLinkDBTest extends \Shaarli\TestCase |
22 | { | 22 | { |
23 | // datastore to test write operations | 23 | // datastore to test write operations |
24 | protected static $testDatastore = 'sandbox/datastore.php'; | 24 | protected static $testDatastore = 'sandbox/datastore.php'; |
@@ -99,11 +99,10 @@ class LegacyLinkDBTest extends \PHPUnit\Framework\TestCase | |||
99 | 99 | ||
100 | /** | 100 | /** |
101 | * Attempt to instantiate a LinkDB whereas the datastore is not writable | 101 | * Attempt to instantiate a LinkDB whereas the datastore is not writable |
102 | * | ||
103 | * @expectedException Shaarli\Exceptions\IOException | ||
104 | */ | 102 | */ |
105 | public function testConstructDatastoreNotWriteable() | 103 | public function testConstructDatastoreNotWriteable() |
106 | { | 104 | { |
105 | $this->expectException(\Shaarli\Exceptions\IOException::class); | ||
107 | $this->expectExceptionMessageRegExp('/Error accessing "null"/'); | 106 | $this->expectExceptionMessageRegExp('/Error accessing "null"/'); |
108 | 107 | ||
109 | new LegacyLinkDB('null/store.db', false, false); | 108 | new LegacyLinkDB('null/store.db', false, false); |
@@ -258,7 +257,7 @@ class LegacyLinkDBTest extends \PHPUnit\Framework\TestCase | |||
258 | $link = self::$publicLinkDB->getLinkFromUrl('http://mediagoblin.org/'); | 257 | $link = self::$publicLinkDB->getLinkFromUrl('http://mediagoblin.org/'); |
259 | 258 | ||
260 | $this->assertNotEquals(false, $link); | 259 | $this->assertNotEquals(false, $link); |
261 | $this->assertContains( | 260 | $this->assertContainsPolyfill( |
262 | 'A free software media publishing platform', | 261 | 'A free software media publishing platform', |
263 | $link['description'] | 262 | $link['description'] |
264 | ); | 263 | ); |
@@ -471,9 +470,9 @@ class LegacyLinkDBTest extends \PHPUnit\Framework\TestCase | |||
471 | 470 | ||
472 | $res = $linkDB->renameTag('cartoon', 'Taz'); | 471 | $res = $linkDB->renameTag('cartoon', 'Taz'); |
473 | $this->assertEquals(3, count($res)); | 472 | $this->assertEquals(3, count($res)); |
474 | $this->assertContains(' Taz ', $linkDB[4]['tags']); | 473 | $this->assertContainsPolyfill(' Taz ', $linkDB[4]['tags']); |
475 | $this->assertContains(' Taz ', $linkDB[1]['tags']); | 474 | $this->assertContainsPolyfill(' Taz ', $linkDB[1]['tags']); |
476 | $this->assertContains(' Taz ', $linkDB[0]['tags']); | 475 | $this->assertContainsPolyfill(' Taz ', $linkDB[0]['tags']); |
477 | } | 476 | } |
478 | 477 | ||
479 | /** | 478 | /** |
@@ -513,7 +512,7 @@ class LegacyLinkDBTest extends \PHPUnit\Framework\TestCase | |||
513 | 512 | ||
514 | $res = $linkDB->renameTag('cartoon', null); | 513 | $res = $linkDB->renameTag('cartoon', null); |
515 | $this->assertEquals(3, count($res)); | 514 | $this->assertEquals(3, count($res)); |
516 | $this->assertNotContains('cartoon', $linkDB[4]['tags']); | 515 | $this->assertNotContainsPolyfill('cartoon', $linkDB[4]['tags']); |
517 | } | 516 | } |
518 | 517 | ||
519 | /** | 518 | /** |