From 2f865db5132c65311f277586459bcbf4c026a8e6 Mon Sep 17 00:00:00 2001 From: Ricardo Soares de Lima Date: Sun, 9 Dec 2012 16:08:02 -0200 Subject: The method attachTags was raising a Notice error, fix it and adds a test for this situation. --- tests/Bookmark2TagTest.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'tests') diff --git a/tests/Bookmark2TagTest.php b/tests/Bookmark2TagTest.php index b0eccd1..fdfc42e 100644 --- a/tests/Bookmark2TagTest.php +++ b/tests/Bookmark2TagTest.php @@ -88,6 +88,21 @@ class Bookmark2TagTest extends TestBase $this->b2ts->getTagsForBookmark($bid, true) ); } + + public function testAttachTagsWithEmptyStringAddsSystemUnfiled() + { + $originalDisplayErros = ini_get('display_errors'); + $originalErrorReporting = ini_get('error_reporting'); + ini_set('display_errors', 1); + error_reporting(E_ALL); + $bid = $this->addBookmark(null, null, 0, ''); + $this->assertEquals( + array('system:unfiled'), + $this->b2ts->getTagsForBookmark($bid, true) + ); + ini_set('display_errors', $originalDisplayErros); + error_reporting($originalErrorReporting); + } public function testAttachTagsWithSomeEmptyTags() { -- cgit v1.2.3