public function OgUiMigrate7000TestCase::setUp in Organic groups 7.2
Overrides DrupalWebTestCase::setUp() for upgrade testing.
Overrides UpgradePathTestCase::setUp
See also
DrupalWebTestCase::prepareDatabasePrefix()
DrupalWebTestCase::changeDatabasePrefix()
DrupalWebTestCase::prepareEnvironment()
File
- og_ui/
og_ui.test, line 462
Class
- OgUiMigrate7000TestCase
- Upgrade 7000 test.
Code
public function setUp() {
// Path to the database dump.
$this->databaseDumpFiles = array(
drupal_get_path('module', 'og_ui') . '/tests/drupal-6.og-ui.database.php',
);
parent::setUp();
$this
->assertTrue($this
->performUpgrade(), 'The upgrade was completed successfully.');
// spl_autoload_register() wasn't called, so we do it here, to allow
// classes to be auto-loaded.
spl_autoload_register('drupal_autoload_class');
spl_autoload_register('drupal_autoload_interface');
module_enable(array(
'og_ui',
'migrate',
));
foreach (migrate_migrations() as $migration) {
$machine_name = $migration
->getMachineName();
$result = $migration
->processImport();
$this
->assertEqual($result, Migration::RESULT_COMPLETED, format_string('Migration @name executed.', array(
'@name' => $machine_name,
)));
}
}