You are here

function MigrateExtrasPathautoUnitTest::testPathautoImport in Migrate Extras 7.2

Verify that setting 'pathauto' to FALSE when migrating actually prevents pathauto from creating an alias.

File

tests/pathauto.test, line 24

Class

MigrateExtrasPathautoUnitTest
Test pathauto migration.

Code

function testPathautoImport() {
  $migration = Migration::getInstance('MigrateExamplePathauto');
  $result = $migration
    ->processImport();
  $this
    ->assertEqual($result, Migration::RESULT_COMPLETED, t('Import returned RESULT_COMPLETED'));
  $rawnodes = node_load_multiple(FALSE, array(
    'type' => 'migrate_example_pathauto',
  ), TRUE);
  $this
    ->assertEqual(count($rawnodes), 2, t('Two sample nodes created'));
  $count = db_select('url_alias', 'ua')
    ->fields('ua', array(
    'source',
  ))
    ->countQuery()
    ->execute()
    ->fetchField();
  $this
    ->assertEqual($count, 0, t('No aliases generated'));
}