RelationshipRepresentativeNodeTest.php in Drupal 9
File
core/modules/taxonomy/tests/src/Functional/Views/RelationshipRepresentativeNodeTest.php
View source
<?php
namespace Drupal\Tests\taxonomy\Functional\Views;
use Drupal\views\Views;
class RelationshipRepresentativeNodeTest extends TaxonomyTestBase {
public static $testViews = [
'test_groupwise_term',
];
protected $defaultTheme = 'stark';
public function testRelationship() {
$view = Views::getView('test_groupwise_term');
$this
->executeView($view);
$map = [
'node_field_data_taxonomy_term_field_data_nid' => 'nid',
'tid' => 'tid',
];
$expected_result = [
[
'nid' => $this->nodes[1]
->id(),
'tid' => $this->term2
->id(),
],
[
'nid' => $this->nodes[1]
->id(),
'tid' => $this->term1
->id(),
],
];
$this
->assertIdenticalResultset($view, $expected_result, $map);
}
}