You are here

public function Feedsi18nTestCase::setUp in Feeds 7.2

Sets up a Drupal site for running functional and integration tests.

Generates a random database prefix and installs Drupal with the specified installation profile in DrupalWebTestCase::$profile into the prefixed database. Afterwards, installs any additional modules specified by the test.

After installation all caches are flushed and several configuration values are reset to the values of the parent site executing the test, since the default values may be incompatible with the environment in which tests are being executed.

Parameters

...: List of modules to enable for the duration of the test. This can be either a single array or a variable number of string arguments.

Overrides FeedsWebTestCase::setUp

See also

DrupalWebTestCase::prepareDatabasePrefix()

DrupalWebTestCase::changeDatabasePrefix()

DrupalWebTestCase::prepareEnvironment()

2 calls to Feedsi18nTestCase::setUp()
Feedsi18nNodeTestCase::setUp in tests/feeds_i18n_node.test
Sets up a Drupal site for running functional and integration tests.
Feedsi18nTaxonomyTestCase::setUp in tests/feeds_i18n_taxonomy.test
Sets up a Drupal site for running functional and integration tests.
2 methods override Feedsi18nTestCase::setUp()
Feedsi18nNodeTestCase::setUp in tests/feeds_i18n_node.test
Sets up a Drupal site for running functional and integration tests.
Feedsi18nTaxonomyTestCase::setUp in tests/feeds_i18n_taxonomy.test
Sets up a Drupal site for running functional and integration tests.

File

tests/feeds_i18n.test, line 30
Contains Feedsi18nTestCase.

Class

Feedsi18nTestCase
Tests importing data in a language.

Code

public function setUp($modules = array(), $permissions = array()) {
  $modules = array_merge($modules, array(
    'locale',
  ));
  $permissions = array_merge(array(
    'administer languages',
  ));
  parent::setUp($modules, $permissions);

  // Setup other languages.
  $edit = array(
    'langcode' => 'nl',
  );
  $this
    ->drupalPost('admin/config/regional/language/add', $edit, t('Add language'));
  $this
    ->assertText(t('The language Dutch has been created and can now be used.'));
  $edit = array(
    'langcode' => 'de',
  );
  $this
    ->drupalPost('admin/config/regional/language/add', $edit, t('Add language'));
  $this
    ->assertText(t('The language German has been created and can now be used.'));

  // Include FeedsProcessor.inc to make its constants available.
  module_load_include('inc', 'feeds', 'plugins/FeedsProcessor');

  // Create and configure importer.
  $this
    ->createImporterConfiguration('Multilingual term importer', 'i18n');
  $this
    ->setPlugin('i18n', 'FeedsFileFetcher');
  $this
    ->setPlugin('i18n', 'FeedsCSVParser');
  $this
    ->setPlugin('i18n', $this->processorName);
}