template tag fixes
This commit is contained in:
parent
d138048eef
commit
7ba3740e25
@ -1,5 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
require_once('PluginWonderfulWidget.php');
|
||||||
|
|
||||||
class PluginWonderful {
|
class PluginWonderful {
|
||||||
var $messages, $adboxes_client, $publisher_info, $member_id;
|
var $messages, $adboxes_client, $publisher_info, $member_id;
|
||||||
var $widget_prefix = "plugin-wonderful";
|
var $widget_prefix = "plugin-wonderful";
|
||||||
@ -294,9 +296,8 @@ class PluginWonderful {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function the_project_wonderful_ad($adboxid) {
|
function the_project_wonderful_ad($adboxid) {
|
||||||
global $plugin_wonderful;
|
$w = new PluginWonderfulWidget();
|
||||||
|
$w->widget(array(), array('adboxid' => $adboxid));
|
||||||
$plugin_wonderful->render_widget(array(), $adboxid);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
@ -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());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
Loading…
Reference in New Issue
Block a user