Merge branch 'master' of git@github.com:johnbintz/plugin-wonderful

This commit is contained in:
John Bintz 2009-07-01 22:02:30 -04:00
commit 2e404d54cc

View File

@ -468,19 +468,21 @@ class PluginWonderfulTest extends PHPUnit_Framework_TestCase {
(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( foreach (array(
'//input[@type="radio" and @name="adname" and @value="123" and @checked="checked"]' => true, '//input[@type="radio" and @name="adname" and @value="123" and @checked="checked"]' => true,
'//input[@type="radio" and @name="adname" and @value="234" and not(@checked="checked")]' => true, '//input[@type="radio" and @name="adname" and @value="234" and not(@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="345" and not(@checked="checked")]' => true,
'//input[@type="checkbox" and @name="centername" and @value="1" and @checked="checked"]' => true '//input[@type="checkbox" and @name="centername" and @value="1" and @checked="checked"]' => true
) as $xpath => $value) { ) as $xpath => $value) {
$this->assertTrue(_xpath_test($xml, $xpath, $value), $xpath); $this->assertTrue(_xpath_test($xml, $xpath, $value), $xpath);
}
} }
} }