diff --git a/classes/PluginWonderful.php b/classes/PluginWonderful.php index 2a42d10..98a5c18 100644 --- a/classes/PluginWonderful.php +++ b/classes/PluginWonderful.php @@ -93,7 +93,7 @@ class PluginWonderful { if (!empty($result)) { echo $result; } } - function render_widget($options, $adboxid) { + function render_widget($adboxid) { if ($this->publisher_info !== false) { foreach ($this->publisher_info->adboxes as $adbox) { if (($adbox->adboxid == $adboxid) || ($adbox->template_tag_id == $adboxid)) { diff --git a/classes/PluginWonderfulWidget.php b/classes/PluginWonderfulWidget.php index 7918763..e7708cb 100644 --- a/classes/PluginWonderfulWidget.php +++ b/classes/PluginWonderfulWidget.php @@ -15,9 +15,9 @@ class PluginWonderfulWidget extends WP_Widget { } function widget($args, $instance) { - extract($args); - + global $plugin_wonderful; + $plugin_wonderful->render_widget($instance['adboxid']); } } diff --git a/test/PluginWonderfulTest.php b/test/PluginWonderfulTest.php index ed98bd2..e807699 100644 --- a/test/PluginWonderfulTest.php +++ b/test/PluginWonderfulTest.php @@ -179,6 +179,44 @@ class PluginWonderfulTest extends PHPUnit_Framework_TestCase { } } } + + function providerTestRenderWidget() { + return array( + array(false, null, null, null, ""), + array(true, null, null, null, ""), + array(true, "123", 0, null, "advanced"), + array(true, "123", 1, null, "standard"), + array(true, "abc", 1, null, "standard"), + array(true, "abc", 1, 1, "