summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLee Rowlands2017-06-24 06:11:53 (GMT)
committerLee Rowlands2017-06-24 06:11:53 (GMT)
commitc4b5c0dce5efef4e5e9d78bfe22df75c57ec6bea (patch)
tree0cc58bde3625828677653c1fe8d6db4b76614c1a
parent9539eafcf3f66660ebb703f8f76ea01a70b57d65 (diff)
Issue #2870459 by naveenvalecha, Lendude, zahord, Jo Fitzgerald, dawehner, larowlan, claudiu.cristea: Convert web tests to browser tests for taxonomy module
-rw-r--r--core/modules/rdf/tests/src/Functional/EntityReferenceFieldAttributesTest.php2
-rw-r--r--core/modules/rdf/tests/src/Functional/TaxonomyAttributesTest.php2
-rw-r--r--core/modules/taxonomy/src/Tests/TaxonomyTestBase.php3
-rw-r--r--core/modules/taxonomy/src/Tests/TaxonomyTestTrait.php5
-rw-r--r--core/modules/taxonomy/src/Tests/TaxonomyTranslationTestTrait.php5
-rw-r--r--core/modules/taxonomy/tests/src/Functional/TaxonomyImageTest.php (renamed from core/modules/taxonomy/src/Tests/TaxonomyImageTest.php)8
-rw-r--r--core/modules/taxonomy/tests/src/Functional/TaxonomyQueryAlterTest.php (renamed from core/modules/taxonomy/src/Tests/TaxonomyQueryAlterTest.php)6
-rw-r--r--core/modules/taxonomy/tests/src/Functional/TaxonomyTermPagerTest.php (renamed from core/modules/taxonomy/src/Tests/TaxonomyTermPagerTest.php)2
-rw-r--r--core/modules/taxonomy/tests/src/Functional/TaxonomyTestBase.php1
-rw-r--r--core/modules/taxonomy/tests/src/Functional/TaxonomyTestTrait.php60
-rw-r--r--core/modules/taxonomy/tests/src/Functional/TaxonomyTranslationTestTrait.php105
-rw-r--r--core/modules/taxonomy/tests/src/Functional/TermTranslationFieldViewTest.php1
-rw-r--r--core/modules/taxonomy/tests/src/Functional/TermTranslationUITest.php (renamed from core/modules/taxonomy/src/Tests/TermTranslationUITest.php)4
-rw-r--r--core/modules/taxonomy/tests/src/Functional/ThemeTest.php (renamed from core/modules/taxonomy/src/Tests/ThemeTest.php)2
-rw-r--r--core/modules/taxonomy/tests/src/Functional/Views/ArgumentValidatorTermTest.php (renamed from core/modules/taxonomy/src/Tests/Views/ArgumentValidatorTermTest.php)6
-rw-r--r--core/modules/taxonomy/tests/src/Functional/Views/RelationshipNodeTermDataTest.php (renamed from core/modules/taxonomy/src/Tests/Views/RelationshipNodeTermDataTest.php)2
-rw-r--r--core/modules/taxonomy/tests/src/Functional/Views/RelationshipRepresentativeNodeTest.php (renamed from core/modules/taxonomy/src/Tests/Views/RelationshipRepresentativeNodeTest.php)2
-rw-r--r--core/modules/taxonomy/tests/src/Functional/Views/TaxonomyDefaultArgumentTest.php (renamed from core/modules/taxonomy/src/Tests/Views/TaxonomyDefaultArgumentTest.php)2
-rw-r--r--core/modules/taxonomy/tests/src/Functional/Views/TaxonomyFieldAllTermsTest.php (renamed from core/modules/taxonomy/src/Tests/Views/TaxonomyFieldAllTermsTest.php)10
-rw-r--r--core/modules/taxonomy/tests/src/Functional/Views/TaxonomyFieldFilterTest.php (renamed from core/modules/taxonomy/src/Tests/Views/TaxonomyFieldFilterTest.php)8
-rw-r--r--core/modules/taxonomy/tests/src/Functional/Views/TaxonomyFieldTidTest.php (renamed from core/modules/taxonomy/src/Tests/Views/TaxonomyFieldTidTest.php)2
-rw-r--r--core/modules/taxonomy/tests/src/Functional/Views/TaxonomyIndexTidFilterTest.php (renamed from core/modules/taxonomy/src/Tests/Views/TaxonomyIndexTidFilterTest.php)4
-rw-r--r--core/modules/taxonomy/tests/src/Functional/Views/TaxonomyRelationshipTest.php (renamed from core/modules/taxonomy/src/Tests/Views/TaxonomyRelationshipTest.php)6
-rw-r--r--core/modules/taxonomy/tests/src/Functional/Views/TaxonomyTermArgumentDepthTest.php (renamed from core/modules/taxonomy/src/Tests/Views/TaxonomyTermArgumentDepthTest.php)6
-rw-r--r--core/modules/taxonomy/tests/src/Functional/Views/TaxonomyTermFilterDepthTest.php (renamed from core/modules/taxonomy/src/Tests/Views/TaxonomyTermFilterDepthTest.php)6
-rw-r--r--core/modules/taxonomy/tests/src/Functional/Views/TaxonomyTermViewTest.php (renamed from core/modules/taxonomy/src/Tests/Views/TaxonomyTermViewTest.php)6
-rw-r--r--core/modules/taxonomy/tests/src/Functional/Views/TaxonomyTestBase.php (renamed from core/modules/taxonomy/src/Tests/Views/TaxonomyTestBase.php)4
-rw-r--r--core/modules/taxonomy/tests/src/Functional/Views/TaxonomyVocabularyArgumentTest.php (renamed from core/modules/taxonomy/src/Tests/Views/TaxonomyVocabularyArgumentTest.php)6
-rw-r--r--core/modules/taxonomy/tests/src/Functional/Views/TermNameFieldTest.php (renamed from core/modules/taxonomy/src/Tests/Views/TermNameFieldTest.php)2
-rw-r--r--core/modules/taxonomy/tests/src/Functional/VocabularyUiTest.php (renamed from core/modules/taxonomy/src/Tests/VocabularyUiTest.php)3
-rw-r--r--core/modules/taxonomy/tests/src/Kernel/TermKernelTest.php2
-rw-r--r--core/modules/views/tests/src/Functional/TaxonomyGlossaryTest.php2
32 files changed, 233 insertions, 52 deletions
diff --git a/core/modules/rdf/tests/src/Functional/EntityReferenceFieldAttributesTest.php b/core/modules/rdf/tests/src/Functional/EntityReferenceFieldAttributesTest.php
index 41a0365..629c4aa 100644
--- a/core/modules/rdf/tests/src/Functional/EntityReferenceFieldAttributesTest.php
+++ b/core/modules/rdf/tests/src/Functional/EntityReferenceFieldAttributesTest.php
@@ -3,7 +3,7 @@
namespace Drupal\Tests\rdf\Functional;
use Drupal\Core\Field\FieldStorageDefinitionInterface;
-use Drupal\taxonomy\Tests\TaxonomyTestBase;
+use Drupal\Tests\taxonomy\Functional\TaxonomyTestBase;
/**
* Tests RDFa markup generation for taxonomy term fields.
diff --git a/core/modules/rdf/tests/src/Functional/TaxonomyAttributesTest.php b/core/modules/rdf/tests/src/Functional/TaxonomyAttributesTest.php
index ea74ce5..346ffb7 100644
--- a/core/modules/rdf/tests/src/Functional/TaxonomyAttributesTest.php
+++ b/core/modules/rdf/tests/src/Functional/TaxonomyAttributesTest.php
@@ -2,7 +2,7 @@
namespace Drupal\Tests\rdf\Functional;
-use Drupal\taxonomy\Tests\TaxonomyTestBase;
+use Drupal\Tests\taxonomy\Functional\TaxonomyTestBase;
/**
* Tests the RDFa markup of Taxonomy terms.
diff --git a/core/modules/taxonomy/src/Tests/TaxonomyTestBase.php b/core/modules/taxonomy/src/Tests/TaxonomyTestBase.php
index 838a9b0..b4f941d 100644
--- a/core/modules/taxonomy/src/Tests/TaxonomyTestBase.php
+++ b/core/modules/taxonomy/src/Tests/TaxonomyTestBase.php
@@ -2,8 +2,11 @@
namespace Drupal\taxonomy\Tests;
+@trigger_error(__NAMESPACE__ . '\TaxonomyTestBase is deprecated in Drupal 8.4.0 and will be removed before Drupal 9.0.0. Instead, use \Drupal\Tests\taxonomy\Functional\TaxonomyTestBase', E_USER_DEPRECATED);
+
use Drupal\field\Tests\EntityReference\EntityReferenceTestTrait;
use Drupal\simpletest\WebTestBase;
+use Drupal\Tests\taxonomy\Functional\TaxonomyTestTrait;
/**
* Provides common helper methods for Taxonomy module tests.
diff --git a/core/modules/taxonomy/src/Tests/TaxonomyTestTrait.php b/core/modules/taxonomy/src/Tests/TaxonomyTestTrait.php
index 744ab1b..8c4a667 100644
--- a/core/modules/taxonomy/src/Tests/TaxonomyTestTrait.php
+++ b/core/modules/taxonomy/src/Tests/TaxonomyTestTrait.php
@@ -2,6 +2,8 @@
namespace Drupal\taxonomy\Tests;
+@trigger_error(__NAMESPACE__ . '\TaxonomyTestTrait is deprecated in Drupal 8.4.0 and will be removed before Drupal 9.0.0. Instead, use \Drupal\Tests\taxonomy\Functional\TaxonomyTestTrait', E_USER_DEPRECATED);
+
use Drupal\Component\Utility\Unicode;
use Drupal\Core\Language\LanguageInterface;
use Drupal\taxonomy\Entity\Vocabulary;
@@ -9,6 +11,9 @@ use Drupal\taxonomy\Entity\Term;
/**
* Provides common helper methods for Taxonomy module tests.
+ *
+ * @deprecated in Drupal 8.4.0 and will be removed before Drupal 9.0.0.
+ * Use \Drupal\Tests\taxonomy\Functional\TaxonomyTestTrait
*/
trait TaxonomyTestTrait {
diff --git a/core/modules/taxonomy/src/Tests/TaxonomyTranslationTestTrait.php b/core/modules/taxonomy/src/Tests/TaxonomyTranslationTestTrait.php
index 3607fc6..6442117 100644
--- a/core/modules/taxonomy/src/Tests/TaxonomyTranslationTestTrait.php
+++ b/core/modules/taxonomy/src/Tests/TaxonomyTranslationTestTrait.php
@@ -2,6 +2,8 @@
namespace Drupal\taxonomy\Tests;
+@trigger_error(__NAMESPACE__ . '\TaxonomyTranslationTestTrait is deprecated in Drupal 8.4.0 and will be removed before Drupal 9.0.0. Instead, use \Drupal\Tests\taxonomy\Functional\TaxonomyTranslationTestTrait', E_USER_DEPRECATED);
+
use Drupal\Core\Field\FieldStorageDefinitionInterface;
use Drupal\field\Tests\EntityReference\EntityReferenceTestTrait;
use Drupal\field\Entity\FieldStorageConfig;
@@ -9,6 +11,9 @@ use Drupal\language\Entity\ConfigurableLanguage;
/**
* Provides common testing base for translated taxonomy terms.
+ *
+ * @deprecated in Drupal 8.4.0 and will be removed before Drupal 9.0.0.
+ * Use \Drupal\Tests\taxonomy\Functional\TaxonomyTranslationTestTrait
*/
trait TaxonomyTranslationTestTrait {
diff --git a/core/modules/taxonomy/src/Tests/TaxonomyImageTest.php b/core/modules/taxonomy/tests/src/Functional/TaxonomyImageTest.php
index 7d2ee2b..504c0da 100644
--- a/core/modules/taxonomy/src/Tests/TaxonomyImageTest.php
+++ b/core/modules/taxonomy/tests/src/Functional/TaxonomyImageTest.php
@@ -1,8 +1,9 @@
<?php
-namespace Drupal\taxonomy\Tests;
+namespace Drupal\Tests\taxonomy\Functional;
use Drupal\field\Entity\FieldConfig;
+use Drupal\Tests\TestFileCreationTrait;
use Drupal\user\RoleInterface;
use Drupal\file\Entity\File;
use Drupal\field\Entity\FieldStorageConfig;
@@ -14,6 +15,11 @@ use Drupal\field\Entity\FieldStorageConfig;
*/
class TaxonomyImageTest extends TaxonomyTestBase {
+ use TestFileCreationTrait {
+ getTestFiles as drupalGetTestFiles;
+ compareFiles as drupalCompareFiles;
+ }
+
/**
* Used taxonomy vocabulary.
*
diff --git a/core/modules/taxonomy/src/Tests/TaxonomyQueryAlterTest.php b/core/modules/taxonomy/tests/src/Functional/TaxonomyQueryAlterTest.php
index e5e787b..85310e9 100644
--- a/core/modules/taxonomy/src/Tests/TaxonomyQueryAlterTest.php
+++ b/core/modules/taxonomy/tests/src/Functional/TaxonomyQueryAlterTest.php
@@ -1,15 +1,15 @@
<?php
-namespace Drupal\taxonomy\Tests;
+namespace Drupal\Tests\taxonomy\Functional;
-use Drupal\simpletest\WebTestBase;
+use Drupal\Tests\BrowserTestBase;
/**
* Tests that appropriate query tags are added.
*
* @group taxonomy
*/
-class TaxonomyQueryAlterTest extends WebTestBase {
+class TaxonomyQueryAlterTest extends BrowserTestBase {
use TaxonomyTestTrait;
diff --git a/core/modules/taxonomy/src/Tests/TaxonomyTermPagerTest.php b/core/modules/taxonomy/tests/src/Functional/TaxonomyTermPagerTest.php
index f693988..66782f3 100644
--- a/core/modules/taxonomy/src/Tests/TaxonomyTermPagerTest.php
+++ b/core/modules/taxonomy/tests/src/Functional/TaxonomyTermPagerTest.php
@@ -1,6 +1,6 @@
<?php
-namespace Drupal\taxonomy\Tests;
+namespace Drupal\Tests\taxonomy\Functional;
/**
* Ensures that the term pager works properly.
diff --git a/core/modules/taxonomy/tests/src/Functional/TaxonomyTestBase.php b/core/modules/taxonomy/tests/src/Functional/TaxonomyTestBase.php
index ed8b95f..fdbfccd 100644
--- a/core/modules/taxonomy/tests/src/Functional/TaxonomyTestBase.php
+++ b/core/modules/taxonomy/tests/src/Functional/TaxonomyTestBase.php
@@ -4,7 +4,6 @@ namespace Drupal\Tests\taxonomy\Functional;
use Drupal\field\Tests\EntityReference\EntityReferenceTestTrait;
use Drupal\Tests\BrowserTestBase;
-use Drupal\taxonomy\Tests\TaxonomyTestTrait;
/**
* Provides common helper methods for Taxonomy module tests.
diff --git a/core/modules/taxonomy/tests/src/Functional/TaxonomyTestTrait.php b/core/modules/taxonomy/tests/src/Functional/TaxonomyTestTrait.php
new file mode 100644
index 0000000..db445e9
--- /dev/null
+++ b/core/modules/taxonomy/tests/src/Functional/TaxonomyTestTrait.php
@@ -0,0 +1,60 @@
+<?php
+
+namespace Drupal\Tests\taxonomy\Functional;
+
+use Drupal\Component\Utility\Unicode;
+use Drupal\Core\Language\LanguageInterface;
+use Drupal\taxonomy\Entity\Vocabulary;
+use Drupal\taxonomy\Entity\Term;
+
+/**
+ * Provides common helper methods for Taxonomy module tests.
+ */
+trait TaxonomyTestTrait {
+
+ /**
+ * Returns a new vocabulary with random properties.
+ */
+ public function createVocabulary() {
+ // Create a vocabulary.
+ $vocabulary = Vocabulary::create([
+ 'name' => $this->randomMachineName(),
+ 'description' => $this->randomMachineName(),
+ 'vid' => Unicode::strtolower($this->randomMachineName()),
+ 'langcode' => LanguageInterface::LANGCODE_NOT_SPECIFIED,
+ 'weight' => mt_rand(0, 10),
+ ]);
+ $vocabulary->save();
+ return $vocabulary;
+ }
+
+ /**
+ * Returns a new term with random properties in vocabulary $vid.
+ *
+ * @param \Drupal\taxonomy\Entity\Vocabulary $vocabulary
+ * The vocabulary object.
+ * @param array $values
+ * (optional) An array of values to set, keyed by property name. If the
+ * entity type has bundles, the bundle key has to be specified.
+ *
+ * @return \Drupal\taxonomy\Entity\Term
+ * The new taxonomy term object.
+ */
+ public function createTerm(Vocabulary $vocabulary, $values = []) {
+ $filter_formats = filter_formats();
+ $format = array_pop($filter_formats);
+ $term = Term::create($values + [
+ 'name' => $this->randomMachineName(),
+ 'description' => [
+ 'value' => $this->randomMachineName(),
+ // Use the first available text format.
+ 'format' => $format->id(),
+ ],
+ 'vid' => $vocabulary->id(),
+ 'langcode' => LanguageInterface::LANGCODE_NOT_SPECIFIED,
+ ]);
+ $term->save();
+ return $term;
+ }
+
+}
diff --git a/core/modules/taxonomy/tests/src/Functional/TaxonomyTranslationTestTrait.php b/core/modules/taxonomy/tests/src/Functional/TaxonomyTranslationTestTrait.php
new file mode 100644
index 0000000..fc3cea7
--- /dev/null
+++ b/core/modules/taxonomy/tests/src/Functional/TaxonomyTranslationTestTrait.php
@@ -0,0 +1,105 @@
+<?php
+
+namespace Drupal\Tests\taxonomy\Functional;
+
+use Drupal\Core\Field\FieldStorageDefinitionInterface;
+use Drupal\field\Tests\EntityReference\EntityReferenceTestTrait;
+use Drupal\field\Entity\FieldStorageConfig;
+use Drupal\language\Entity\ConfigurableLanguage;
+
+/**
+ * Provides common testing base for translated taxonomy terms.
+ */
+trait TaxonomyTranslationTestTrait {
+
+ use EntityReferenceTestTrait;
+
+ /**
+ * The vocabulary.
+ *
+ * @var \Drupal\taxonomy\Entity\Vocabulary;
+ */
+ protected $vocabulary;
+
+ /**
+ * The field name for our taxonomy term field.
+ *
+ * @var string
+ */
+ protected $termFieldName = 'field_tag';
+
+ /**
+ * The langcode of the source language.
+ *
+ * @var string
+ */
+ protected $baseLangcode = 'en';
+
+ /**
+ * Target langcode for translation.
+ *
+ * @var string
+ */
+ protected $translateToLangcode = 'hu';
+
+ /**
+ * The node to check the translated value on.
+ *
+ * @var \Drupal\node\Entity\Node
+ */
+ protected $node;
+
+ /**
+ * Adds additional languages.
+ */
+ protected function setupLanguages() {
+ ConfigurableLanguage::createFromLangcode($this->translateToLangcode)->save();
+ $this->rebuildContainer();
+ }
+
+ /**
+ * Enables translations where it needed.
+ */
+ protected function enableTranslation() {
+ // Enable translation for the current entity type and ensure the change is
+ // picked up.
+ \Drupal::service('content_translation.manager')->setEnabled('node', 'article', TRUE);
+ \Drupal::service('content_translation.manager')->setEnabled('taxonomy_term', $this->vocabulary->id(), TRUE);
+ drupal_static_reset();
+ \Drupal::entityManager()->clearCachedDefinitions();
+ \Drupal::service('router.builder')->rebuild();
+ \Drupal::service('entity.definition_update_manager')->applyUpdates();
+ }
+
+ /**
+ * Adds term reference field for the article content type.
+ *
+ * @param bool $translatable
+ * (optional) If TRUE, create a translatable term reference field. Defaults
+ * to FALSE.
+ */
+ protected function setUpTermReferenceField() {
+ $handler_settings = [
+ 'target_bundles' => [
+ $this->vocabulary->id() => $this->vocabulary->id(),
+ ],
+ 'auto_create' => TRUE,
+ ];
+ $this->createEntityReferenceField('node', 'article', $this->termFieldName, NULL, 'taxonomy_term', 'default', $handler_settings, FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED);
+ $field_storage = FieldStorageConfig::loadByName('node', $this->termFieldName);
+ $field_storage->setTranslatable(FALSE);
+ $field_storage->save();
+
+ entity_get_form_display('node', 'article', 'default')
+ ->setComponent($this->termFieldName, [
+ 'type' => 'entity_reference_autocomplete_tags',
+ ])
+ ->save();
+ entity_get_display('node', 'article', 'default')
+ ->setComponent($this->termFieldName, [
+ 'type' => 'entity_reference_label',
+ ])
+ ->save();
+ }
+
+}
diff --git a/core/modules/taxonomy/tests/src/Functional/TermTranslationFieldViewTest.php b/core/modules/taxonomy/tests/src/Functional/TermTranslationFieldViewTest.php
index c5df74d..dfd5e51 100644
--- a/core/modules/taxonomy/tests/src/Functional/TermTranslationFieldViewTest.php
+++ b/core/modules/taxonomy/tests/src/Functional/TermTranslationFieldViewTest.php
@@ -3,7 +3,6 @@
namespace Drupal\Tests\taxonomy\Functional;
use Drupal\node\Entity\Node;
-use Drupal\taxonomy\Tests\TaxonomyTranslationTestTrait;
/**
* Tests the translation of taxonomy terms field on nodes.
diff --git a/core/modules/taxonomy/src/Tests/TermTranslationUITest.php b/core/modules/taxonomy/tests/src/Functional/TermTranslationUITest.php
index 43edc15..0d24b69 100644
--- a/core/modules/taxonomy/src/Tests/TermTranslationUITest.php
+++ b/core/modules/taxonomy/tests/src/Functional/TermTranslationUITest.php
@@ -1,8 +1,8 @@
<?php
-namespace Drupal\taxonomy\Tests;
+namespace Drupal\Tests\taxonomy\Functional;
-use Drupal\content_translation\Tests\ContentTranslationUITestBase;
+use Drupal\Tests\content_translation\Functional\ContentTranslationUITestBase;
use Drupal\Core\Language\LanguageInterface;
use Drupal\taxonomy\Entity\Vocabulary;
diff --git a/core/modules/taxonomy/src/Tests/ThemeTest.php b/core/modules/taxonomy/tests/src/Functional/ThemeTest.php
index 8995c80..43ed72c 100644
--- a/core/modules/taxonomy/src/Tests/ThemeTest.php
+++ b/core/modules/taxonomy/tests/src/Functional/ThemeTest.php
@@ -1,6 +1,6 @@
<?php
-namespace Drupal\taxonomy\Tests;
+namespace Drupal\Tests\taxonomy\Functional;
/**
* Verifies that various taxonomy pages use the expected theme.
diff --git a/core/modules/taxonomy/src/Tests/Views/ArgumentValidatorTermTest.php b/core/modules/taxonomy/tests/src/Functional/Views/ArgumentValidatorTermTest.php
index 1630e0f..a7ac9b8 100644
--- a/core/modules/taxonomy/src/Tests/Views/ArgumentValidatorTermTest.php
+++ b/core/modules/taxonomy/tests/src/Functional/Views/ArgumentValidatorTermTest.php
@@ -1,6 +1,6 @@
<?php
-namespace Drupal\taxonomy\Tests\Views;
+namespace Drupal\Tests\taxonomy\Functional\Views;
use Drupal\views\Views;
@@ -47,8 +47,8 @@ class ArgumentValidatorTermTest extends TaxonomyTestBase {
*/
public static $testViews = ['test_argument_validator_term'];
- protected function setUp() {
- parent::setUp();
+ protected function setUp($import_test_views = TRUE) {
+ parent::setUp($import_test_views);
// Add three terms to the 'tags' vocabulary.
for ($i = 0; $i < 3; $i++) {
diff --git a/core/modules/taxonomy/src/Tests/Views/RelationshipNodeTermDataTest.php b/core/modules/taxonomy/tests/src/Functional/Views/RelationshipNodeTermDataTest.php
index 4f0cb48..3469870 100644
--- a/core/modules/taxonomy/src/Tests/Views/RelationshipNodeTermDataTest.php
+++ b/core/modules/taxonomy/tests/src/Functional/Views/RelationshipNodeTermDataTest.php
@@ -1,6 +1,6 @@
<?php
-namespace Drupal\taxonomy\Tests\Views;
+namespace Drupal\Tests\taxonomy\Functional\Views;
use Drupal\views\Views;
diff --git a/core/modules/taxonomy/src/Tests/Views/RelationshipRepresentativeNodeTest.php b/core/modules/taxonomy/tests/src/Functional/Views/RelationshipRepresentativeNodeTest.php
index aa85c9e..d1de82e 100644
--- a/core/modules/taxonomy/src/Tests/Views/RelationshipRepresentativeNodeTest.php
+++ b/core/modules/taxonomy/tests/src/Functional/Views/RelationshipRepresentativeNodeTest.php
@@ -1,6 +1,6 @@
<?php
-namespace Drupal\taxonomy\Tests\Views;
+namespace Drupal\Tests\taxonomy\Functional\Views;
use Drupal\views\Views;
diff --git a/core/modules/taxonomy/src/Tests/Views/TaxonomyDefaultArgumentTest.php b/core/modules/taxonomy/tests/src/Functional/Views/TaxonomyDefaultArgumentTest.php
index 8b263b4..82646c0 100644
--- a/core/modules/taxonomy/src/Tests/Views/TaxonomyDefaultArgumentTest.php
+++ b/core/modules/taxonomy/tests/src/Functional/Views/TaxonomyDefaultArgumentTest.php
@@ -1,6 +1,6 @@
<?php
-namespace Drupal\taxonomy\Tests\Views;
+namespace Drupal\Tests\taxonomy\Functional\Views;
use Drupal\field\Entity\FieldConfig;
use Drupal\views\Views;
diff --git a/core/modules/taxonomy/src/Tests/Views/TaxonomyFieldAllTermsTest.php b/core/modules/taxonomy/tests/src/Functional/Views/TaxonomyFieldAllTermsTest.php
index a75f16a..ad1d67d 100644
--- a/core/modules/taxonomy/src/Tests/Views/TaxonomyFieldAllTermsTest.php
+++ b/core/modules/taxonomy/tests/src/Functional/Views/TaxonomyFieldAllTermsTest.php
@@ -1,6 +1,6 @@
<?php
-namespace Drupal\taxonomy\Tests\Views;
+namespace Drupal\Tests\taxonomy\Functional\Views;
use Drupal\views\Views;
use Drupal\taxonomy\Entity\Vocabulary;
@@ -30,14 +30,14 @@ class TaxonomyFieldAllTermsTest extends TaxonomyTestBase {
$actual = $this->xpath('//a[@href="' . $this->term1->url() . '"]');
$this->assertEqual(count($actual), 2, 'Correct number of taxonomy term1 links');
- $this->assertEqual($actual[0]->__toString(), $this->term1->label());
- $this->assertEqual($actual[1]->__toString(), $this->term1->label());
+ $this->assertEqual($actual[0]->getText(), $this->term1->label());
+ $this->assertEqual($actual[1]->getText(), $this->term1->label());
$this->assertEscaped($this->term1->label());
$actual = $this->xpath('//a[@href="' . $this->term2->url() . '"]');
$this->assertEqual(count($actual), 2, 'Correct number of taxonomy term2 links');
- $this->assertEqual($actual[0]->__toString(), $this->term2->label());
- $this->assertEqual($actual[1]->__toString(), $this->term2->label());
+ $this->assertEqual($actual[0]->getText(), $this->term2->label());
+ $this->assertEqual($actual[1]->getText(), $this->term2->label());
}
/**
diff --git a/core/modules/taxonomy/src/Tests/Views/TaxonomyFieldFilterTest.php b/core/modules/taxonomy/tests/src/Functional/Views/TaxonomyFieldFilterTest.php
index 86f67ff..1b8bbca 100644
--- a/core/modules/taxonomy/src/Tests/Views/TaxonomyFieldFilterTest.php
+++ b/core/modules/taxonomy/tests/src/Functional/Views/TaxonomyFieldFilterTest.php
@@ -1,11 +1,11 @@
<?php
-namespace Drupal\taxonomy\Tests\Views;
+namespace Drupal\Tests\taxonomy\Functional\Views;
use Drupal\Core\Language\LanguageInterface;
use Drupal\field\Entity\FieldConfig;
use Drupal\language\Entity\ConfigurableLanguage;
-use Drupal\views\Tests\ViewTestBase;
+use Drupal\Tests\views\Functional\ViewTestBase;
use Drupal\views\Tests\ViewTestData;
use Drupal\views\Views;
use Drupal\field\Entity\FieldStorageConfig;
@@ -45,8 +45,8 @@ class TaxonomyFieldFilterTest extends ViewTestBase {
*/
public $termNames = [];
- public function setUp() {
- parent::setUp();
+ public function setUp($import_test_views = TRUE) {
+ parent::setUp($import_test_views);
// Add two new languages.
ConfigurableLanguage::createFromLangcode('fr')->save();
diff --git a/core/modules/taxonomy/src/Tests/Views/TaxonomyFieldTidTest.php b/core/modules/taxonomy/tests/src/Functional/Views/TaxonomyFieldTidTest.php
index b068f08..0a44d4c 100644
--- a/core/modules/taxonomy/src/Tests/Views/TaxonomyFieldTidTest.php
+++ b/core/modules/taxonomy/tests/src/Functional/Views/TaxonomyFieldTidTest.php
@@ -1,6 +1,6 @@
<?php
-namespace Drupal\taxonomy\Tests\Views;
+namespace Drupal\Tests\taxonomy\Functional\Views;
use Drupal\Core\Render\RenderContext;
use Drupal\views\Views;
diff --git a/core/modules/taxonomy/src/Tests/Views/TaxonomyIndexTidFilterTest.php b/core/modules/taxonomy/tests/src/Functional/Views/TaxonomyIndexTidFilterTest.php
index aa5054f..6fd1eba 100644
--- a/core/modules/taxonomy/src/Tests/Views/TaxonomyIndexTidFilterTest.php
+++ b/core/modules/taxonomy/tests/src/Functional/Views/TaxonomyIndexTidFilterTest.php
@@ -1,6 +1,6 @@
<?php
-namespace Drupal\taxonomy\Tests\Views;
+namespace Drupal\Tests\taxonomy\Functional\Views;
use Drupal\taxonomy\Entity\Term;
use Drupal\taxonomy\Entity\Vocabulary;
@@ -34,7 +34,7 @@ class TaxonomyIndexTidFilterTest extends TaxonomyTestBase {
/**
* {@inheritdoc}
*/
- protected function setUp() {
+ protected function setUp($import_test_views = TRUE) {
parent::setUp(FALSE);
// Setup vocabulary and terms so the initial import is valid.
diff --git a/core/modules/taxonomy/src/Tests/Views/TaxonomyRelationshipTest.php b/core/modules/taxonomy/tests/src/Functional/Views/TaxonomyRelationshipTest.php
index 7024e64..03be3e1 100644
--- a/core/modules/taxonomy/src/Tests/Views/TaxonomyRelationshipTest.php
+++ b/core/modules/taxonomy/tests/src/Functional/Views/TaxonomyRelationshipTest.php
@@ -1,6 +1,6 @@
<?php
-namespace Drupal\taxonomy\Tests\Views;
+namespace Drupal\Tests\taxonomy\Functional\Views;
use Drupal\node\NodeInterface;
use Drupal\taxonomy\TermInterface;
@@ -30,8 +30,8 @@ class TaxonomyRelationshipTest extends TaxonomyTestBase {
/**
* {@inheritdoc}
*/
- protected function setUp() {
- parent::setUp();
+ protected function setUp($import_test_views = TRUE) {
+ parent::setUp($import_test_views);
// Make term2 parent of term1.
$this->term1->set('parent', $this->term2->id());
diff --git a/core/modules/taxonomy/src/Tests/Views/TaxonomyTermArgumentDepthTest.php b/core/modules/taxonomy/tests/src/Functional/Views/TaxonomyTermArgumentDepthTest.php
index 311118d..3505784 100644
--- a/core/modules/taxonomy/src/Tests/Views/TaxonomyTermArgumentDepthTest.php
+++ b/core/modules/taxonomy/tests/src/Functional/Views/TaxonomyTermArgumentDepthTest.php
@@ -1,6 +1,6 @@
<?php
-namespace Drupal\taxonomy\Tests\Views;
+namespace Drupal\Tests\taxonomy\Functional\Views;
/**
* Tests the taxonomy term with depth argument.
@@ -32,8 +32,8 @@ class TaxonomyTermArgumentDepthTest extends TaxonomyTestBase {
/**
* {@inheritdoc}
*/
- protected function setUp() {
- parent::setUp();
+ protected function setUp($import_test_views = TRUE) {
+ parent::setUp($import_test_views);
// Create a term with markup in the label.
$first = $this->createTerm(['name' => '<em>First</em>']);
diff --git a/core/modules/taxonomy/src/Tests/Views/TaxonomyTermFilterDepthTest.php b/core/modules/taxonomy/tests/src/Functional/Views/TaxonomyTermFilterDepthTest.php
index 10ccad2..4d7a4fd 100644
--- a/core/modules/taxonomy/src/Tests/Views/TaxonomyTermFilterDepthTest.php
+++ b/core/modules/taxonomy/tests/src/Functional/Views/TaxonomyTermFilterDepthTest.php
@@ -1,6 +1,6 @@
<?php
-namespace Drupal\taxonomy\Tests\Views;
+namespace Drupal\Tests\taxonomy\Functional\Views;
use Drupal\views\Views;
@@ -34,8 +34,8 @@ class TaxonomyTermFilterDepthTest extends TaxonomyTestBase {
/**
* {@inheritdoc}
*/
- protected function setUp() {
- parent::setUp();
+ protected function setUp($import_test_views = TRUE) {
+ parent::setUp($import_test_views);
// Create a hierarchy 3 deep. Note the parent setup function creates two
// top-level terms w/o children.
diff --git a/core/modules/taxonomy/src/Tests/Views/TaxonomyTermViewTest.php b/core/modules/taxonomy/tests/src/Functional/Views/TaxonomyTermViewTest.php
index bfd65cf..15f4723 100644
--- a/core/modules/taxonomy/src/Tests/Views/TaxonomyTermViewTest.php
+++ b/core/modules/taxonomy/tests/src/Functional/Views/TaxonomyTermViewTest.php
@@ -1,6 +1,6 @@
<?php
-namespace Drupal\taxonomy\Tests\Views;
+namespace Drupal\Tests\taxonomy\Functional\Views;
use Drupal\Component\Utility\Unicode;
use Drupal\Core\Field\FieldStorageDefinitionInterface;
@@ -40,8 +40,8 @@ class TaxonomyTermViewTest extends TaxonomyTestBase {
/**
* {@inheritdoc}
*/
- protected function setUp() {
- parent::setUp();
+ protected function setUp($import_test_views = TRUE) {
+ parent::setUp($import_test_views);
// Create an administrative user.
$this->adminUser = $this->drupalCreateUser(['administer taxonomy', 'bypass node access']);
diff --git a/core/modules/taxonomy/src/Tests/Views/TaxonomyTestBase.php b/core/modules/taxonomy/tests/src/Functional/Views/TaxonomyTestBase.php
index 6ff5514..a2d8ec1 100644
--- a/core/modules/taxonomy/src/Tests/Views/TaxonomyTestBase.php
+++ b/core/modules/taxonomy/tests/src/Functional/Views/TaxonomyTestBase.php
@@ -1,11 +1,11 @@
<?php
-namespace Drupal\taxonomy\Tests\Views;
+namespace Drupal\Tests\taxonomy\Functional\Views;
use Drupal\Core\Field\FieldStorageDefinitionInterface;
use Drupal\Core\Language\LanguageInterface;
use Drupal\field\Tests\EntityReference\EntityReferenceTestTrait;
-use Drupal\views\Tests\ViewTestBase;
+use Drupal\Tests\views\Functional\ViewTestBase;
use Drupal\views\Tests\ViewTestData;
use Drupal\taxonomy\Entity\Vocabulary;
use Drupal\taxonomy\Entity\Term;
diff --git a/core/modules/taxonomy/src/Tests/Views/TaxonomyVocabularyArgumentTest.php b/core/modules/taxonomy/tests/src/Functional/Views/TaxonomyVocabularyArgumentTest.php
index 532335f..8b1d58c 100644
--- a/core/modules/taxonomy/src/Tests/Views/TaxonomyVocabularyArgumentTest.php
+++ b/core/modules/taxonomy/tests/src/Functional/Views/TaxonomyVocabularyArgumentTest.php
@@ -1,6 +1,6 @@
<?php
-namespace Drupal\taxonomy\Tests\Views;
+namespace Drupal\Tests\taxonomy\Functional\Views;
use Drupal\taxonomy\Entity\Vocabulary;
@@ -36,8 +36,8 @@ class TaxonomyVocabularyArgumentTest extends TaxonomyTestBase {
/**
* {@inheritdoc}
*/
- protected function setUp() {
- parent::setUp();
+ protected function setUp($import_test_views = TRUE) {
+ parent::setUp($import_test_views);
// Add default vocabulary to list of vocabularies.
$this->vocabularies[] = $this->vocabulary;
diff --git a/core/modules/taxonomy/src/Tests/Views/TermNameFieldTest.php b/core/modules/taxonomy/tests/src/Functional/Views/TermNameFieldTest.php
index 98d1ab4..6fbe0c0 100644
--- a/core/modules/taxonomy/src/Tests/Views/TermNameFieldTest.php
+++ b/core/modules/taxonomy/tests/src/Functional/Views/TermNameFieldTest.php
@@ -1,6 +1,6 @@
<?php
-namespace Drupal\taxonomy\Tests\Views;
+namespace Drupal\Tests\taxonomy\Functional\Views;
use Drupal\views\Views;
diff --git a/core/modules/taxonomy/src/Tests/VocabularyUiTest.php b/core/modules/taxonomy/tests/src/Functional/VocabularyUiTest.php
index 89c7a67..80ea2d7 100644
--- a/core/modules/taxonomy/src/Tests/VocabularyUiTest.php
+++ b/core/modules/taxonomy/tests/src/Functional/VocabularyUiTest.php
@@ -1,6 +1,6 @@
<?php
-namespace Drupal\taxonomy\Tests;
+namespace Drupal\Tests\taxonomy\Functional;
use Drupal\Component\Utility\Unicode;
use Drupal\Core\Url;
@@ -78,7 +78,6 @@ class VocabularyUiTest extends TaxonomyTestBase {
$site_name = $this->config('system.site')->get('name');
$this->assertTitle(t('Don\'t Panic | @site-name', ['@site-name' => $site_name]), 'The page title contains the escaped character.');
- $this->assertNoTitle(t('Don&#039;t Panic | @site-name', ['@site-name' => $site_name]), 'The page title does not contain an encoded character.');
}
/**
diff --git a/core/modules/taxonomy/tests/src/Kernel/TermKernelTest.php b/core/modules/taxonomy/tests/src/Kernel/TermKernelTest.php
index 0d70d84..832e511 100644
--- a/core/modules/taxonomy/tests/src/Kernel/TermKernelTest.php
+++ b/core/modules/taxonomy/tests/src/Kernel/TermKernelTest.php
@@ -4,7 +4,7 @@ namespace Drupal\Tests\taxonomy\Kernel;
use Drupal\taxonomy\Entity\Term;
use Drupal\KernelTests\KernelTestBase;
-use Drupal\taxonomy\Tests\TaxonomyTestTrait;
+use Drupal\Tests\taxonomy\Functional\TaxonomyTestTrait;
/**
* Kernel tests for taxonomy term functions.
diff --git a/core/modules/views/tests/src/Functional/TaxonomyGlossaryTest.php b/core/modules/views/tests/src/Functional/TaxonomyGlossaryTest.php
index c34e6f2..fbf5f41 100644
--- a/core/modules/views/tests/src/Functional/TaxonomyGlossaryTest.php
+++ b/core/modules/views/tests/src/Functional/TaxonomyGlossaryTest.php
@@ -2,7 +2,7 @@
namespace Drupal\Tests\views\Functional;
-use Drupal\taxonomy\Tests\TaxonomyTestTrait;
+use Drupal\Tests\taxonomy\Functional\TaxonomyTestTrait;
/**
* Tests glossary functionality of taxonomy views.