diff options
author | ArthurHoaro <arthur@hoa.ro> | 2016-11-28 16:17:25 +0100 |
---|---|---|
committer | ArthurHoaro <arthur@hoa.ro> | 2016-12-12 03:03:12 +0100 |
commit | c3dfd8995921083ff7250c25d0b6ab1184b91aff (patch) | |
tree | cb7cb17ad607a5bd2e7d9ee59c0e804e590fa6af /tests/plugins/PluginIssoTest.php | |
parent | 01878a75b93b9966f7366ea2937c118bbc3e459e (diff) | |
download | Shaarli-c3dfd8995921083ff7250c25d0b6ab1184b91aff.tar.gz Shaarli-c3dfd8995921083ff7250c25d0b6ab1184b91aff.tar.zst Shaarli-c3dfd8995921083ff7250c25d0b6ab1184b91aff.zip |
Unit Test for the new ID system
Diffstat (limited to 'tests/plugins/PluginIssoTest.php')
-rw-r--r-- | tests/plugins/PluginIssoTest.php | 14 |
1 files changed, 9 insertions, 5 deletions
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 | |||
47 | $conf->set('plugins.ISSO_SERVER', 'value'); | 47 | $conf->set('plugins.ISSO_SERVER', 'value'); |
48 | 48 | ||
49 | $str = 'http://randomstr.com/test'; | 49 | $str = 'http://randomstr.com/test'; |
50 | $date = '20161118_100001'; | ||
50 | $data = array( | 51 | $data = array( |
51 | 'title' => $str, | 52 | 'title' => $str, |
52 | 'links' => array( | 53 | 'links' => array( |
53 | array( | 54 | array( |
54 | 'url' => $str, | 55 | 'url' => $str, |
55 | 'linkdate' => 'abc', | 56 | 'created' => DateTime::createFromFormat('Ymd_His', $date), |
56 | ) | 57 | ) |
57 | ) | 58 | ) |
58 | ); | 59 | ); |
@@ -65,7 +66,7 @@ class PluginIssoTest extends PHPUnit_Framework_TestCase | |||
65 | 66 | ||
66 | // plugin data | 67 | // plugin data |
67 | $this->assertEquals(1, count($data['plugin_end_zone'])); | 68 | $this->assertEquals(1, count($data['plugin_end_zone'])); |
68 | $this->assertNotFalse(strpos($data['plugin_end_zone'][0], 'abc')); | 69 | $this->assertNotFalse(strpos($data['plugin_end_zone'][0], $date)); |
69 | $this->assertNotFalse(strpos($data['plugin_end_zone'][0], 'embed.min.js')); | 70 | $this->assertNotFalse(strpos($data['plugin_end_zone'][0], 'embed.min.js')); |
70 | } | 71 | } |
71 | 72 | ||
@@ -78,16 +79,18 @@ class PluginIssoTest extends PHPUnit_Framework_TestCase | |||
78 | $conf->set('plugins.ISSO_SERVER', 'value'); | 79 | $conf->set('plugins.ISSO_SERVER', 'value'); |
79 | 80 | ||
80 | $str = 'http://randomstr.com/test'; | 81 | $str = 'http://randomstr.com/test'; |
82 | $date1 = '20161118_100001'; | ||
83 | $date2 = '20161118_100002'; | ||
81 | $data = array( | 84 | $data = array( |
82 | 'title' => $str, | 85 | 'title' => $str, |
83 | 'links' => array( | 86 | 'links' => array( |
84 | array( | 87 | array( |
85 | 'url' => $str, | 88 | 'url' => $str, |
86 | 'linkdate' => 'abc', | 89 | 'created' => DateTime::createFromFormat('Ymd_His', $date1), |
87 | ), | 90 | ), |
88 | array( | 91 | array( |
89 | 'url' => $str . '2', | 92 | 'url' => $str . '2', |
90 | 'linkdate' => 'abc2', | 93 | 'created' => DateTime::createFromFormat('Ymd_His', $date2), |
91 | ), | 94 | ), |
92 | ) | 95 | ) |
93 | ); | 96 | ); |
@@ -106,12 +109,13 @@ class PluginIssoTest extends PHPUnit_Framework_TestCase | |||
106 | $conf->set('plugins.ISSO_SERVER', 'value'); | 109 | $conf->set('plugins.ISSO_SERVER', 'value'); |
107 | 110 | ||
108 | $str = 'http://randomstr.com/test'; | 111 | $str = 'http://randomstr.com/test'; |
112 | $date = '20161118_100001'; | ||
109 | $data = array( | 113 | $data = array( |
110 | 'title' => $str, | 114 | 'title' => $str, |
111 | 'links' => array( | 115 | 'links' => array( |
112 | array( | 116 | array( |
113 | 'url' => $str, | 117 | 'url' => $str, |
114 | 'linkdate' => 'abc', | 118 | 'created' => DateTime::createFromFormat('Ymd_His', $date), |
115 | ) | 119 | ) |
116 | ), | 120 | ), |
117 | 'search_term' => $str | 121 | 'search_term' => $str |