Commit a658710d authored by alexpott's avatar alexpott

Issue #2396717 by hussainweb: Clean-up taxonomy module test members - ensure...

Issue #2396717 by hussainweb: Clean-up taxonomy module test members - ensure property definition and use of camelCase naming convention
parent 85f4178c
......@@ -15,10 +15,17 @@
* @group taxonomy
*/
class EfqTest extends TaxonomyTestBase {
/**
* Vocabulary for testing.
*
* @var \Drupal\taxonomy\VocabularyInterface
*/
protected $vocabulary;
protected function setUp() {
parent::setUp();
$this->admin_user = $this->drupalCreateUser(array('administer taxonomy'));
$this->drupalLogin($this->admin_user);
$this->drupalLogin($this->drupalCreateUser(['administer taxonomy']));
$this->vocabulary = $this->createVocabulary();
}
......
......@@ -62,8 +62,7 @@ protected function setUp() {
))
->save();
$this->admin_user = $this->drupalCreateUser(array('administer taxonomy', 'administer nodes', 'bypass node access'));
$this->drupalLogin($this->admin_user);
$this->drupalLogin($this->drupalCreateUser(['administer taxonomy', 'administer nodes', 'bypass node access']));
}
/**
......
......@@ -18,8 +18,7 @@ class LoadMultipleTest extends TaxonomyTestBase {
protected function setUp() {
parent::setUp();
$this->taxonomy_admin = $this->drupalCreateUser(array('administer taxonomy'));
$this->drupalLogin($this->taxonomy_admin);
$this->drupalLogin($this->drupalCreateUser(['administer taxonomy']));
}
/**
......
......@@ -25,16 +25,29 @@ class RssTest extends TaxonomyTestBase {
*/
public static $modules = array('node', 'field_ui', 'views');
/**
* Vocabulary for testing.
*
* @var \Drupal\taxonomy\VocabularyInterface
*/
protected $vocabulary;
/**
* Name of the taxonomy term reference field.
*
* @var string
*/
protected $fieldName;
protected function setUp() {
parent::setUp();
$this->admin_user = $this->drupalCreateUser(array('administer taxonomy', 'bypass node access', 'administer content types', 'administer node display'));
$this->drupalLogin($this->admin_user);
$this->drupalLogin($this->drupalCreateUser(['administer taxonomy', 'bypass node access', 'administer content types', 'administer node display']));
$this->vocabulary = $this->createVocabulary();
$this->field_name = 'taxonomy_' . $this->vocabulary->id();
$this->fieldName = 'taxonomy_' . $this->vocabulary->id();
$this->fieldStorage = entity_create('field_storage_config', array(
'field_name' => $this->field_name,
$field_storage = entity_create('field_storage_config', array(
'field_name' => $this->fieldName,
'entity_type' => 'node',
'type' => 'taxonomy_term_reference',
'cardinality' => FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED,
......@@ -47,18 +60,18 @@ protected function setUp() {
),
),
));
$this->fieldStorage->save();
$field_storage->save();
entity_create('field_config', array(
'field_storage' => $this->fieldStorage,
'field_storage' => $field_storage,
'bundle' => 'article',
))->save();
entity_get_form_display('node', 'article', 'default')
->setComponent($this->field_name, array(
->setComponent($this->fieldName, array(
'type' => 'options_select',
))
->save();
entity_get_display('node', 'article', 'default')
->setComponent($this->field_name, array(
->setComponent($this->fieldName, array(
'type' => 'taxonomy_term_reference_link',
))
->save();
......@@ -90,7 +103,7 @@ function testTaxonomyRss() {
// Post an article.
$edit = array();
$edit['title[0][value]'] = $this->randomMachineName();
$edit[$this->field_name . '[]'] = $term1->id();
$edit[$this->fieldName . '[]'] = $term1->id();
$this->drupalPostForm('node/add/article', $edit, t('Save'));
// Check that the term is displayed when the RSS feed is viewed.
......
......@@ -21,10 +21,16 @@ class TaxonomyTermIndentationTest extends TaxonomyTestBase {
*/
public static $modules = array('taxonomy');
/**
* Vocabulary for testing.
*
* @var \Drupal\taxonomy\VocabularyInterface
*/
protected $vocabulary;
protected function setUp() {
parent::setUp();
$this->admin_user = $this->drupalCreateUser(array('administer taxonomy', 'bypass node access'));
$this->drupalLogin($this->admin_user);
$this->drupalLogin($this->drupalCreateUser(['administer taxonomy', 'bypass node access']));
$this->vocabulary = $this->createVocabulary();
}
......@@ -72,4 +78,3 @@ function testTermIndentation() {
}
}
......@@ -25,21 +25,38 @@ class TermFieldMultipleVocabularyTest extends TaxonomyTestBase {
*/
public static $modules = array('entity_test');
/**
* Name of the taxonomy term reference field.
*
* @var string
*/
protected $fieldName;
/**
* Vocabulary for testing.
*
* @var \Drupal\taxonomy\VocabularyInterface
*/
protected $vocabulary1;
/**
* Vocabulary for testing.
*
* @var \Drupal\taxonomy\VocabularyInterface
*/
protected $vocabulary2;
protected function setUp() {
parent::setUp();
$web_user = $this->drupalCreateUser(array('view test entity', 'administer entity_test content', 'administer taxonomy'));
$this->drupalLogin($web_user);
$this->drupalLogin($this->drupalCreateUser(['view test entity', 'administer entity_test content', 'administer taxonomy']));
$this->vocabulary1 = $this->createVocabulary();
$this->vocabulary2 = $this->createVocabulary();
// Set up a field storage and a field.
$this->field_name = Unicode::strtolower($this->randomMachineName());
$this->fieldName = Unicode::strtolower($this->randomMachineName());
entity_create('field_storage_config', array(
'field_name' => $this->field_name,
'field_name' => $this->fieldName,
'entity_type' => 'entity_test',
'type' => 'taxonomy_term_reference',
'cardinality' => FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED,
......@@ -57,17 +74,17 @@ protected function setUp() {
)
))->save();
entity_create('field_config', array(
'field_name' => $this->field_name,
'field_name' => $this->fieldName,
'entity_type' => 'entity_test',
'bundle' => 'entity_test',
))->save();
entity_get_form_display('entity_test', 'entity_test', 'default')
->setComponent($this->field_name, array(
->setComponent($this->fieldName, array(
'type' => 'options_select',
))
->save();
entity_get_display('entity_test', 'entity_test', 'full')
->setComponent($this->field_name, array(
->setComponent($this->fieldName, array(
'type' => 'taxonomy_term_reference_link',
))
->save();
......@@ -85,9 +102,9 @@ function testTaxonomyTermFieldMultipleVocabularies() {
$this->drupalGet('entity_test/add');
// Just check if the widget for the select is displayed, the NULL value is
// used to ignore the value check.
$this->assertFieldByName("{$this->field_name}[]", NULL, 'Widget is displayed.');
$this->assertFieldByName("{$this->fieldName}[]", NULL, 'Widget is displayed.');
$edit = array(
"{$this->field_name}[]" => array($term1->id(), $term2->id()),
"{$this->fieldName}[]" => array($term1->id(), $term2->id()),
);
$this->drupalPostForm(NULL, $edit, t('Save'));
preg_match('|entity_test/manage/(\d+)|', $this->url, $match);
......@@ -116,18 +133,18 @@ function testTaxonomyTermFieldMultipleVocabularies() {
$this->assertNoText($term2->getName(), 'Term 2 name is not displayed.');
// Verify that field storage settings and field settings are correct.
$field_storage = FieldStorageConfig::loadByName('entity_test', $this->field_name);
$field_storage = FieldStorageConfig::loadByName('entity_test', $this->fieldName);
$this->assertEqual(count($field_storage->getSetting('allowed_values')), 1, 'Only one vocabulary is allowed for the field.');
// The widget should still be displayed.
$this->drupalGet('entity_test/add');
// Just check if the widget for the select is displayed, the NULL value is
// used to ignore the value check.
$this->assertFieldByName("{$this->field_name}[]", NULL, 'Widget is still displayed.');
$this->assertFieldByName("{$this->fieldName}[]", NULL, 'Widget is still displayed.');
// Term 1 should still pass validation.
$edit = array(
"{$this->field_name}[]" => array($term1->id()),
"{$this->fieldName}[]" => array($term1->id()),
);
$this->drupalPostForm(NULL, $edit, t('Save'));
}
......
......@@ -17,12 +17,19 @@
*/
class TermFieldTest extends TaxonomyTestBase {
/**
* Name of the taxonomy term reference field.
*
* @var string
*/
protected $fieldName;
/**
* The field storage to test against.
*
* @var \Drupal\field\FieldStorageConfigInterface
*/
protected $field_storage;
protected $fieldStorage;
/**
* Modules to enable.
......@@ -31,6 +38,11 @@ class TermFieldTest extends TaxonomyTestBase {
*/
public static $modules = array('entity_test', 'field_ui');
/**
* Vocabulary for testing.
*
* @var \Drupal\taxonomy\VocabularyInterface
*/
protected $vocabulary;
protected function setUp() {
......@@ -46,9 +58,9 @@ protected function setUp() {
$this->vocabulary = $this->createVocabulary();
// Setup a field.
$this->field_name = Unicode::strtolower($this->randomMachineName());
$this->field_storage = entity_create('field_storage_config', array(
'field_name' => $this->field_name,
$this->fieldName = Unicode::strtolower($this->randomMachineName());
$this->fieldStorage = entity_create('field_storage_config', array(
'field_name' => $this->fieldName,
'entity_type' => 'entity_test',
'type' => 'taxonomy_term_reference',
'settings' => array(
......@@ -60,18 +72,18 @@ protected function setUp() {
),
)
));
$this->field_storage->save();
$this->fieldStorage->save();
entity_create('field_config', array(
'field_storage' => $this->field_storage,
'field_storage' => $this->fieldStorage,
'bundle' => 'entity_test',
))->save();
entity_get_form_display('entity_test', 'entity_test', 'default')
->setComponent($this->field_name, array(
->setComponent($this->fieldName, array(
'type' => 'options_select',
))
->save();
entity_get_display('entity_test', 'entity_test', 'full')
->setComponent($this->field_name, array(
->setComponent($this->fieldName, array(
'type' => 'taxonomy_term_reference_link',
))
->save();
......@@ -84,15 +96,15 @@ function testTaxonomyTermFieldValidation() {
// Test validation with a valid value.
$term = $this->createTerm($this->vocabulary);
$entity = entity_create('entity_test');
$entity->{$this->field_name}->target_id = $term->id();
$violations = $entity->{$this->field_name}->validate();
$entity->{$this->fieldName}->target_id = $term->id();
$violations = $entity->{$this->fieldName}->validate();
$this->assertEqual(count($violations) , 0, 'Correct term does not cause validation error.');
// Test validation with an invalid valid value (wrong vocabulary).
$bad_term = $this->createTerm($this->createVocabulary());
$entity = entity_create('entity_test');
$entity->{$this->field_name}->target_id = $bad_term->id();
$violations = $entity->{$this->field_name}->validate();
$entity->{$this->fieldName}->target_id = $bad_term->id();
$violations = $entity->{$this->fieldName}->validate();
$this->assertEqual(count($violations) , 1, 'Wrong term causes validation error.');
}
......@@ -105,11 +117,11 @@ function testTaxonomyTermFieldWidgets() {
// Display creation form.
$this->drupalGet('entity_test/add');
$this->assertFieldByName($this->field_name, NULL, 'Widget is displayed.');
$this->assertFieldByName($this->fieldName, NULL, 'Widget is displayed.');
// Submit with some value.
$edit = array(
$this->field_name => array($term->id()),
$this->fieldName => array($term->id()),
);
$this->drupalPostForm(NULL, $edit, t('Save'));
preg_match('|entity_test/manage/(\d+)|', $this->url, $match);
......@@ -126,7 +138,7 @@ function testTaxonomyTermFieldWidgets() {
// Delete the vocabulary and verify that the widget is gone.
$this->vocabulary->delete();
$this->drupalGet('entity_test/add');
$this->assertNoFieldByName($this->field_name, '', 'Widget is not displayed.');
$this->assertNoFieldByName($this->fieldName, '', 'Widget is not displayed.');
}
/**
......@@ -134,12 +146,12 @@ function testTaxonomyTermFieldWidgets() {
*/
function testTaxonomyTermFieldSettingsAutocompleteWidget() {
entity_get_form_display('entity_test', 'entity_test', 'default')
->setComponent($this->field_name, array(
->setComponent($this->fieldName, array(
'type' => 'taxonomy_autocomplete',
'weight' => 1,
))
->save();
$this->drupalGet('entity_test/structure/entity_test/fields/entity_test.entity_test.' . $this->field_name);
$this->drupalGet('entity_test/structure/entity_test/fields/entity_test.entity_test.' . $this->fieldName);
$this->assertNoErrorsLogged();
}
......@@ -149,7 +161,7 @@ function testTaxonomyTermFieldSettingsAutocompleteWidget() {
function testTaxonomyTermFieldChangeMachineName() {
// Add several entries in the 'allowed_values' setting, to make sure that
// they all get updated.
$this->field_storage->settings['allowed_values'] = array(
$this->fieldStorage->settings['allowed_values'] = array(
array(
'vocabulary' => $this->vocabulary->id(),
'parent' => '0',
......@@ -163,14 +175,14 @@ function testTaxonomyTermFieldChangeMachineName() {
'parent' => '0',
),
);
$this->field_storage->save();
$this->fieldStorage->save();
// Change the machine name.
$new_name = Unicode::strtolower($this->randomMachineName());
$this->vocabulary->set('vid', $new_name);
$this->vocabulary->save();
// Check that the field is still attached to the vocabulary.
$field_storage = FieldStorageConfig::loadByName('entity_test', $this->field_name);
$field_storage = FieldStorageConfig::loadByName('entity_test', $this->fieldName);
$allowed_values = $field_storage->getSetting('allowed_values');
$this->assertEqual($allowed_values[0]['vocabulary'], $new_name, 'Index 0: Machine name was updated correctly.');
$this->assertEqual($allowed_values[1]['vocabulary'], $new_name, 'Index 1: Machine name was updated correctly.');
......
......@@ -25,19 +25,39 @@ class TermIndexTest extends TaxonomyTestBase {
*/
public static $modules = array('views');
/**
* Vocabulary for testing.
*
* @var \Drupal\taxonomy\VocabularyInterface
*/
protected $vocabulary;
/**
* Name of the taxonomy term reference field.
*
* @var string
*/
protected $fieldName1;
/**
* Name of the taxonomy term reference field.
*
* @var string
*/
protected $fieldName2;
protected function setUp() {
parent::setUp();
// Create an administrative user.
$this->admin_user = $this->drupalCreateUser(array('administer taxonomy', 'bypass node access'));
$this->drupalLogin($this->admin_user);
$this->drupalLogin($this->drupalCreateUser(['administer taxonomy', 'bypass node access']));
// Create a vocabulary and add two term reference fields to article nodes.
$this->vocabulary = $this->createVocabulary();
$this->field_name_1 = Unicode::strtolower($this->randomMachineName());
$this->fieldName1 = Unicode::strtolower($this->randomMachineName());
entity_create('field_storage_config', array(
'field_name' => $this->field_name_1,
'field_name' => $this->fieldName1,
'entity_type' => 'node',
'type' => 'taxonomy_term_reference',
'cardinality' => FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED,
......@@ -51,24 +71,24 @@ protected function setUp() {
),
))->save();
entity_create('field_config', array(
'field_name' => $this->field_name_1,
'field_name' => $this->fieldName1,
'bundle' => 'article',
'entity_type' => 'node',
))->save();
entity_get_form_display('node', 'article', 'default')
->setComponent($this->field_name_1, array(
->setComponent($this->fieldName1, array(
'type' => 'options_select',
))
->save();
entity_get_display('node', 'article', 'default')
->setComponent($this->field_name_1, array(
->setComponent($this->fieldName1, array(
'type' => 'taxonomy_term_reference_link',
))
->save();
$this->field_name_2 = Unicode::strtolower($this->randomMachineName());
$this->fieldName2 = Unicode::strtolower($this->randomMachineName());
entity_create('field_storage_config', array(
'field_name' => $this->field_name_2,
'field_name' => $this->fieldName2,
'entity_type' => 'node',
'type' => 'taxonomy_term_reference',
'cardinality' => FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED,
......@@ -82,17 +102,17 @@ protected function setUp() {
),
))->save();
entity_create('field_config', array(
'field_name' => $this->field_name_2,
'field_name' => $this->fieldName2,
'bundle' => 'article',
'entity_type' => 'node',
))->save();
entity_get_form_display('node', 'article', 'default')
->setComponent($this->field_name_2, array(
->setComponent($this->fieldName2, array(
'type' => 'options_select',
))
->save();
entity_get_display('node', 'article', 'default')
->setComponent($this->field_name_2, array(
->setComponent($this->fieldName2, array(
'type' => 'taxonomy_term_reference_link',
))
->save();
......@@ -111,8 +131,8 @@ function testTaxonomyIndex() {
$edit = array();
$edit['title[0][value]'] = $this->randomMachineName();
$edit['body[0][value]'] = $this->randomMachineName();
$edit["{$this->field_name_1}[]"] = $term_1->id();
$edit["{$this->field_name_2}[]"] = $term_1->id();
$edit["{$this->fieldName1}[]"] = $term_1->id();
$edit["{$this->fieldName2}[]"] = $term_1->id();
$this->drupalPostForm('node/add/article', $edit, t('Save'));
// Check that the term is indexed, and only once.
......@@ -124,7 +144,7 @@ function testTaxonomyIndex() {
$this->assertEqual(1, $index_count, 'Term 1 is indexed once.');
// Update the article to change one term.
$edit["{$this->field_name_1}[]"] = $term_2->id();
$edit["{$this->fieldName1}[]"] = $term_2->id();
$this->drupalPostForm('node/' . $node->id() . '/edit', $edit, t('Save'));
// Check that both terms are indexed.
......@@ -140,7 +160,7 @@ function testTaxonomyIndex() {
$this->assertEqual(1, $index_count, 'Term 2 is indexed.');
// Update the article to change another term.
$edit["{$this->field_name_2}[]"] = $term_2->id();
$edit["{$this->fieldName2}[]"] = $term_2->id();
$this->drupalPostForm('node/' . $node->id() . '/edit', $edit, t('Save'));
// Check that only one term is indexed.
......@@ -176,7 +196,7 @@ function testTaxonomyIndex() {
$this->assertEqual(1, $index_count, 'Term 2 is indexed once.');
// Update the article to change one term.
$node->{$this->field_name_1} = array(array('target_id' => $term_1->id()));
$node->{$this->fieldName1} = array(array('target_id' => $term_1->id()));
$node->save();
// Check that both terms are indexed.
......@@ -192,7 +212,7 @@ function testTaxonomyIndex() {
$this->assertEqual(1, $index_count, 'Term 2 is indexed.');
// Update the article to change another term.
$node->{$this->field_name_2} = array(array('target_id' => $term_1->id()));
$node->{$this->fieldName2} = array(array('target_id' => $term_1->id()));
$node->save();
// Check that only one term is indexed.
......
......@@ -19,12 +19,18 @@ class TermLanguageTest extends TaxonomyTestBase {
public static $modules = array('language');
/**
* Vocabulary for testing.
*
* @var \Drupal\taxonomy\VocabularyInterface
*/
protected $vocabulary;
protected function setUp() {
parent::setUp();
// Create an administrative user.
$this->admin_user = $this->drupalCreateUser(array('administer taxonomy'));
$this->drupalLogin($this->admin_user);
$this->drupalLogin($this->drupalCreateUser(['administer taxonomy']));
// Create a vocabulary to which the terms will be assigned.
$this->vocabulary = $this->createVocabulary();
......
......@@ -23,10 +23,23 @@
*/
class TermTest extends TaxonomyTestBase {
/**
* Vocabulary for testing.
*
* @var \Drupal\taxonomy\VocabularyInterface
*/
protected $vocabulary;
/**
* Taxonomy term reference field for testing.
*
* @var \Drupal\field\FieldConfigInterface
*/
protected $field;
protected function setUp() {
parent::setUp();
$this->admin_user = $this->drupalCreateUser(array('administer taxonomy', 'bypass node access'));
$this->drupalLogin($this->admin_user);
$this->drupalLogin($this->drupalCreateUser(['administer taxonomy', 'bypass node access']));
$this->vocabulary = $this->createVocabulary();
$field_name = 'taxonomy_' . $this->vocabulary->id();
......
......@@ -20,7 +20,7 @@ class TermTranslationUITest extends ContentTranslationUITest {
/**
* The vocabulary used for creating terms.
*
* @var \Drupal\taxonomy\Entity\Vocabulary
* @var \Drupal\taxonomy\VocabularyInterface
*/
protected $vocabulary;
......@@ -105,8 +105,7 @@ public function testTranslationUI() {
* Tests translate link on vocabulary term list.
*/
function testTranslateLinkVocabularyAdminPage() {
$this->admin_user = $this->drupalCreateUser(array_merge(parent::getTranslatorPermissions(), array('access administration pages', 'administer taxonomy')));
$this->drupalLogin($this->admin_user);
$this->drupalLogin($this->drupalCreateUser(array_merge(parent::getTranslatorPermissions(), ['access administration pages', 'administer taxonomy'])));
$values = array(
'name' => $this->randomMachineName(),
......
......@@ -19,14 +19,27 @@
*/
class TokenReplaceTest extends TaxonomyTestBase {
/**
* The vocabulary used for creating terms.
*
* @var \Drupal\taxonomy\VocabularyInterface
*/
protected $vocabulary;
/**
* Name of the taxonomy term reference field.
*
* @var string
*/
protected $fieldName;
protected function setUp() {
parent::setUp();
$this->admin_user = $this->drupalCreateUser(array('administer taxonomy', 'bypass node access'));
$this->drupalLogin($this->admin_user);
$this->drupalLogin($this->drupalCreateUser(['administer taxonomy', 'bypass node access']));
$this->vocabulary = $this->createVocabulary();
$this->field_name = 'taxonomy_' . $this->vocabulary->id();
$this->fieldName = 'taxonomy_' . $this->vocabulary->id();
entity_create('field_storage_config', array(
'field_name' => $this->field_name,
'field_name' => $this->fieldName,
'entity_type' => 'node',
'type' => 'taxonomy_term_reference',
'cardinality' => FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED,
......@@ -41,17 +54,17 @@ protected function setUp() {
))->save();
entity_create('field_config', array(
'field_name' => $this->field_name,
'field_name' => $this->fieldName,
'bundle' => 'article',
'entity_type' => 'node',
))->save();
entity_get_form_display('node', 'article', 'default')
->setComponent($this->field_name, array(
->setComponent($this->fieldName, array(
'type' => 'options_select',
))
->save();
entity_get_display('node', 'article', 'default')
->setComponent($this->field_name, array(
->setComponent($this->fieldName, array(
'type' => 'taxonomy_term_reference_link',
))
->save();
......@@ -77,7 +90,7 @@ function testTaxonomyTokenReplacement() {
// Create node with term2.
$edit = array();
$node = $this->drupalCreateNode(array('type' => 'article'));
$edit[$this->field_name . '[]'] = $term2->id();
$edit[$this->fieldName . '[]'] = $term2->id();
$this->drupalPostForm('node/' . $node->id() . '/edit', $edit, t('Save'));
// Generate and test sanitized tokens for term1.
......
......@@ -32,12 +32,19 @@ class TaxonomyFieldFilterTest extends ViewTestBase {
*/
public static $testViews = array('test_field_filters');
/**
* The vocabulary used for creating terms.
*
* @var \Drupal\taxonomy\VocabularyInterface
*/
protected $vocabulary;
/**
* List of taxonomy term names by language.
*
* @var array
*/
public $term_names = array();
public $termNames = [];
function setUp() {
parent::setUp();
......@@ -47,7 +54,7 @@ function setUp() {
ConfigurableLanguage::createFromLangcode('es')->save();
// Set up term names.
$this->term_names = array(
$this->termNames = array(
'en' => 'Food in Paris',
'es' => 'Comida en Paris',
'fr' => 'Nouriture en Paris',
......@@ -75,11 +82,11 @@ function setUp() {
))->save();
// Create term with translations.
$taxonomy = $this->createTermWithProperties(array('name' => $this->term_names['en'], 'langcode' => 'en', 'description' => $this->term_names['en'], 'field_foo' => $this->term_names['en']));
$taxonomy = $this->createTermWithProperties(array('name' => $this->termNames['en'], 'langcode' => 'en', 'description' => $this->termNames['en'], 'field_foo' => $this->termNames['en']));
foreach (array('es', 'fr') as $langcode) {
$translation = $taxonomy->addTranslation($langcode, array('name' => $this->term_names[$langcode]));
$translation->description->value = $this->term_names[$langcode];
$translation->field_foo->value = $this->term_names[$langcode];
$translation = $taxonomy->addTranslation($langcode, array('name' => $this->termNames[$langcode]));
$translation->description->value = $this->termNames[$langcode];
$translation->field_foo->value = $this->termNames[$langcode];
}
$taxonomy->save();
......@@ -139,7 +146,7 @@ protected function assertPageCounts($path, $counts, $message) {
// page, and they are the same. So the title/body string should appear on
// the page twice as many times as the input count.
foreach ($counts as $langcode => $count) {