]> gitweb.fluxo.info Git - semanticscuttle.git/commitdiff
add (broken) tests for Services_Tag::normalize and Bookmark2Tag::attachTags with...
authorChristian Weiske <cweiske@cweiske.de>
Thu, 21 Mar 2013 05:39:11 +0000 (06:39 +0100)
committerChristian Weiske <cweiske@cweiske.de>
Thu, 21 Mar 2013 05:39:11 +0000 (06:39 +0100)
tests/Bookmark2TagTest.php
tests/TagTest.php

index f466a7d7b3984e17b7d0da29ecf2232baab10f26..b0eccd195c8fd6afdf269d881237e222e0b4ece1 100644 (file)
@@ -89,7 +89,15 @@ class Bookmark2TagTest extends TestBase
         );
     }
 
-
+    public function testAttachTagsWithSomeEmptyTags()
+    {
+        $bid = $this->addBookmark(null, null, 0, array());
+        $this->b2ts->attachTags($bid, array('foo', '', 'bar', 'baz'));
+        $this->assertEquals(
+            array('foo', 'bar', 'baz'),
+            $this->b2ts->getTagsForBookmark($bid)
+        );
+    }
 
     /**
      * Test getTagsForBookmark() when the bookmark has no tags
index 96f3f14d9c1f40ae119d56f6545eee29bbc359cd..bda5a29b06899f227b723b4924e897847fea5fe2 100644 (file)
@@ -87,5 +87,13 @@ class TagTest extends TestBase
 
     }
 
+    public function testNormalizeEmptyValues()
+    {
+        $tags = $this->ts->normalize(
+            array('foo', '', 'bar', 'baz')
+        );
+        $this->assertEquals(array('foo', 'bar', 'baz'), $tags);
+    }
+
 }
 ?>