public function DatabaseSanitizeCase::setUp in Database Sanitize 7
Same name and namespace in other branches
- 8 drush/tests/DatabaseSanitizeTest.php \Unish\DatabaseSanitizeCase::setUp()
Setup the environment.
File
- drush/
tests/ DatabaseSanitizeTest.php, line 56
Class
- DatabaseSanitizeCase
- PHPUnit Tests for Database Sanitize.
Namespace
UnishCode
public function setUp() {
// Install the standard install profile.
$sites = $this
->setUpDrupal(1, TRUE, UNISH_DRUPAL_MAJOR_VERSION);
$this->webRoot = $this
->webroot();
$this->siteOptions = [
'root' => $this->webRoot,
'uri' => key($sites),
'yes' => NULL,
];
// Symlink database_sanitize inside the site being tested, so that it is
// available as a drush command.
$target = dirname(__DIR__, 2);
\symlink($target, $this->webRoot . '/modules/database_sanitize');
$this
->drush('cache-clear', [
'drush',
], $this->siteOptions);
$this
->drush('pm-enable', [
'database_sanitize',
'node',
], $this->siteOptions);
// Get tables defined in the database.
$this
->drush('sqlq', [
'show tables;',
], $this->siteOptions);
$this->dbTables = $this
->getOutputAsList();
$this->fullySpecifiedYmlFile = $this->webRoot . '/database.sanitize.full.yml';
$this
->generateFullySpecifiedYmlFile();
$this->mergeYmlFile = $this->webRoot . '/modules/database_sanitize/drush/tests/assets/database.sanitize.merge.yml';
}