Backup of db before drupal security update
[yaffs-website] / web / core / modules / taxonomy / src / Tests / Views / RelationshipRepresentativeNodeTest.php
1 <?php
2
3 namespace Drupal\taxonomy\Tests\Views;
4
5 use Drupal\views\Views;
6
7 /**
8  * Tests the representative node relationship for terms.
9  *
10  * @group taxonomy
11  */
12 class RelationshipRepresentativeNodeTest extends TaxonomyTestBase {
13
14   /**
15    * Views used by this test.
16    *
17    * @var array
18    */
19   public static $testViews = ['test_groupwise_term'];
20
21   /**
22    * Tests the relationship.
23    */
24   public function testRelationship() {
25     $view = Views::getView('test_groupwise_term');
26     $this->executeView($view);
27     $map = ['node_field_data_taxonomy_term_field_data_nid' => 'nid', 'tid' => 'tid'];
28     $expected_result = [
29       [
30         'nid' => $this->nodes[1]->id(),
31         'tid' => $this->term2->id(),
32       ],
33       [
34         'nid' => $this->nodes[1]->id(),
35         'tid' => $this->term1->id(),
36       ],
37     ];
38     $this->assertIdenticalResultset($view, $expected_result, $map);
39   }
40
41 }