You are here

protected function SkinrUIPluginViewsTestCase::assertOptionExists in Skinr 7.2

Same name and namespace in other branches
  1. 8.2 skinr_ui/src/Tests/skinr_ui.test \SkinrUIPluginViewsTestCase::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.

1 call to SkinrUIPluginViewsTestCase::assertOptionExists()
SkinrUIPluginViewsTestCase::testViews in tests/skinr_ui.test
Tests views plugin.

File

tests/skinr_ui.test, line 735
Tests for the Skinr UI module.

Class

SkinrUIPluginViewsTestCase
Tests UI functionality for Block 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'));
}