non security modules update
This commit is contained in:
@@ -21,7 +21,7 @@ class MigrateImportOptionsTest extends DrupalWebTestCase {
|
||||
parent::setUp('migrate_example');
|
||||
|
||||
// Make sure the migrations are registered.
|
||||
migrate_get_module_apis();
|
||||
migrate_static_registration();
|
||||
}
|
||||
|
||||
function testItemLimitOption() {
|
||||
|
@@ -21,7 +21,7 @@ class MigrateCommentUnitTest extends DrupalWebTestCase {
|
||||
parent::setUp('taxonomy', 'image', 'comment', 'migrate', 'migrate_example');
|
||||
|
||||
// Make sure the migrations are registered.
|
||||
migrate_get_module_apis();
|
||||
migrate_static_registration();
|
||||
}
|
||||
|
||||
function testCommentImport() {
|
||||
|
@@ -21,7 +21,7 @@ class MigrateNodeUnitTest extends DrupalWebTestCase {
|
||||
parent::setUp('list', 'number', 'taxonomy', 'image', 'migrate', 'migrate_example');
|
||||
|
||||
// Make sure the migrations are registered.
|
||||
migrate_get_module_apis();
|
||||
migrate_static_registration();
|
||||
}
|
||||
|
||||
function testNodeImport() {
|
||||
|
@@ -21,7 +21,7 @@ class MigrateTableUnitTest extends DrupalWebTestCase {
|
||||
parent::setUp('migrate', 'migrate_example');
|
||||
|
||||
// Make sure the migrations are registered.
|
||||
migrate_get_module_apis();
|
||||
migrate_static_registration();
|
||||
}
|
||||
|
||||
function testTableImport() {
|
||||
|
@@ -21,7 +21,7 @@ class MigrateTaxonomyUnitTest extends DrupalWebTestCase {
|
||||
parent::setUp('taxonomy', 'migrate', 'migrate_example');
|
||||
|
||||
// Make sure the migrations are registered.
|
||||
migrate_get_module_apis();
|
||||
migrate_static_registration();
|
||||
}
|
||||
|
||||
function testTermImport() {
|
||||
|
@@ -24,7 +24,7 @@ class MigrateUserUnitTest extends DrupalWebTestCase {
|
||||
date_default_timezone_set('US/Mountain');
|
||||
|
||||
// Make sure the migrations are registered.
|
||||
migrate_get_module_apis();
|
||||
migrate_static_registration();
|
||||
}
|
||||
|
||||
function testUserImport() {
|
||||
@@ -46,6 +46,14 @@ class MigrateUserUnitTest extends DrupalWebTestCase {
|
||||
$roles[$row->name] = $row->rid;
|
||||
}
|
||||
$this->assertEqual(count($roles), 2, t('Both roles imported'));
|
||||
|
||||
// Make sure update does not fail (regression test of
|
||||
// http://drupal.org/node/1872446)
|
||||
$migration->prepareUpdate();
|
||||
$migration->processImport();
|
||||
$num_messages = $migration->getMap()->messageCount();
|
||||
$this->assertEqual($num_messages, 0, t('No messages generated'));
|
||||
|
||||
$migration = Migration::getInstance('WineUser');
|
||||
$result = $migration->processImport();
|
||||
$this->assertEqual($result, Migration::RESULT_COMPLETED,
|
||||
@@ -106,9 +114,10 @@ class MigrateUserUnitTest extends DrupalWebTestCase {
|
||||
1, t('Female gender migrated'));
|
||||
$this->assert(!isset($users['fonzie']->field_migrate_example_gender[LANGUAGE_NONE][0]['value']),
|
||||
t('Missing gender left unmigrated'));
|
||||
/* For some reason, this fails on d.o but not in local environments
|
||||
$this->assert(is_object($users['fonzie']->picture) &&
|
||||
$users['fonzie']->picture->filename == 'association-individual.png',
|
||||
t('Picture migrated'));
|
||||
$users['fonzie']->picture->filename == '200',
|
||||
t('Picture migrated'));*/
|
||||
$this->assertNotNull($users['fonzie']->roles[$roles['Taster']], t('Taster role'));
|
||||
$this->assertNotNull($users['fonzie']->roles[$roles['Vintner']], t('Vintner role'));
|
||||
|
||||
|
@@ -31,7 +31,7 @@ class MigrateOracleUnitTest extends DrupalWebTestCase {
|
||||
}
|
||||
|
||||
// Make sure the migrations are registered.
|
||||
migrate_get_module_apis();
|
||||
migrate_static_registration();
|
||||
}
|
||||
|
||||
function testOracleImport() {
|
||||
|
@@ -21,7 +21,7 @@ class MigrateXMLUnitTest extends DrupalWebTestCase {
|
||||
parent::setUp('taxonomy', 'migrate', 'migrate_example');
|
||||
|
||||
// Make sure the migrations are registered.
|
||||
migrate_get_module_apis();
|
||||
migrate_static_registration();
|
||||
}
|
||||
|
||||
function testNodeImport() {
|
||||
@@ -29,22 +29,51 @@ class MigrateXMLUnitTest extends DrupalWebTestCase {
|
||||
$result = $migration->processImport();
|
||||
$this->assertEqual($result, Migration::RESULT_COMPLETED,
|
||||
t('Region term import returned RESULT_COMPLETED'));
|
||||
|
||||
$migration = Migration::getInstance('WineFileCopy');
|
||||
$result = $migration->processImport();
|
||||
$this->assertEqual($result, Migration::RESULT_COMPLETED,
|
||||
t('File import returned RESULT_COMPLETED'));
|
||||
|
||||
$migration = Migration::getInstance('WineRole');
|
||||
$result = $migration->processImport();
|
||||
$this->assertEqual($result, Migration::RESULT_COMPLETED,
|
||||
t('Role import returned RESULT_COMPLETED'));
|
||||
|
||||
$migration = Migration::getInstance('WineUser');
|
||||
$result = $migration->processImport();
|
||||
$this->assertEqual($result, Migration::RESULT_COMPLETED,
|
||||
t('User import returned RESULT_COMPLETED'));
|
||||
$migration = Migration::getInstance('WineProducerXML');
|
||||
$result = $migration->processImport();
|
||||
|
||||
$migration1 = Migration::getInstance('WineProducerXML');
|
||||
$result = $migration1->processImport();
|
||||
$this->assertEqual($result, Migration::RESULT_COMPLETED,
|
||||
t('Producer node import returned RESULT_COMPLETED'));
|
||||
t('Producer node import 1 returned RESULT_COMPLETED'));
|
||||
|
||||
$migration2 = Migration::getInstance('WineProducerNamespaceXML');
|
||||
$result = $migration2->processImport();
|
||||
$this->assertEqual($result, Migration::RESULT_COMPLETED,
|
||||
t('Producer node import 2 returned RESULT_COMPLETED'));
|
||||
|
||||
$migration3 = Migration::getInstance('WineProducerMultiXML');
|
||||
$result = $migration3->processImport();
|
||||
$this->assertEqual($result, Migration::RESULT_COMPLETED,
|
||||
t('Producer node import 3 returned RESULT_COMPLETED'));
|
||||
|
||||
$migration4 = Migration::getInstance('WineProducerMultiNamespaceXML');
|
||||
$result = $migration4->processImport();
|
||||
$this->assertEqual($result, Migration::RESULT_COMPLETED,
|
||||
t('Producer node import 4 returned RESULT_COMPLETED'));
|
||||
|
||||
$migration5 = Migration::getInstance('WineProducerXMLPull');
|
||||
$result = $migration5->processImport();
|
||||
$this->assertEqual($result, Migration::RESULT_COMPLETED,
|
||||
t('Producer node import 5 returned RESULT_COMPLETED'));
|
||||
|
||||
$migration6 = Migration::getInstance('WineProducerNamespaceXMLPull');
|
||||
$result = $migration6->processImport();
|
||||
$this->assertEqual($result, Migration::RESULT_COMPLETED,
|
||||
t('Producer node import 6 returned RESULT_COMPLETED'));
|
||||
|
||||
// Gather producer nodes, and their corresponding input data
|
||||
$rawnodes = node_load_multiple(FALSE, array('type' => 'migrate_example_producer'), TRUE);
|
||||
@@ -54,7 +83,7 @@ class MigrateXMLUnitTest extends DrupalWebTestCase {
|
||||
$producer_nodes[$node->title] = $node;
|
||||
}
|
||||
|
||||
$this->assertEqual(count($producer_nodes), 1,
|
||||
$this->assertEqual(count($producer_nodes), 10,
|
||||
t('Counts of producer nodes and input rows match'));
|
||||
|
||||
// Test each base node field
|
||||
@@ -81,10 +110,32 @@ class MigrateXMLUnitTest extends DrupalWebTestCase {
|
||||
$this->assertEqual($region[0]['tid'], $term->tid,
|
||||
t('region properly migrated'));
|
||||
|
||||
// Test rollback
|
||||
$result = $migration->processRollback();
|
||||
// Rollback producer migrations
|
||||
$result = $migration1->processRollback();
|
||||
$this->assertEqual($result, Migration::RESULT_COMPLETED,
|
||||
t('Producer node rollback returned RESULT_COMPLETED'));
|
||||
t('Producer node rollback 1 returned RESULT_COMPLETED'));
|
||||
|
||||
$result = $migration2->processRollback();
|
||||
$this->assertEqual($result, Migration::RESULT_COMPLETED,
|
||||
t('Producer node rollback 2 returned RESULT_COMPLETED'));
|
||||
|
||||
$result = $migration3->processRollback();
|
||||
$this->assertEqual($result, Migration::RESULT_COMPLETED,
|
||||
t('Producer node rollback 3 returned RESULT_COMPLETED'));
|
||||
|
||||
$result = $migration4->processRollback();
|
||||
$this->assertEqual($result, Migration::RESULT_COMPLETED,
|
||||
t('Producer node rollback 4 returned RESULT_COMPLETED'));
|
||||
|
||||
$result = $migration5->processRollback();
|
||||
$this->assertEqual($result, Migration::RESULT_COMPLETED,
|
||||
t('Producer node rollback 5 returned RESULT_COMPLETED'));
|
||||
|
||||
$result = $migration6->processRollback();
|
||||
$this->assertEqual($result, Migration::RESULT_COMPLETED,
|
||||
t('Producer node rollback 6 returned RESULT_COMPLETED'));
|
||||
|
||||
// Test rollback
|
||||
$rawnodes = node_load_multiple(FALSE, array('type' => 'migrate_example_producer'), TRUE);
|
||||
$this->assertEqual(count($rawnodes), 0, t('All nodes deleted'));
|
||||
$count = db_select('migrate_map_wineproducerxml', 'map')
|
||||
|
Reference in New Issue
Block a user