template tag fixes

This commit is contained in:
John Bintz 2009-06-26 07:09:54 -04:00
parent d138048eef
commit 7ba3740e25
2 changed files with 21 additions and 4 deletions

View File

@ -1,5 +1,7 @@
<?php
require_once('PluginWonderfulWidget.php');
class PluginWonderful {
var $messages, $adboxes_client, $publisher_info, $member_id;
var $widget_prefix = "plugin-wonderful";
@ -294,9 +296,8 @@ class PluginWonderful {
}
function the_project_wonderful_ad($adboxid) {
global $plugin_wonderful;
$plugin_wonderful->render_widget(array(), $adboxid);
$w = new PluginWonderfulWidget();
$w->widget(array(), array('adboxid' => $adboxid));
}
?>

View File

@ -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());
}
}
?>