function FieldPlaceholderTestCase::setUp in Field placeholder 7
Same name and namespace in other branches
- 7.2 field_placeholder.test \FieldPlaceholderTestCase::setUp()
Prepares the testing environment.
Overrides DrupalWebTestCase::setUp
File
- ./
field_placeholder.test, line 27 - File that holds functional tests for Field placeholder module.
Class
- FieldPlaceholderTestCase
- @file File that holds functional tests for Field placeholder module.
Code
function setUp() {
// Enable minimum required modules.
parent::setUp('field_placeholder');
// Create user.
$this->privileged_user = $this
->drupalCreateUser(array(
'bypass node access',
'administer content types',
));
$this
->drupalLogin($this->privileged_user);
// Create content type, with underscores.
$type_name = strtolower($this
->randomName(8)) . '_test';
$type = $this
->drupalCreateContentType(array(
'name' => $type_name,
'type' => $type_name,
));
$this->type = $type->type;
// Store a valid URL name, with hyphens instead of underscores.
$this->hyphen_type = str_replace('_', '-', $this->type);
}