function PathautoFunctionalTestHelper::setUp in Pathauto 6
Same name and namespace in other branches
- 6.2 pathauto.test \PathautoFunctionalTestHelper::setUp()
- 7 pathauto.test \PathautoFunctionalTestHelper::setUp()
Generates a random database prefix, runs the install scripts on the prefixed database and enable the specified modules. After installation many caches are flushed and the internal browser is setup so that the page requests will run on the new prefix. A temporary files directory is created with the same name as the database prefix.
Parameters
...: List of modules to enable for the duration of the test. This can be either a single array or a variable number of string arguments.
Overrides PathautoTestHelper::setUp
2 calls to PathautoFunctionalTestHelper::setUp()
- PathautoLocaleTestCase::setUp in ./
pathauto.test - Generates a random database prefix, runs the install scripts on the prefixed database and enable the specified modules. After installation many caches are flushed and the internal browser is setup so that the page requests will run on the new prefix.…
- PathautoTaxonomyTokenTestCase::setUp in ./
pathauto.test - Generates a random database prefix, runs the install scripts on the prefixed database and enable the specified modules. After installation many caches are flushed and the internal browser is setup so that the page requests will run on the new prefix.…
2 methods override PathautoFunctionalTestHelper::setUp()
- PathautoLocaleTestCase::setUp in ./
pathauto.test - Generates a random database prefix, runs the install scripts on the prefixed database and enable the specified modules. After installation many caches are flushed and the internal browser is setup so that the page requests will run on the new prefix.…
- PathautoTaxonomyTokenTestCase::setUp in ./
pathauto.test - Generates a random database prefix, runs the install scripts on the prefixed database and enable the specified modules. After installation many caches are flushed and the internal browser is setup so that the page requests will run on the new prefix.…
File
- ./
pathauto.test, line 429 - Functionality tests for Pathauto.
Class
- PathautoFunctionalTestHelper
- Helper test class with some added functions for testing.
Code
function setUp(array $modules = array()) {
parent::setUp($modules);
// Set pathauto settings we assume to be as-is in this test.
variable_set('pathauto_node_page_pattern', 'content/[title-raw]');
// Allow other modules to add additional permissions for the admin user.
$permissions = array(
'administer pathauto',
'administer url aliases',
'create url aliases',
'administer nodes',
'administer users',
);
$args = func_get_args();
if (isset($args[1]) && is_array($args[1])) {
$permissions = array_merge($permissions, $args[1]);
}
$this->admin_user = $this
->drupalCreateUser($permissions);
$this
->drupalLogin($this->admin_user);
}