3 require_once 'plugins/pubsubhubbub/pubsubhubbub.php';
4 require_once 'application/Router.php';
7 * Class PluginPubsubhubbubTest
8 * Unit test for the pubsubhubbub plugin
10 class PluginPubsubhubbubTest
extends PHPUnit_Framework_TestCase
13 * @var string Config file path (without extension).
15 protected static $configFile = 'tests/utils/config/configJson';
20 public function setUp()
22 PluginManager
::$PLUGINS_PATH = 'plugins';
26 * Test render_feed hook with an RSS feed.
28 public function testPubSubRssRenderFeed()
30 $hub = 'http://domain.hub';
31 $conf = new ConfigManager(self
::$configFile);
32 $conf->set('plugins.PUBSUBHUB_URL', $hub);
33 $data['_PAGE_'] = Router
::$PAGE_FEED_RSS;
35 $data = hook_pubsubhubbub_render_feed($data, $conf);
36 $expected = '<atom:link rel="hub" href="'. $hub .'" />';
37 $this->assertEquals($expected, $data['feed_plugins_header'][0]);
41 * Test render_feed hook with an ATOM feed.
43 public function testPubSubAtomRenderFeed()
45 $hub = 'http://domain.hub';
46 $conf = new ConfigManager(self
::$configFile);
47 $conf->set('plugins.PUBSUBHUB_URL', $hub);
48 $data['_PAGE_'] = Router
::$PAGE_FEED_ATOM;
50 $data = hook_pubsubhubbub_render_feed($data, $conf);
51 $expected = '<link rel="hub" href="'. $hub .'" />';
52 $this->assertEquals($expected, $data['feed_plugins_header'][0]);