]> git.immae.eu Git - github/shaarli/Shaarli.git/blobdiff - tests/bookmark/BookmarkTest.php
Add strict types for bookmarks management
[github/shaarli/Shaarli.git] / tests / bookmark / BookmarkTest.php
index afec24403e75bb0c34255e9dff54db987ecdc3e4..4c7ae4c07fb91f56ab4e9718e775425cd3b6872e 100644 (file)
@@ -153,25 +153,6 @@ class BookmarkTest extends TestCase
         $this->assertContainsPolyfill('- ID: '. PHP_EOL, $exception->getMessage());
     }
 
-    /**
-     * Test validate() with a a bookmark with a non integer ID.
-     */
-    public function testValidateNotValidStringId()
-    {
-        $bookmark = new Bookmark();
-        $bookmark->setId('str');
-        $bookmark->setShortUrl('abc');
-        $bookmark->setCreated(\DateTime::createFromFormat('Ymd_His', '20190514_200102'));
-        $exception = null;
-        try {
-            $bookmark->validate();
-        } catch (InvalidBookmarkException $e) {
-            $exception = $e;
-        }
-        $this->assertNotNull($exception);
-        $this->assertContainsPolyfill('- ID: str'. PHP_EOL, $exception->getMessage());
-    }
-
     /**
      * Test validate() with a a bookmark without short url.
      */
@@ -210,25 +191,6 @@ class BookmarkTest extends TestCase
         $this->assertContainsPolyfill('- Created: '. PHP_EOL, $exception->getMessage());
     }
 
-    /**
-     * Test validate() with a a bookmark with a bad created datetime.
-     */
-    public function testValidateNotValidBadCreated()
-    {
-        $bookmark = new Bookmark();
-        $bookmark->setId(1);
-        $bookmark->setShortUrl('abc');
-        $bookmark->setCreated('hi!');
-        $exception = null;
-        try {
-            $bookmark->validate();
-        } catch (InvalidBookmarkException $e) {
-            $exception = $e;
-        }
-        $this->assertNotNull($exception);
-        $this->assertContainsPolyfill('- Created: Not a DateTime object'. PHP_EOL, $exception->getMessage());
-    }
-
     /**
      * Test setId() and make sure that default fields are generated.
      */