You are here

function FlagEntityFieldQueryTestCase::setUp in Flag 7.3

Implements setUp().

Overrides DrupalWebTestCase::setUp

File

tests/flag.test, line 1167
Tests for the Flag module.

Class

FlagEntityFieldQueryTestCase
Test use of EntityFieldQueries with flagging entities.

Code

function setUp() {
  parent::setUp('flag');
  $flag_data = array(
    'entity_type' => 'node',
    'name' => 'test_flag_1',
    'title' => 'Test Flag',
    'global' => 0,
    'types' => array(
      0 => 'article',
    ),
    'flag_short' => 'Flag this item',
    'flag_long' => '',
    'flag_message' => '',
    'unflag_short' => 'Unflag this item',
    'unflag_long' => '',
    'unflag_message' => '',
    'unflag_denied_text' => 'You may not unflag this item',
    // Use the normal link type as it involves no intermediary page loads.
    'link_type' => 'normal',
    'weight' => 0,
    'show_on_form' => 0,
    'access_author' => '',
    'show_contextual_link' => 0,
    'show_in_links' => array(
      'full' => 1,
      'teaser' => 1,
    ),
    'i18n' => 0,
    'api_version' => 3,
  );
  $this->flag1 = $this
    ->createFlag($flag_data);
  $flag_data['name'] = 'test_flag_2';
  $this->flag2 = $this
    ->createFlag($flag_data);
  $flag_data['name'] = 'test_flag_3';
  $this->flag3 = $this
    ->createFlag($flag_data);

  // Create test user who can flag and unflag.
  $this->flag_unflag_user = $this
    ->drupalCreateUser(array(
    'flag test_flag_1',
    'unflag test_flag_1',
    'flag test_flag_2',
    'unflag test_flag_2',
  ));
  $this
    ->drupalLogin($this->flag_unflag_user);
}