You are here

function FormatFormViewModesTest::assertOption in D7 Media 7.3

Same name and namespace in other branches
  1. 7.4 modules/media_wysiwyg/media_wysiwyg.test \FormatFormViewModesTest::assertOption()
  2. 7.2 modules/media_wysiwyg/media_wysiwyg.test \FormatFormViewModesTest::assertOption()

Assert that a select option in the current page exists.

Parameters

$id: id of select field to assert.

$option: Option to assert.

1 call to FormatFormViewModesTest::assertOption()
FormatFormViewModesTest::testAllowedFormatFormViewModes in modules/media_wysiwyg/media_wysiwyg.test
Configure format form view mode restrictions and ensure that they are followed.

File

modules/media_wysiwyg/media_wysiwyg.test, line 172
Tests for media.module.

Class

FormatFormViewModesTest
Test configuring view modes available on the format form.

Code

function assertOption($id, $option, $message = '', $group = 'Browser') {
  $options = $this
    ->xpath('//select[@id=:id]/option[@value=:option]', array(
    ':id' => $id,
    ':option' => $option,
  ));
  return $this
    ->assertTrue(isset($options[0]), $message ? $message : t('Option @option for field @id exists.', array(
    '@option' => $option,
    '@id' => $id,
  )));
}