| 1 |
<?php |
<?php |
| 2 |
// $Id: drupal_web_test_case.php,v 1.172 2009/11/20 05:14:13 webchick Exp $ |
// $Id: drupal_web_test_case.php,v 1.173 2009/11/21 00:43:42 webchick Exp $ |
| 3 |
|
|
| 4 |
/** |
/** |
| 5 |
* Base class for Drupal tests. |
* Base class for Drupal tests. |
| 539 |
$this->originalPrefix = $db_prefix; |
$this->originalPrefix = $db_prefix; |
| 540 |
$this->originalFileDirectory = file_directory_path(); |
$this->originalFileDirectory = file_directory_path(); |
| 541 |
|
|
| 542 |
|
// Reset all statics so that test is performed with a clean environment. |
| 543 |
|
drupal_static_reset(); |
| 544 |
|
|
| 545 |
// Generate temporary prefixed database to ensure that tests have a clean starting point. |
// Generate temporary prefixed database to ensure that tests have a clean starting point. |
| 546 |
$db_prefix = Database::getConnection()->prefixTables('{simpletest' . mt_rand(1000, 1000000) . '}'); |
$db_prefix = Database::getConnection()->prefixTables('{simpletest' . mt_rand(1000, 1000000) . '}'); |
| 547 |
$conf['file_public_path'] = $this->originalFileDirectory . '/' . $db_prefix; |
$conf['file_public_path'] = $this->originalFileDirectory . '/' . $db_prefix; |
| 1056 |
ini_set('log_errors', 1); |
ini_set('log_errors', 1); |
| 1057 |
ini_set('error_log', $directory . '/error.log'); |
ini_set('error_log', $directory . '/error.log'); |
| 1058 |
|
|
| 1059 |
|
// Reset all statics so that test is performed with a clean environment. |
| 1060 |
|
drupal_static_reset(); |
| 1061 |
|
|
| 1062 |
include_once DRUPAL_ROOT . '/includes/install.inc'; |
include_once DRUPAL_ROOT . '/includes/install.inc'; |
| 1063 |
drupal_install_system(); |
drupal_install_system(); |
| 1064 |
|
|