aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/bookmark
diff options
context:
space:
mode:
authorArthurHoaro <arthur@hoa.ro>2020-09-29 14:41:40 +0200
committerArthurHoaro <arthur@hoa.ro>2020-09-29 18:57:20 +0200
commita5a9cf23acd1248585173aa32757d9720b5f2d62 (patch)
tree5b443e09fc0f84db0cb478cda0c88c10346b0843 /tests/bookmark
parent2b7a7bc928fb7fc171138e248d3aa1d86d5b62f9 (diff)
downloadShaarli-a5a9cf23acd1248585173aa32757d9720b5f2d62.tar.gz
Shaarli-a5a9cf23acd1248585173aa32757d9720b5f2d62.tar.zst
Shaarli-a5a9cf23acd1248585173aa32757d9720b5f2d62.zip
Compatibility with PHPUnit 9
Diffstat (limited to 'tests/bookmark')
-rw-r--r--tests/bookmark/BookmarkArrayTest.php5
-rw-r--r--tests/bookmark/BookmarkFileServiceTest.php4
-rw-r--r--tests/bookmark/BookmarkFilterTest.php2
-rw-r--r--tests/bookmark/BookmarkInitializerTest.php2
-rw-r--r--tests/bookmark/BookmarkTest.php12
-rw-r--r--tests/bookmark/LinkUtilsTest.php22
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
3namespace Shaarli\Bookmark; 3namespace Shaarli\Bookmark;
4 4
5use PHPUnit\Framework\TestCase; 5use Shaarli\TestCase;
6use Shaarli\Bookmark\Exception\InvalidBookmarkException;
7use Shaarli\Config\ConfigManager;
8use 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 @@
6namespace Shaarli\Bookmark; 6namespace Shaarli\Bookmark;
7 7
8use DateTime; 8use DateTime;
9use PHPUnit\Framework\TestCase;
10use ReferenceLinkDB; 9use ReferenceLinkDB;
11use ReflectionClass; 10use ReflectionClass;
12use Shaarli; 11use Shaarli;
@@ -14,6 +13,7 @@ use Shaarli\Bookmark\Exception\BookmarkNotFoundException;
14use Shaarli\Config\ConfigManager; 13use Shaarli\Config\ConfigManager;
15use Shaarli\Formatter\BookmarkMarkdownFormatter; 14use Shaarli\Formatter\BookmarkMarkdownFormatter;
16use Shaarli\History; 15use Shaarli\History;
16use 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 @@
3namespace Shaarli\Bookmark; 3namespace Shaarli\Bookmark;
4 4
5use Exception; 5use Exception;
6use PHPUnit\Framework\TestCase;
7use ReferenceLinkDB; 6use ReferenceLinkDB;
8use Shaarli\Config\ConfigManager; 7use Shaarli\Config\ConfigManager;
9use Shaarli\History; 8use Shaarli\History;
9use 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
3namespace Shaarli\Bookmark; 3namespace Shaarli\Bookmark;
4 4
5use PHPUnit\Framework\TestCase;
6use Shaarli\Config\ConfigManager; 5use Shaarli\Config\ConfigManager;
7use Shaarli\History; 6use Shaarli\History;
7use 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
3namespace Shaarli\Bookmark; 3namespace Shaarli\Bookmark;
4 4
5use PHPUnit\Framework\TestCase;
6use Shaarli\Bookmark\Exception\InvalidBookmarkException; 5use Shaarli\Bookmark\Exception\InvalidBookmarkException;
6use 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
3namespace Shaarli\Bookmark; 3namespace Shaarli\Bookmark;
4 4
5use PHPUnit\Framework\TestCase; 5use Shaarli\TestCase;
6 6
7require_once 'tests/utils/CurlUtils.php'; 7require_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 /**