function FlagFlaggingCRUDTestCase::setUp in Flag 7.3
Implements setUp().
Overrides DrupalWebTestCase::setUp
File
- tests/
flag.test, line 55 - Tests for the Flag module.
Class
- FlagFlaggingCRUDTestCase
- Test CRUD operations on Flagging entities.
Code
function setUp() {
parent::setUp('flag');
$flag_data = array(
'entity_type' => 'node',
'name' => 'test_flag',
'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',
'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->flag = $this
->createFlag($flag_data);
// Create test user who can flag and unflag.
$this->flag_unflag_user = $this
->drupalCreateUser(array(
'flag test_flag',
'unflag test_flag',
));
$this
->drupalLogin($this->flag_unflag_user);
}