allow for default ad to be selected on widget
This commit is contained in:
parent
99ab15273a
commit
fbf3a7824c
@ -365,6 +365,7 @@ class PluginWonderful {
|
|||||||
echo '<p>';
|
echo '<p>';
|
||||||
echo 'Select an adbox:<br />';
|
echo 'Select an adbox:<br />';
|
||||||
foreach ($this->publisher_info->adboxes as $box) {
|
foreach ($this->publisher_info->adboxes as $box) {
|
||||||
|
if (empty($instance['adboxid'])) { $instance['adboxid'] = $box->adboxid; }
|
||||||
echo '<label>';
|
echo '<label>';
|
||||||
echo '<input type="radio" name="'
|
echo '<input type="radio" name="'
|
||||||
. $field_names['adboxid']
|
. $field_names['adboxid']
|
||||||
|
@ -467,21 +467,23 @@ class PluginWonderfulTest extends PHPUnit_Framework_TestCase {
|
|||||||
(object)array('adboxid' => '234'),
|
(object)array('adboxid' => '234'),
|
||||||
(object)array('adboxid' => '345'),
|
(object)array('adboxid' => '345'),
|
||||||
);
|
);
|
||||||
|
|
||||||
ob_start();
|
foreach (array('', '123') as $sample_adbox_id) {
|
||||||
$this->pw->_render_adbox_admin(array('adboxid' => '123', 'center' => 1), array('adboxid' => 'adname', 'center' => 'centername'));
|
ob_start();
|
||||||
$source = ob_get_clean();
|
$this->pw->_render_adbox_admin(array('adboxid' => $sample_adbox_id, 'center' => 1), array('adboxid' => 'adname', 'center' => 'centername'));
|
||||||
|
$source = ob_get_clean();
|
||||||
$this->assertTrue(($xml = _to_xml($source)) !== false);
|
|
||||||
|
$this->assertTrue(($xml = _to_xml($source)) !== false);
|
||||||
foreach (array(
|
|
||||||
'//input[@type="radio" and @name="adname" and @value="123" and @checked="checked"]' => true,
|
foreach (array(
|
||||||
'//input[@type="radio" and @name="adname" and @value="234" and not(@checked="checked")]' => true,
|
'//input[@type="radio" and @name="adname" and @value="123" and @checked="checked"]' => true,
|
||||||
'//input[@type="radio" and @name="adname" and @value="345" and not(@checked="checked")]' => true,
|
'//input[@type="radio" and @name="adname" and @value="234" and not(@checked="checked")]' => true,
|
||||||
'//input[@type="checkbox" and @name="centername" and @value="1" and @checked="checked"]' => true
|
'//input[@type="radio" and @name="adname" and @value="345" and not(@checked="checked")]' => true,
|
||||||
) as $xpath => $value) {
|
'//input[@type="checkbox" and @name="centername" and @value="1" and @checked="checked"]' => true
|
||||||
$this->assertTrue(_xpath_test($xml, $xpath, $value), $xpath);
|
) as $xpath => $value) {
|
||||||
}
|
$this->assertTrue(_xpath_test($xml, $xpath, $value), $xpath);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function providerTestRenderPre28Widget() {
|
function providerTestRenderPre28Widget() {
|
||||||
|
Loading…
Reference in New Issue
Block a user