diff --git a/classes/PluginWonderful.php b/classes/PluginWonderful.php index 9b23faf..68bc90a 100644 --- a/classes/PluginWonderful.php +++ b/classes/PluginWonderful.php @@ -1,5 +1,7 @@ render_widget(array(), $adboxid); + $w = new PluginWonderfulWidget(); + $w->widget(array(), array('adboxid' => $adboxid)); } ?> \ No newline at end of file diff --git a/test/PluginWonderfulTest.php b/test/PluginWonderfulTest.php index 8f56fc6..5659e01 100644 --- a/test/PluginWonderfulTest.php +++ b/test/PluginWonderfulTest.php @@ -158,6 +158,22 @@ class PluginWonderfulTest extends PHPUnit_Framework_TestCase { } } } + + function testTemplateTag() { + global $plugin_wonderful; + + $plugin_wonderful = $this->getMock('PluginWonderful'); + + $plugin_wonderful->publisher_info = (object)array( + 'adboxes' => array( + (object)array('adboxid' => '123', 'advancedcode' => "test", 'standardcode' => "not-test") + ) + ); + + ob_start(); + the_project_wonderful_ad('123'); + $this->assertEquals("test", ob_get_clean()); + } } -?> \ No newline at end of file +?>