protected function SkinrPanelsTestCase::assertOptionExists in Skinr 8.2
Same name and namespace in other branches
- 7.2 skinr_panels/tests/skinr_panels.test \SkinrPanelsTestCase::assertOptionExists()
Asserts that a select option in the current page exists.
Parameters
$name: Id of select field to assert.
$option: Option to assert.
$message: Message to display.
Return value
TRUE on pass, FALSE on fail.
2 calls to SkinrPanelsTestCase::assertOptionExists()
- SkinrPanelsTestCase::testPanelsDatabase in skinr_panels/
tests/ skinr_panels.test - Tests panels plugin.
- SkinrPanelsTestCase::testPanelsDefault in skinr_panels/
tests/ skinr_panels.test - Tests panels plugin.
File
- skinr_panels/
tests/ skinr_panels.test, line 54 - Tests for the Skinr Panels module.
Class
- SkinrPanelsTestCase
- Tests UI functionality for Panels plugin.
Code
protected function assertOptionExists($name, $option, $message = '') {
$elements = $this
->xpath('//select[@name=:name]//option[@value=:option]', array(
':name' => $name,
':option' => $option,
));
return $this
->assertTrue(isset($elements[0]), $message ? $message : t('Option @option for field @name exists.', array(
'@option' => $option,
'@name' => $name,
)), t('Browser'));
}