diff options
Diffstat (limited to 'tests/plugins')
-rw-r--r-- | tests/plugins/PluginIssoTest.php | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/tests/plugins/PluginIssoTest.php b/tests/plugins/PluginIssoTest.php index 1f545c7d..6b7904dd 100644 --- a/tests/plugins/PluginIssoTest.php +++ b/tests/plugins/PluginIssoTest.php | |||
@@ -47,12 +47,14 @@ 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( |
55 | 'id' => 12, | ||
54 | 'url' => $str, | 56 | 'url' => $str, |
55 | 'linkdate' => 'abc', | 57 | 'created' => DateTime::createFromFormat(LinkDB::LINK_DATE_FORMAT, $date), |
56 | ) | 58 | ) |
57 | ) | 59 | ) |
58 | ); | 60 | ); |
@@ -65,7 +67,14 @@ class PluginIssoTest extends PHPUnit_Framework_TestCase | |||
65 | 67 | ||
66 | // plugin data | 68 | // plugin data |
67 | $this->assertEquals(1, count($data['plugin_end_zone'])); | 69 | $this->assertEquals(1, count($data['plugin_end_zone'])); |
68 | $this->assertNotFalse(strpos($data['plugin_end_zone'][0], 'abc')); | 70 | $this->assertNotFalse(strpos( |
71 | $data['plugin_end_zone'][0], | ||
72 | 'data-isso-id="'. $data['links'][0]['id'] .'"' | ||
73 | )); | ||
74 | $this->assertNotFalse(strpos( | ||
75 | $data['plugin_end_zone'][0], | ||
76 | 'data-title="'. $data['links'][0]['id'] .'"' | ||
77 | )); | ||
69 | $this->assertNotFalse(strpos($data['plugin_end_zone'][0], 'embed.min.js')); | 78 | $this->assertNotFalse(strpos($data['plugin_end_zone'][0], 'embed.min.js')); |
70 | } | 79 | } |
71 | 80 | ||
@@ -78,16 +87,20 @@ class PluginIssoTest extends PHPUnit_Framework_TestCase | |||
78 | $conf->set('plugins.ISSO_SERVER', 'value'); | 87 | $conf->set('plugins.ISSO_SERVER', 'value'); |
79 | 88 | ||
80 | $str = 'http://randomstr.com/test'; | 89 | $str = 'http://randomstr.com/test'; |
90 | $date1 = '20161118_100001'; | ||
91 | $date2 = '20161118_100002'; | ||
81 | $data = array( | 92 | $data = array( |
82 | 'title' => $str, | 93 | 'title' => $str, |
83 | 'links' => array( | 94 | 'links' => array( |
84 | array( | 95 | array( |
96 | 'id' => 12, | ||
85 | 'url' => $str, | 97 | 'url' => $str, |
86 | 'linkdate' => 'abc', | 98 | 'created' => DateTime::createFromFormat(LinkDB::LINK_DATE_FORMAT, $date1), |
87 | ), | 99 | ), |
88 | array( | 100 | array( |
101 | 'id' => 13, | ||
89 | 'url' => $str . '2', | 102 | 'url' => $str . '2', |
90 | 'linkdate' => 'abc2', | 103 | 'created' => DateTime::createFromFormat(LinkDB::LINK_DATE_FORMAT, $date2), |
91 | ), | 104 | ), |
92 | ) | 105 | ) |
93 | ); | 106 | ); |
@@ -106,12 +119,14 @@ class PluginIssoTest extends PHPUnit_Framework_TestCase | |||
106 | $conf->set('plugins.ISSO_SERVER', 'value'); | 119 | $conf->set('plugins.ISSO_SERVER', 'value'); |
107 | 120 | ||
108 | $str = 'http://randomstr.com/test'; | 121 | $str = 'http://randomstr.com/test'; |
122 | $date = '20161118_100001'; | ||
109 | $data = array( | 123 | $data = array( |
110 | 'title' => $str, | 124 | 'title' => $str, |
111 | 'links' => array( | 125 | 'links' => array( |
112 | array( | 126 | array( |
127 | 'id' => 12, | ||
113 | 'url' => $str, | 128 | 'url' => $str, |
114 | 'linkdate' => 'abc', | 129 | 'created' => DateTime::createFromFormat(LinkDB::LINK_DATE_FORMAT, $date), |
115 | ) | 130 | ) |
116 | ), | 131 | ), |
117 | 'search_term' => $str | 132 | 'search_term' => $str |