aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/LinkDBTest.php
diff options
context:
space:
mode:
authorChris Kuethe <chris.kuethe@gmail.com>2016-05-19 12:43:44 -0700
committerArthurHoaro <arthur@hoa.ro>2016-08-02 10:22:18 +0200
commit32d51093e32e9293e840fbda61cfcfed2d3bd4b6 (patch)
tree24942c550a008e50501f3bfd850e64d691b6b901 /tests/LinkDBTest.php
parent4b35853d6869e65b473fec065361e9ea7dbcf94d (diff)
downloadShaarli-32d51093e32e9293e840fbda61cfcfed2d3bd4b6.tar.gz
Shaarli-32d51093e32e9293e840fbda61cfcfed2d3bd4b6.tar.zst
Shaarli-32d51093e32e9293e840fbda61cfcfed2d3bd4b6.zip
add unit test
Diffstat (limited to 'tests/LinkDBTest.php')
-rw-r--r--tests/LinkDBTest.php26
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/LinkDBTest.php b/tests/LinkDBTest.php
index 46956f20..e413928a 100644
--- a/tests/LinkDBTest.php
+++ b/tests/LinkDBTest.php
@@ -429,4 +429,30 @@ class LinkDBTest extends PHPUnit_Framework_TestCase
429 { 429 {
430 self::$publicLinkDB->filterHash(''); 430 self::$publicLinkDB->filterHash('');
431 } 431 }
432
433 /**
434 * test whitespace handling in tags.
435 * split on whitespace runs and don't allow empty tags.
436 */
437 public function testReadTagsWithWhitespace()
438 {
439 // test load contains "tags": " tag1 tag2 tag3 tag4 "
440 $ds = '<?php /* ';
441 $ds .= 'fY5BDoMwDAS/gvwB4hRKMY9BEaASNQKUuL1U/L22D721Odheez';
442 $ds .= 'baQEjvQtgSeIdX12I/onfyYAjU6e1GkOL2mAMvMPxAC8mWIydD';
443 $ds .= 'enHsU0jrXlj1heCZk5k7gpX5oLr+ErUdkGBeypTjwXHfdOUItD';
444 $ds .= 'XycbgXHb24KxFYafWVtYvVRoQiQhw5vixrJDdY/LyENP5PcJ4f */ ?>';
445 file_put_contents(self::$testDatastore, $ds);
446 self::$publicLinkDB = new LinkDB(self::$testDatastore, false, false);
447
448 $this->assertEquals(
449 array(
450 'tag1' => 1,
451 'tag2' => 1,
452 'tag3' => 1,
453 'tag4' => 1
454 ),
455 self::$publicLinkDB->allTags()
456 );
457 }
432} 458}