diff options
Diffstat (limited to 'tests/bookmark')
-rw-r--r-- | tests/bookmark/BookmarkArrayTest.php | 5 | ||||
-rw-r--r-- | tests/bookmark/BookmarkFileServiceTest.php | 4 | ||||
-rw-r--r-- | tests/bookmark/BookmarkFilterTest.php | 2 | ||||
-rw-r--r-- | tests/bookmark/BookmarkInitializerTest.php | 2 | ||||
-rw-r--r-- | tests/bookmark/BookmarkTest.php | 12 | ||||
-rw-r--r-- | tests/bookmark/LinkUtilsTest.php | 22 |
6 files changed, 22 insertions, 25 deletions
diff --git a/tests/bookmark/BookmarkArrayTest.php b/tests/bookmark/BookmarkArrayTest.php index bad3af8d..ebed9bfc 100644 --- a/tests/bookmark/BookmarkArrayTest.php +++ b/tests/bookmark/BookmarkArrayTest.php | |||
@@ -2,10 +2,7 @@ | |||
2 | 2 | ||
3 | namespace Shaarli\Bookmark; | 3 | namespace Shaarli\Bookmark; |
4 | 4 | ||
5 | use PHPUnit\Framework\TestCase; | 5 | use Shaarli\TestCase; |
6 | use Shaarli\Bookmark\Exception\InvalidBookmarkException; | ||
7 | use Shaarli\Config\ConfigManager; | ||
8 | use Shaarli\History; | ||
9 | 6 | ||
10 | /** | 7 | /** |
11 | * Class BookmarkArrayTest | 8 | * Class BookmarkArrayTest |
diff --git a/tests/bookmark/BookmarkFileServiceTest.php b/tests/bookmark/BookmarkFileServiceTest.php index 9cff0fb3..51e71a85 100644 --- a/tests/bookmark/BookmarkFileServiceTest.php +++ b/tests/bookmark/BookmarkFileServiceTest.php | |||
@@ -6,7 +6,6 @@ | |||
6 | namespace Shaarli\Bookmark; | 6 | namespace Shaarli\Bookmark; |
7 | 7 | ||
8 | use DateTime; | 8 | use DateTime; |
9 | use PHPUnit\Framework\TestCase; | ||
10 | use ReferenceLinkDB; | 9 | use ReferenceLinkDB; |
11 | use ReflectionClass; | 10 | use ReflectionClass; |
12 | use Shaarli; | 11 | use Shaarli; |
@@ -14,6 +13,7 @@ use Shaarli\Bookmark\Exception\BookmarkNotFoundException; | |||
14 | use Shaarli\Config\ConfigManager; | 13 | use Shaarli\Config\ConfigManager; |
15 | use Shaarli\Formatter\BookmarkMarkdownFormatter; | 14 | use Shaarli\Formatter\BookmarkMarkdownFormatter; |
16 | use Shaarli\History; | 15 | use Shaarli\History; |
16 | use Shaarli\TestCase; | ||
17 | 17 | ||
18 | /** | 18 | /** |
19 | * Unitary tests for LegacyLinkDBTest | 19 | * Unitary tests for LegacyLinkDBTest |
@@ -748,7 +748,7 @@ class BookmarkFileServiceTest extends TestCase | |||
748 | $link = $this->publicLinkDB->findByUrl('http://mediagoblin.org/'); | 748 | $link = $this->publicLinkDB->findByUrl('http://mediagoblin.org/'); |
749 | 749 | ||
750 | $this->assertNotEquals(false, $link); | 750 | $this->assertNotEquals(false, $link); |
751 | $this->assertContains( | 751 | $this->assertContainsPolyfill( |
752 | 'A free software media publishing platform', | 752 | 'A free software media publishing platform', |
753 | $link->getDescription() | 753 | $link->getDescription() |
754 | ); | 754 | ); |
diff --git a/tests/bookmark/BookmarkFilterTest.php b/tests/bookmark/BookmarkFilterTest.php index 752631a5..2f15cb3c 100644 --- a/tests/bookmark/BookmarkFilterTest.php +++ b/tests/bookmark/BookmarkFilterTest.php | |||
@@ -3,10 +3,10 @@ | |||
3 | namespace Shaarli\Bookmark; | 3 | namespace Shaarli\Bookmark; |
4 | 4 | ||
5 | use Exception; | 5 | use Exception; |
6 | use PHPUnit\Framework\TestCase; | ||
7 | use ReferenceLinkDB; | 6 | use ReferenceLinkDB; |
8 | use Shaarli\Config\ConfigManager; | 7 | use Shaarli\Config\ConfigManager; |
9 | use Shaarli\History; | 8 | use Shaarli\History; |
9 | use Shaarli\TestCase; | ||
10 | 10 | ||
11 | /** | 11 | /** |
12 | * Class BookmarkFilterTest. | 12 | * Class BookmarkFilterTest. |
diff --git a/tests/bookmark/BookmarkInitializerTest.php b/tests/bookmark/BookmarkInitializerTest.php index 454269bb..25704004 100644 --- a/tests/bookmark/BookmarkInitializerTest.php +++ b/tests/bookmark/BookmarkInitializerTest.php | |||
@@ -2,9 +2,9 @@ | |||
2 | 2 | ||
3 | namespace Shaarli\Bookmark; | 3 | namespace Shaarli\Bookmark; |
4 | 4 | ||
5 | use PHPUnit\Framework\TestCase; | ||
6 | use Shaarli\Config\ConfigManager; | 5 | use Shaarli\Config\ConfigManager; |
7 | use Shaarli\History; | 6 | use Shaarli\History; |
7 | use Shaarli\TestCase; | ||
8 | 8 | ||
9 | /** | 9 | /** |
10 | * Class BookmarkInitializerTest | 10 | * Class BookmarkInitializerTest |
diff --git a/tests/bookmark/BookmarkTest.php b/tests/bookmark/BookmarkTest.php index 4b6a3c07..afec2440 100644 --- a/tests/bookmark/BookmarkTest.php +++ b/tests/bookmark/BookmarkTest.php | |||
@@ -2,8 +2,8 @@ | |||
2 | 2 | ||
3 | namespace Shaarli\Bookmark; | 3 | namespace Shaarli\Bookmark; |
4 | 4 | ||
5 | use PHPUnit\Framework\TestCase; | ||
6 | use Shaarli\Bookmark\Exception\InvalidBookmarkException; | 5 | use Shaarli\Bookmark\Exception\InvalidBookmarkException; |
6 | use Shaarli\TestCase; | ||
7 | 7 | ||
8 | /** | 8 | /** |
9 | * Class BookmarkTest | 9 | * Class BookmarkTest |
@@ -150,7 +150,7 @@ class BookmarkTest extends TestCase | |||
150 | $exception = $e; | 150 | $exception = $e; |
151 | } | 151 | } |
152 | $this->assertNotNull($exception); | 152 | $this->assertNotNull($exception); |
153 | $this->assertContains('- ID: '. PHP_EOL, $exception->getMessage()); | 153 | $this->assertContainsPolyfill('- ID: '. PHP_EOL, $exception->getMessage()); |
154 | } | 154 | } |
155 | 155 | ||
156 | /** | 156 | /** |
@@ -169,7 +169,7 @@ class BookmarkTest extends TestCase | |||
169 | $exception = $e; | 169 | $exception = $e; |
170 | } | 170 | } |
171 | $this->assertNotNull($exception); | 171 | $this->assertNotNull($exception); |
172 | $this->assertContains('- ID: str'. PHP_EOL, $exception->getMessage()); | 172 | $this->assertContainsPolyfill('- ID: str'. PHP_EOL, $exception->getMessage()); |
173 | } | 173 | } |
174 | 174 | ||
175 | /** | 175 | /** |
@@ -188,7 +188,7 @@ class BookmarkTest extends TestCase | |||
188 | $exception = $e; | 188 | $exception = $e; |
189 | } | 189 | } |
190 | $this->assertNotNull($exception); | 190 | $this->assertNotNull($exception); |
191 | $this->assertContains('- ShortUrl: '. PHP_EOL, $exception->getMessage()); | 191 | $this->assertContainsPolyfill('- ShortUrl: '. PHP_EOL, $exception->getMessage()); |
192 | } | 192 | } |
193 | 193 | ||
194 | /** | 194 | /** |
@@ -207,7 +207,7 @@ class BookmarkTest extends TestCase | |||
207 | $exception = $e; | 207 | $exception = $e; |
208 | } | 208 | } |
209 | $this->assertNotNull($exception); | 209 | $this->assertNotNull($exception); |
210 | $this->assertContains('- Created: '. PHP_EOL, $exception->getMessage()); | 210 | $this->assertContainsPolyfill('- Created: '. PHP_EOL, $exception->getMessage()); |
211 | } | 211 | } |
212 | 212 | ||
213 | /** | 213 | /** |
@@ -226,7 +226,7 @@ class BookmarkTest extends TestCase | |||
226 | $exception = $e; | 226 | $exception = $e; |
227 | } | 227 | } |
228 | $this->assertNotNull($exception); | 228 | $this->assertNotNull($exception); |
229 | $this->assertContains('- Created: Not a DateTime object'. PHP_EOL, $exception->getMessage()); | 229 | $this->assertContainsPolyfill('- Created: Not a DateTime object'. PHP_EOL, $exception->getMessage()); |
230 | } | 230 | } |
231 | 231 | ||
232 | /** | 232 | /** |
diff --git a/tests/bookmark/LinkUtilsTest.php b/tests/bookmark/LinkUtilsTest.php index 7d4a7b89..a7087953 100644 --- a/tests/bookmark/LinkUtilsTest.php +++ b/tests/bookmark/LinkUtilsTest.php | |||
@@ -2,7 +2,7 @@ | |||
2 | 2 | ||
3 | namespace Shaarli\Bookmark; | 3 | namespace Shaarli\Bookmark; |
4 | 4 | ||
5 | use PHPUnit\Framework\TestCase; | 5 | use Shaarli\TestCase; |
6 | 6 | ||
7 | require_once 'tests/utils/CurlUtils.php'; | 7 | require_once 'tests/utils/CurlUtils.php'; |
8 | 8 | ||
@@ -437,13 +437,13 @@ class LinkUtilsTest extends TestCase | |||
437 | カタカナ #カタカナ」カタカナ\n'; | 437 | カタカナ #カタカナ」カタカナ\n'; |
438 | $autolinkedDescription = hashtag_autolink($rawDescription, $index); | 438 | $autolinkedDescription = hashtag_autolink($rawDescription, $index); |
439 | 439 | ||
440 | $this->assertContains($this->getHashtagLink('hashtag', $index), $autolinkedDescription); | 440 | $this->assertContainsPolyfill($this->getHashtagLink('hashtag', $index), $autolinkedDescription); |
441 | $this->assertNotContains(' #hashtag', $autolinkedDescription); | 441 | $this->assertNotContainsPolyfill(' #hashtag', $autolinkedDescription); |
442 | $this->assertNotContains('>#nothashtag', $autolinkedDescription); | 442 | $this->assertNotContainsPolyfill('>#nothashtag', $autolinkedDescription); |
443 | $this->assertContains($this->getHashtagLink('ашок', $index), $autolinkedDescription); | 443 | $this->assertContainsPolyfill($this->getHashtagLink('ашок', $index), $autolinkedDescription); |
444 | $this->assertContains($this->getHashtagLink('カタカナ', $index), $autolinkedDescription); | 444 | $this->assertContainsPolyfill($this->getHashtagLink('カタカナ', $index), $autolinkedDescription); |
445 | $this->assertContains($this->getHashtagLink('hashtag_hashtag', $index), $autolinkedDescription); | 445 | $this->assertContainsPolyfill($this->getHashtagLink('hashtag_hashtag', $index), $autolinkedDescription); |
446 | $this->assertNotContains($this->getHashtagLink('hashtag-nothashtag', $index), $autolinkedDescription); | 446 | $this->assertNotContainsPolyfill($this->getHashtagLink('hashtag-nothashtag', $index), $autolinkedDescription); |
447 | } | 447 | } |
448 | 448 | ||
449 | /** | 449 | /** |
@@ -454,9 +454,9 @@ class LinkUtilsTest extends TestCase | |||
454 | $rawDescription = 'blabla #hashtag x#nothashtag'; | 454 | $rawDescription = 'blabla #hashtag x#nothashtag'; |
455 | $autolinkedDescription = hashtag_autolink($rawDescription); | 455 | $autolinkedDescription = hashtag_autolink($rawDescription); |
456 | 456 | ||
457 | $this->assertContains($this->getHashtagLink('hashtag'), $autolinkedDescription); | 457 | $this->assertContainsPolyfill($this->getHashtagLink('hashtag'), $autolinkedDescription); |
458 | $this->assertNotContains(' #hashtag', $autolinkedDescription); | 458 | $this->assertNotContainsPolyfill(' #hashtag', $autolinkedDescription); |
459 | $this->assertNotContains('>#nothashtag', $autolinkedDescription); | 459 | $this->assertNotContainsPolyfill('>#nothashtag', $autolinkedDescription); |
460 | } | 460 | } |
461 | 461 | ||
462 | /** | 462 | /** |