From c3dfd8995921083ff7250c25d0b6ab1184b91aff Mon Sep 17 00:00:00 2001 From: ArthurHoaro Date: Mon, 28 Nov 2016 16:17:25 +0100 Subject: Unit Test for the new ID system --- tests/plugins/PluginIssoTest.php | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'tests/plugins/PluginIssoTest.php') diff --git a/tests/plugins/PluginIssoTest.php b/tests/plugins/PluginIssoTest.php index 1f545c7d..ea86a05c 100644 --- a/tests/plugins/PluginIssoTest.php +++ b/tests/plugins/PluginIssoTest.php @@ -47,12 +47,13 @@ class PluginIssoTest extends PHPUnit_Framework_TestCase $conf->set('plugins.ISSO_SERVER', 'value'); $str = 'http://randomstr.com/test'; + $date = '20161118_100001'; $data = array( 'title' => $str, 'links' => array( array( 'url' => $str, - 'linkdate' => 'abc', + 'created' => DateTime::createFromFormat('Ymd_His', $date), ) ) ); @@ -65,7 +66,7 @@ class PluginIssoTest extends PHPUnit_Framework_TestCase // plugin data $this->assertEquals(1, count($data['plugin_end_zone'])); - $this->assertNotFalse(strpos($data['plugin_end_zone'][0], 'abc')); + $this->assertNotFalse(strpos($data['plugin_end_zone'][0], $date)); $this->assertNotFalse(strpos($data['plugin_end_zone'][0], 'embed.min.js')); } @@ -78,16 +79,18 @@ class PluginIssoTest extends PHPUnit_Framework_TestCase $conf->set('plugins.ISSO_SERVER', 'value'); $str = 'http://randomstr.com/test'; + $date1 = '20161118_100001'; + $date2 = '20161118_100002'; $data = array( 'title' => $str, 'links' => array( array( 'url' => $str, - 'linkdate' => 'abc', + 'created' => DateTime::createFromFormat('Ymd_His', $date1), ), array( 'url' => $str . '2', - 'linkdate' => 'abc2', + 'created' => DateTime::createFromFormat('Ymd_His', $date2), ), ) ); @@ -106,12 +109,13 @@ class PluginIssoTest extends PHPUnit_Framework_TestCase $conf->set('plugins.ISSO_SERVER', 'value'); $str = 'http://randomstr.com/test'; + $date = '20161118_100001'; $data = array( 'title' => $str, 'links' => array( array( 'url' => $str, - 'linkdate' => 'abc', + 'created' => DateTime::createFromFormat('Ymd_His', $date), ) ), 'search_term' => $str -- cgit v1.2.3