You are here

public function Feedsi18nTestCase::testRemovedLanguage in Feeds 7.2

Tests if items are imported in LANGUAGE_NONE if the processor's language is removed.

File

tests/feeds_i18n.test, line 121
Contains Feedsi18nTestCase.

Class

Feedsi18nTestCase
Tests importing data in a language.

Code

public function testRemovedLanguage() {

  // Remove the German language.
  $path = 'admin/config/regional/language/delete/de';
  $this
    ->drupalPost($path, array(), t('Delete'));

  // Import content.
  $this
    ->importFile('i18n', $this
    ->absolutePath() . '/tests/feeds/content.csv');

  // Assert that the entities have no language assigned.
  $entities = entity_load($this->entityType, array(
    1,
    2,
  ));
  foreach ($entities as $entity) {
    $language = entity_language($this->entityType, $entity);
    $this
      ->assertEqual(LANGUAGE_NONE, $language, format_string('The entity is language neutral (actual: !language).', array(
      '!language' => $language,
    )));
  }
}