You are here

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

Tests the functionality of the "starts with" option.

4 calls to autocompleteWidgetsBaseTest::startsWithTest()
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 72

Class

autocompleteWidgetsBaseTest

Code

function startsWithTest($instance) {
  $settings = $this->settings;
  $settings['autocomplete_match'] = 'starts_with';
  $instance['widget']['settings'] = $settings;
  field_update_instance($instance);
  $this
    ->drupalGet($this->path . 'foo');
  $this
    ->assertRaw('"foobar"', 'A suggestion was returned starting with the search string.');
  $this
    ->assertNoRaw('"bazfoo"', 'A suggestion containing but not starting with the search string was not returned.');
}