From 9a364c283e3e9b5ccb5fc7a9a8e2946b1918c6a5 Mon Sep 17 00:00:00 2001 From: ArthurHoaro Date: Sat, 7 Nov 2015 16:37:23 +0100 Subject: Add unit test for archiveorg plugin + coding style --- tests/plugins/PluginArchiveorgTest.php | 48 ++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 tests/plugins/PluginArchiveorgTest.php (limited to 'tests') diff --git a/tests/plugins/PluginArchiveorgTest.php b/tests/plugins/PluginArchiveorgTest.php new file mode 100644 index 00000000..dbc52bc8 --- /dev/null +++ b/tests/plugins/PluginArchiveorgTest.php @@ -0,0 +1,48 @@ + $str, + 'links' => array( + array( + 'url' => $str, + ) + ) + ); + + $data = hook_archiveorg_render_linklist($data); + $link = $data['links'][0]; + // data shouldn't be altered + $this->assertEquals($str, $data['title']); + $this->assertEquals($str, $link['url']); + + // plugin data + $this->assertEquals(1, count($link['link_plugin'])); + $this->assertNotFalse(strpos($link['link_plugin'][0], $str)); + } +} -- cgit v1.2.3