protected function PBTKernelTestBase::createRelationWithoutRestriction in Permissions by Term 8
Same name and namespace in other branches
- 8.2 tests/src/Kernel/PBTKernelTestBase.php \Drupal\Tests\permissions_by_term\Kernel\PBTKernelTestBase::createRelationWithoutRestriction()
2 calls to PBTKernelTestBase::createRelationWithoutRestriction()
- AccessCheckTest::testNoTermRestriction in tests/
src/ Kernel/ AccessCheckTest.php - AccessCheckTest::testSingleTermRestrictionWithNoRestrictedTerms in tests/
src/ Kernel/ AccessCheckTest.php
File
- tests/
src/ Kernel/ PBTKernelTestBase.php, line 253
Class
- PBTKernelTestBase
- Class PBTKernelTestBase
Namespace
Drupal\Tests\permissions_by_term\KernelCode
protected function createRelationWithoutRestriction() {
$term = Term::create([
'name' => 'term1',
'vid' => 'test',
]);
$term
->save();
$tids[] = $term
->id();
$term = Term::create([
'name' => 'term2',
'vid' => 'test',
]);
$term
->save();
$tids[] = $term
->id();
$node = Node::create([
'type' => 'page',
'title' => 'test_title',
'field_tags' => [
[
'target_id' => $tids[0],
],
[
'target_id' => $tids[1],
],
],
]);
$node
->save();
$this
->setNidNoRestriction($node
->id());
}