You are here

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

Implementation of setUp().

Overrides DrupalWebTestCase::setUp

4 calls to autocompleteWidgetsBaseTest::setUp()
autocompleteWidgetsAllowedValuesTest::setUp in tests/autocomplete_widgets.test
Implementation of setUp().
autocompleteWidgetsFieldDataTest::setUp in tests/autocomplete_widgets.test
Implementation of setUp().
autocompleteWidgetsNodeReferenceTest::setUp in tests/autocomplete_widgets.test
Implementation of setUp().
autocompleteWidgetsSuggestedValuesTest::setUp in tests/autocomplete_widgets.test
Implementation of setUp().
4 methods override autocompleteWidgetsBaseTest::setUp()
autocompleteWidgetsAllowedValuesTest::setUp in tests/autocomplete_widgets.test
Implementation of setUp().
autocompleteWidgetsFieldDataTest::setUp in tests/autocomplete_widgets.test
Implementation of setUp().
autocompleteWidgetsNodeReferenceTest::setUp in tests/autocomplete_widgets.test
Implementation of setUp().
autocompleteWidgetsSuggestedValuesTest::setUp in tests/autocomplete_widgets.test
Implementation of setUp().

File

tests/autocomplete_widgets.test, line 7

Class

autocompleteWidgetsBaseTest

Code

function setUp() {

  // Enable a couple modules.
  parent::setUp('autocomplete_widgets');
  menu_rebuild();

  // Create an array of test values.
  $this->test_values = array(
    'fooBar',
    'FooBar',
    'foobar',
    'foo<em>baz</em>',
    'bazfoo',
    'baz',
  );

  // Create an admin user with all the permissions needed to run tests.
  $this->admin_user = $this
    ->drupalCreateUser(array(
    'access administration pages',
    'bypass node access',
    'administer nodes',
  ));
  $this
    ->drupalLogin($this->admin_user);

  // Set default instance settings for quick reference.
  $this->settings = array(
    'autocomplete_match' => 'contains',
    'autocomplete_case' => '0',
    'autocomplete_xss' => '0',
    'suggested_values' => implode("\n", $this->test_values),
    'order' => '',
    'allowed_node_types' => array(
      'article',
    ),
  );
}