]> git.immae.eu Git - github/shaarli/Shaarli.git/blobdiff - tests/plugins/PluginIssoTest.php
Unit Test for the new ID system
[github/shaarli/Shaarli.git] / tests / plugins / PluginIssoTest.php
index 1f545c7d6e4e01c69c3407471839f4334dad8237..ea86a05c257318f2f31720084e3b295278a8fa8f 100644 (file)
@@ -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