public function testTermWithDepthFilter(): void
{ // Default view has an empty value for this filter, so all nodes should be
// returned.
$expected =
[ ['nid' => 1
],
['nid' => 2
],
['nid' => 3
],
['nid' => 4
],
['nid' => 5
],
];
$this->
executeView($this->view
);
$this->
assertIdenticalResultsetHelper($this->view,
$expected,
['nid' => 'nid'
], 'assertIdentical'
);
// Set filter to search on top-level term, with depth 0.
$expected =
[['nid' => 4
]];
$this->
assertTermWithDepthResult($expected,
$this->terms
[0
]->
id(), 0
);
// Top-level term, depth 1.
$expected =
[['nid' => 4
]];
$this->
assertTermWithDepthResult($expected,
$this->terms
[0
]->
id(), 1
);
// Top-level term, depth 2.
$expected =
[['nid' => 4
],
['nid' => 5
]];