private function ApiTest::getCreator in Lightning API 8.3
Same name and namespace in other branches
- 8.4 tests/src/Functional/ApiTest.php \Drupal\Tests\lightning_api\Functional\ApiTest::getCreator()
Creates an API user with all privileges for a single content type.
Parameters
string $node_type: The content type ID.
Return value
string The API access token.
2 calls to ApiTest::getCreator()
- ApiTest::testAllowed in tests/
src/ Functional/ ApiTest.php - Tests Getting data as anon and authenticated user.
- ApiTest::testForbidden in tests/
src/ Functional/ ApiTest.php - Tests that authenticated and anonymous users cannot get unauthorized data.
File
- tests/
src/ Functional/ ApiTest.php, line 76
Class
- ApiTest
- Tests OAuth and JSON:API authentication and interactions with entities.
Namespace
Drupal\Tests\lightning_api\FunctionalCode
private function getCreator($node_type) {
return $this
->createApiUser([
"access content",
"bypass node access",
"create {$node_type} content",
"create url aliases",
"delete {$node_type} revisions",
"edit any {$node_type} content",
"edit own {$node_type} content",
"revert {$node_type} revisions",
"view all revisions",
"view own unpublished content",
"view {$node_type} revisions",
]);
}