You are here

function CCKSelectOtherHTMLEntitiesTest::testHTMLEntities in CCK Select Other 7

Same name and namespace in other branches
  1. 7.2 tests/cck_select_other.test \CCKSelectOtherHTMLEntitiesTest::testHTMLEntities()

Assert HTML entities are not double-encoded.

File

tests/cck_select_other.test, line 247
test file for cck_select_other Testing file

Class

CCKSelectOtherHTMLEntitiesTest
Assert HTML entities are not double-encoded.

Code

function testHTMLEntities() {
  $this
    ->drupalLogin($this->web_user);
  $select_field = $this->test_field['field_name'] . '[und][0][select_other_list]';
  $text_field = $this->test_field['field_name'] . '[und][0][select_other_text_input]';
  $edit = array(
    $select_field => 'other',
    $text_field => '&',
  );
  $this
    ->drupalPost('node/' . $this->test_node->nid . '/edit', $edit, t('Save'));
  $this
    ->drupalGet('node/' . $this->test_node->nid . '/edit');
  $this
    ->assertNoFieldByName($text_field, '&', t('Correctly encoded HTML entity.'));
  $this
    ->drupalLogout();
}