From d592daea8343bb4dfecff5d97e93699581ccc58c Mon Sep 17 00:00:00 2001 From: ArthurHoaro Date: Mon, 28 Nov 2016 18:24:15 +0100 Subject: Add a persistent 'shorturl' key to all links All existing link will keep their permalinks. New links will have smallhash generated with date+id. The purpose of this is to avoid collision between links due to their creation date. --- tests/plugins/PluginIssoTest.php | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) (limited to 'tests/plugins') diff --git a/tests/plugins/PluginIssoTest.php b/tests/plugins/PluginIssoTest.php index ea86a05c..6b7904dd 100644 --- a/tests/plugins/PluginIssoTest.php +++ b/tests/plugins/PluginIssoTest.php @@ -52,8 +52,9 @@ class PluginIssoTest extends PHPUnit_Framework_TestCase 'title' => $str, 'links' => array( array( + 'id' => 12, 'url' => $str, - 'created' => DateTime::createFromFormat('Ymd_His', $date), + 'created' => DateTime::createFromFormat(LinkDB::LINK_DATE_FORMAT, $date), ) ) ); @@ -66,7 +67,14 @@ class PluginIssoTest extends PHPUnit_Framework_TestCase // plugin data $this->assertEquals(1, count($data['plugin_end_zone'])); - $this->assertNotFalse(strpos($data['plugin_end_zone'][0], $date)); + $this->assertNotFalse(strpos( + $data['plugin_end_zone'][0], + 'data-isso-id="'. $data['links'][0]['id'] .'"' + )); + $this->assertNotFalse(strpos( + $data['plugin_end_zone'][0], + 'data-title="'. $data['links'][0]['id'] .'"' + )); $this->assertNotFalse(strpos($data['plugin_end_zone'][0], 'embed.min.js')); } @@ -85,12 +93,14 @@ class PluginIssoTest extends PHPUnit_Framework_TestCase 'title' => $str, 'links' => array( array( + 'id' => 12, 'url' => $str, - 'created' => DateTime::createFromFormat('Ymd_His', $date1), + 'created' => DateTime::createFromFormat(LinkDB::LINK_DATE_FORMAT, $date1), ), array( + 'id' => 13, 'url' => $str . '2', - 'created' => DateTime::createFromFormat('Ymd_His', $date2), + 'created' => DateTime::createFromFormat(LinkDB::LINK_DATE_FORMAT, $date2), ), ) ); @@ -114,8 +124,9 @@ class PluginIssoTest extends PHPUnit_Framework_TestCase 'title' => $str, 'links' => array( array( + 'id' => 12, 'url' => $str, - 'created' => DateTime::createFromFormat('Ymd_His', $date), + 'created' => DateTime::createFromFormat(LinkDB::LINK_DATE_FORMAT, $date), ) ), 'search_term' => $str -- cgit v1.2.3