aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/bookmark/BookmarkArrayTest.php
diff options
context:
space:
mode:
authorArthurHoaro <arthur@hoa.ro>2020-09-29 11:36:27 +0200
committerGitHub <noreply@github.com>2020-09-29 11:36:27 +0200
commit6cdca9562c7685e9a0eb77b51584d0cc458c44e0 (patch)
tree518de2057da549d0baa982c6aa689aa813377774 /tests/bookmark/BookmarkArrayTest.php
parentd0ae1ba273b6decea8d35ef79bfabb055b0fb6df (diff)
parentb1baca99f280570d0336b4d71ad1f9dca213a35b (diff)
downloadShaarli-6cdca9562c7685e9a0eb77b51584d0cc458c44e0.tar.gz
Shaarli-6cdca9562c7685e9a0eb77b51584d0cc458c44e0.tar.zst
Shaarli-6cdca9562c7685e9a0eb77b51584d0cc458c44e0.zip
Merge pull request #1572 from ArthurHoaro/feature/php8
Diffstat (limited to 'tests/bookmark/BookmarkArrayTest.php')
-rw-r--r--tests/bookmark/BookmarkArrayTest.php24
1 files changed, 12 insertions, 12 deletions
diff --git a/tests/bookmark/BookmarkArrayTest.php b/tests/bookmark/BookmarkArrayTest.php
index 0f8f04c5..bad3af8d 100644
--- a/tests/bookmark/BookmarkArrayTest.php
+++ b/tests/bookmark/BookmarkArrayTest.php
@@ -47,22 +47,22 @@ class BookmarkArrayTest extends TestCase
47 47
48 /** 48 /**
49 * Test adding a bad entry: wrong type 49 * Test adding a bad entry: wrong type
50 *
51 * @expectedException Shaarli\Bookmark\Exception\InvalidBookmarkException
52 */ 50 */
53 public function testArrayAccessAddBadEntryInstance() 51 public function testArrayAccessAddBadEntryInstance()
54 { 52 {
53 $this->expectException(\Shaarli\Bookmark\Exception\InvalidBookmarkException::class);
54
55 $array = new BookmarkArray(); 55 $array = new BookmarkArray();
56 $array[] = 'nope'; 56 $array[] = 'nope';
57 } 57 }
58 58
59 /** 59 /**
60 * Test adding a bad entry: no id 60 * Test adding a bad entry: no id
61 *
62 * @expectedException Shaarli\Bookmark\Exception\InvalidBookmarkException
63 */ 61 */
64 public function testArrayAccessAddBadEntryNoId() 62 public function testArrayAccessAddBadEntryNoId()
65 { 63 {
64 $this->expectException(\Shaarli\Bookmark\Exception\InvalidBookmarkException::class);
65
66 $array = new BookmarkArray(); 66 $array = new BookmarkArray();
67 $bookmark = new Bookmark(); 67 $bookmark = new Bookmark();
68 $array[] = $bookmark; 68 $array[] = $bookmark;
@@ -70,11 +70,11 @@ class BookmarkArrayTest extends TestCase
70 70
71 /** 71 /**
72 * Test adding a bad entry: no url 72 * Test adding a bad entry: no url
73 *
74 * @expectedException Shaarli\Bookmark\Exception\InvalidBookmarkException
75 */ 73 */
76 public function testArrayAccessAddBadEntryNoUrl() 74 public function testArrayAccessAddBadEntryNoUrl()
77 { 75 {
76 $this->expectException(\Shaarli\Bookmark\Exception\InvalidBookmarkException::class);
77
78 $array = new BookmarkArray(); 78 $array = new BookmarkArray();
79 $bookmark = (new Bookmark())->setId(11); 79 $bookmark = (new Bookmark())->setId(11);
80 $array[] = $bookmark; 80 $array[] = $bookmark;
@@ -82,11 +82,11 @@ class BookmarkArrayTest extends TestCase
82 82
83 /** 83 /**
84 * Test adding a bad entry: invalid offset 84 * Test adding a bad entry: invalid offset
85 *
86 * @expectedException Shaarli\Bookmark\Exception\InvalidBookmarkException
87 */ 85 */
88 public function testArrayAccessAddBadEntryOffset() 86 public function testArrayAccessAddBadEntryOffset()
89 { 87 {
88 $this->expectException(\Shaarli\Bookmark\Exception\InvalidBookmarkException::class);
89
90 $array = new BookmarkArray(); 90 $array = new BookmarkArray();
91 $bookmark = (new Bookmark())->setId(11); 91 $bookmark = (new Bookmark())->setId(11);
92 $bookmark->validate(); 92 $bookmark->validate();
@@ -95,11 +95,11 @@ class BookmarkArrayTest extends TestCase
95 95
96 /** 96 /**
97 * Test adding a bad entry: invalid ID type 97 * Test adding a bad entry: invalid ID type
98 *
99 * @expectedException Shaarli\Bookmark\Exception\InvalidBookmarkException
100 */ 98 */
101 public function testArrayAccessAddBadEntryIdType() 99 public function testArrayAccessAddBadEntryIdType()
102 { 100 {
101 $this->expectException(\Shaarli\Bookmark\Exception\InvalidBookmarkException::class);
102
103 $array = new BookmarkArray(); 103 $array = new BookmarkArray();
104 $bookmark = (new Bookmark())->setId('nope'); 104 $bookmark = (new Bookmark())->setId('nope');
105 $bookmark->validate(); 105 $bookmark->validate();
@@ -108,11 +108,11 @@ class BookmarkArrayTest extends TestCase
108 108
109 /** 109 /**
110 * Test adding a bad entry: ID/offset not consistent 110 * Test adding a bad entry: ID/offset not consistent
111 *
112 * @expectedException Shaarli\Bookmark\Exception\InvalidBookmarkException
113 */ 111 */
114 public function testArrayAccessAddBadEntryIdOffset() 112 public function testArrayAccessAddBadEntryIdOffset()
115 { 113 {
114 $this->expectException(\Shaarli\Bookmark\Exception\InvalidBookmarkException::class);
115
116 $array = new BookmarkArray(); 116 $array = new BookmarkArray();
117 $bookmark = (new Bookmark())->setId(11); 117 $bookmark = (new Bookmark())->setId(11);
118 $bookmark->validate(); 118 $bookmark->validate();