protected function PbfBaseTest::createSimpleGroup in Permissions by field 8
Create an group with value for Pbf field.
Parameters
string $title: The content title.
string $field_name: The Pbf field name to populate.
int|string $target_id: The target id of Pbf field.
int $grant_public: The grant public value.
int $grant_view: The grant view value.
int $grant_update: The grant update value.
int $grant_delete: The grant delete value.
Return value
\Drupal\node\NodeInterface The node created.
File
- tests/
src/ Functional/ PbfBaseTest.php, line 655
Class
- PbfBaseTest
- General setup and helper function for testing pbf module.
Namespace
Drupal\Tests\pbf\FunctionalCode
protected function createSimpleGroup($title, $field_name = '', $target_id = NULL, $grant_public = 1, $grant_view = 0, $grant_update = 0, $grant_delete = 0) {
$values = array(
'type' => 'group',
'title' => $title,
'body' => [
'value' => 'Content body for ' . $title,
],
);
if ($field_name) {
$values[$field_name] = [
'target_id' => $target_id,
'grant_public' => $grant_public,
'grant_view' => $grant_view,
'grant_update' => $grant_update,
'grant_delete' => $grant_delete,
];
}
return $this
->drupalCreateNode($values);
}