From 7ba3740e255a2a7a73ab394bf5aa4d2f03f7197a Mon Sep 17 00:00:00 2001 From: John Bintz Date: Fri, 26 Jun 2009 07:09:54 -0400 Subject: [PATCH] template tag fixes --- classes/PluginWonderful.php | 7 ++++--- test/PluginWonderfulTest.php | 18 +++++++++++++++++- 2 files changed, 21 insertions(+), 4 deletions(-) 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 +?>