You are here

function autocompleteWidgetsBaseTest::basicTest in Autocomplete Widgets for Text and Number Fields 7

Preforms the most basic tests that suggestions are returned.

4 calls to autocompleteWidgetsBaseTest::basicTest()
autocompleteWidgetsAllowedValuesTest::testAllowedValues in tests/autocomplete_widgets.test
autocompleteWidgetsFieldDataTest::testFieldData in tests/autocomplete_widgets.test
autocompleteWidgetsNodeReferenceTest::testNodeTitles in tests/autocomplete_widgets.test
autocompleteWidgetsSuggestedValuesTest::testSuggestedValues in tests/autocomplete_widgets.test

File

tests/autocomplete_widgets.test, line 56

Class

autocompleteWidgetsBaseTest

Code

function basicTest($instance) {
  $instance['widget']['settings'] = $this->settings;
  field_update_instance($instance);
  $this
    ->drupalGet($this->path . 'f');
  $this
    ->assertRaw('"foobar"', 'A suggestion was returned containing the search string.');
  $this
    ->assertRaw('"fooBar"', 'A suggestion was returned containing the search string.');
  $this
    ->assertRaw('"FooBar"', 'A suggestion was returned containing the search string.');
  $this
    ->assertRaw(drupal_json_encode('foo<em>baz</em>'), 'A suggestion was returned containing the search string.');
  $this
    ->assertRaw('"bazfoo"', 'A suggestion was returned containing the search string.');
  $this
    ->assertNoRaw('"baz"', 'Non-matching value was not returned.');
}