diff --git a/core/modules/forum/src/Tests/ForumTest.php b/core/modules/forum/src/Tests/ForumTest.php index 13e1ef4..0bcc808 100644 --- a/core/modules/forum/src/Tests/ForumTest.php +++ b/core/modules/forum/src/Tests/ForumTest.php @@ -10,6 +10,7 @@ use Drupal\Core\Entity\EntityInterface; use Drupal\Core\Link; use Drupal\simpletest\WebTestBase; +use Drupal\taxonomy\Entity\Vocabulary; /** * Create, view, edit, delete, and change forum entries and verify its @@ -196,7 +197,7 @@ function testForum() { // Test the root forum page title change. $this->drupalGet('forum'); $this->assertTitle(t('Forums | Drupal')); - $vocabulary = entity_load('taxonomy_vocabulary', $this->forum->vid->value); + $vocabulary = Vocabulary::load($this->forum->getVocabularyId()); $vocabulary->set('name', 'Discussions'); $vocabulary->save(); $this->drupalGet('forum'); @@ -558,7 +559,7 @@ private function verifyForums(EntityInterface $node, $admin, $response = 200) { $breadcrumb_build = array( Link::createFromRoute(t('Home'), ''), Link::createFromRoute(t('Forums'), 'forum.index'), - Link::createFromRoute($this->forumContainer->label(), 'forum.page', array('taxonomy_term' => $$this->forumContainer->id())), + Link::createFromRoute($this->forumContainer->label(), 'forum.page', array('taxonomy_term' => $this->forumContainer->id())), Link::createFromRoute($this->forum->label(), 'forum.page', array('taxonomy_term' => $this->forum->id())), ); $breadcrumb = array( diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateTaxonomyTermTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateTaxonomyTermTest.php index d2eb969..cc75fab 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateTaxonomyTermTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateTaxonomyTermTest.php @@ -89,7 +89,6 @@ public function testTaxonomyTerms() { /** @var Term $term */ $term = $terms[$tid]; $this->assertIdentical($term->name->value, "term {$tid} of vocabulary {$values['source_vid']}"); - $this->assertIdentical($term->description->value, "description of term {$tid} of vocabulary {$values['source_vid']}"); $this->assertEqual($term->vid->target_id, $values['vid']); $this->assertEqual($term->weight->value, $values['weight']); if ($values['parent'] === array(0)) { diff --git a/core/modules/path/src/Tests/PathTaxonomyTermTest.php b/core/modules/path/src/Tests/PathTaxonomyTermTest.php index e5a6ba4..3706f6a 100644 --- a/core/modules/path/src/Tests/PathTaxonomyTermTest.php +++ b/core/modules/path/src/Tests/PathTaxonomyTermTest.php @@ -51,7 +51,7 @@ function testTermAlias() { // Confirm that the alias works. $this->drupalGet($edit['path[0][alias]']); - $this->assertText($edit['name[0][alias]'], 'Term can be accessed on URL alias.'); + $this->assertText($edit['name[0][value]'], 'Term can be accessed on URL alias.'); // Confirm the 'canonical' and 'shortlink' URLs. $elements = $this->xpath("//link[contains(@rel, 'canonical') and contains(@href, '" . $edit['path[0][alias]'] . "')]"); @@ -66,11 +66,11 @@ function testTermAlias() { // Confirm that the changed alias works. $this->drupalGet($edit2['path[0][alias]']); - $this->assertText($edit['name[0][alias]'], 'Term can be accessed on changed URL alias.'); + $this->assertText($edit['name[0][value]'], 'Term can be accessed on changed URL alias.'); // Confirm that the old alias no longer works. $this->drupalGet($edit['path[0][alias]']); - $this->assertNoText($edit['name[0][alias]'], 'Old URL alias has been removed after altering.'); + $this->assertNoText($edit['name[0][value]'], 'Old URL alias has been removed after altering.'); $this->assertResponse(404, 'Old URL alias returns 404.'); // Remove the term's URL alias. @@ -80,7 +80,7 @@ function testTermAlias() { // Confirm that the alias no longer works. $this->drupalGet($edit2['path[0][alias]']); - $this->assertNoText($edit['name[0][alias]'], 'Old URL alias has been removed after altering.'); + $this->assertNoText($edit['name[0][value]'], 'Old URL alias has been removed after altering.'); $this->assertResponse(404, 'Old URL alias returns 404.'); } } diff --git a/core/modules/taxonomy/src/Tests/Views/TaxonomyFieldFilterTest.php b/core/modules/taxonomy/src/Tests/Views/TaxonomyFieldFilterTest.php index a8c7633..6dc71d5 100644 --- a/core/modules/taxonomy/src/Tests/Views/TaxonomyFieldFilterTest.php +++ b/core/modules/taxonomy/src/Tests/Views/TaxonomyFieldFilterTest.php @@ -76,13 +76,12 @@ 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->term_names['en'], 'langcode' => 'en', 'field_foo' => $this->term_names['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->save(); } - $taxonomy->save(); Views::viewsData()->clear(); @@ -98,10 +97,6 @@ public function testFilters() { // Should show just the Spanish translation, once. $this->assertPageCounts('test-name-filter', array('es' => 1, 'fr' => 0, 'en' => 0), 'Comida name filter'); - // Test the description filter page, which filters for description contains - // 'Comida'. Should show just the Spanish translation, once. - $this->assertPageCounts('test-desc-filter', array('es' => 1, 'fr' => 0, 'en' => 0), 'Comida description filter'); - // Test the field filter page, which filters for field_foo contains // 'Comida'. Should show just the Spanish translation, once. $this->assertPageCounts('test-field-filter', array('es' => 1, 'fr' => 0, 'en' => 0), 'Comida field filter'); @@ -110,10 +105,6 @@ public function testFilters() { // 'Paris'. Should show each translation once. $this->assertPageCounts('test-name-paris', array('es' => 1, 'fr' => 1, 'en' => 1), 'Paris name filter'); - // Test the description Paris page, which filters for description contains - // 'Paris'. Should show each translation, once. - $this->assertPageCounts('test-desc-paris', array('es' => 1, 'fr' => 1, 'en' => 1), 'Paris description filter'); - // Test the field Paris filter page, which filters for field_foo contains // 'Paris'. Should show each translation once. $this->assertPageCounts('test-field-paris', array('es' => 1, 'fr' => 1, 'en' => 1), 'Paris field filter'); @@ -150,25 +141,19 @@ protected function assertPageCounts($path, $counts, $message) { * @param array $properties * Array of properties and field values to set. * - * @return \Drupal\taxonomy\Term + * @return \Drupal\taxonomy\Entity\Term * The created taxonomy term. */ protected function createTermWithProperties($properties) { - // Use the first available text format. - $filter_formats = filter_formats(); - $format = array_pop($filter_formats); $properties += array( 'name' => $this->randomMachineName(), - 'description' => $this->randomMachineName(), 'langcode' => LanguageInterface::LANGCODE_NOT_SPECIFIED, 'field_foo' => $this->randomMachineName(), ); $term = entity_create('taxonomy_term', array( 'name' => $properties['name'], - 'description' => $properties['description'], - 'format' => $format->format, 'vid' => $this->vocabulary->id(), 'langcode' => $properties['langcode'], )); diff --git a/core/modules/taxonomy/tests/modules/taxonomy_test_views/test_views/views.view.test_field_filters.yml b/core/modules/taxonomy/tests/modules/taxonomy_test_views/test_views/views.view.test_field_filters.yml index 7b6918b..84994c1 100644 --- a/core/modules/taxonomy/tests/modules/taxonomy_test_views/test_views/views.view.test_field_filters.yml +++ b/core/modules/taxonomy/tests/modules/taxonomy_test_views/test_views/views.view.test_field_filters.yml @@ -1,9 +1,9 @@ -uuid: 2a772a88-315e-4320-973d-61c59393d2c8 langcode: en status: true dependencies: module: - taxonomy + - user id: test_field_filters label: 'Test field filters' module: views @@ -132,118 +132,6 @@ display: arguments: { } field_langcode: '***LANGUAGE_language_content***' field_langcode_add_to_query: null - page_dc: - display_plugin: page - id: page_dc - display_title: 'Description Comida' - position: 3 - display_options: - field_langcode: '***LANGUAGE_language_content***' - field_langcode_add_to_query: null - display_description: '' - path: test-desc-filter - filters: - description__value: - id: description__value - table: taxonomy_term_field_data - field: description__value - relationship: none - group_type: group - admin_label: '' - operator: contains - value: Comida - group: 1 - exposed: false - expose: - operator_id: '' - label: '' - description: '' - use_operator: false - operator: '' - identifier: '' - required: false - remember: false - multiple: false - remember_roles: - authenticated: authenticated - is_grouped: false - group_info: - label: '' - description: '' - identifier: '' - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: { } - plugin_id: string - defaults: - filters: false - filter_groups: false - title: false - filter_groups: - operator: AND - groups: - 1: AND - title: 'Description filter page' - page_dp: - display_plugin: page - id: page_dp - display_title: 'Description Comida' - position: 3 - display_options: - field_langcode: '***LANGUAGE_language_content***' - field_langcode_add_to_query: null - display_description: '' - path: test-desc-paris - filters: - description__value: - id: description__value - table: taxonomy_term_field_data - field: description__value - relationship: none - group_type: group - admin_label: '' - operator: contains - value: Paris - group: 1 - exposed: false - expose: - operator_id: '' - label: '' - description: '' - use_operator: false - operator: '' - identifier: '' - required: false - remember: false - multiple: false - remember_roles: - authenticated: authenticated - is_grouped: false - group_info: - label: '' - description: '' - identifier: '' - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: { } - plugin_id: string - defaults: - filters: false - filter_groups: false - title: false - filter_groups: - operator: AND - groups: - 1: AND - title: 'Description filter page' page_nc: display_plugin: page id: page_nc @@ -308,16 +196,16 @@ display: operator: AND groups: 1: AND - page_fp: + page_fc: display_plugin: page - id: page_fp - display_title: 'Field Paris' + id: page_fc + display_title: 'Field Comida' position: 3 display_options: field_langcode: '***LANGUAGE_language_content***' field_langcode_add_to_query: null display_description: '' - path: test-field-paris + path: test-field-filter filters: field_foo_value: id: field_foo_value @@ -327,7 +215,7 @@ display: group_type: group admin_label: '' operator: contains - value: Paris + value: Comida group: 1 exposed: false expose: @@ -364,16 +252,16 @@ display: groups: 1: AND title: 'Field filter page' - page_fc: + page_fp: display_plugin: page - id: page_fc - display_title: 'Field Comida' + id: page_fp + display_title: 'Field Paris' position: 3 display_options: field_langcode: '***LANGUAGE_language_content***' field_langcode_add_to_query: null display_description: '' - path: test-field-filter + path: test-field-paris filters: field_foo_value: id: field_foo_value @@ -383,7 +271,7 @@ display: group_type: group admin_label: '' operator: contains - value: Comida + value: Paris group: 1 exposed: false expose: