pull some things info coverage

This commit is contained in:
John Bintz 2010-01-31 17:42:30 -05:00
parent 88da16bd69
commit e3e5284d9c
2 changed files with 18 additions and 2 deletions

View File

@ -537,7 +537,6 @@ class ComicPressAdmin {
}
}
// @codeCoverageIgnoreStart
var $messages = array(
'info' => array(),
'warn' => array(),
@ -559,7 +558,6 @@ class ComicPressAdmin {
}
}
}
// @codeCoverageIgnoreEnd
function verify_nonces() {
if (isset($_REQUEST['cp']['_nonce'])) {

View File

@ -373,6 +373,24 @@ class ComicPressAdminTest extends PHPUnit_Framework_TestCase {
}
$admin->handle_update();
}
function testDisplayMessages() {
$this->admin->info('info');
$this->admin->warn('warn');
$this->admin->error('error');
ob_start();
$this->admin->display_messages();
$this->assertTrue(($xml = _to_xml(ob_get_clean())) !== false);
foreach (array(
'//div[contains(@class, "cp-info")]/p' => 'info',
'//div[contains(@class, "cp-warn")]/p' => 'warn',
'//div[contains(@class, "cp-error")]/p' => 'error',
) as $xpath => $value) {
$this->assertTrue(_xpath_test($xml, $xpath, $value), $xpath);
}
}
}
?>