knowledge-8.x-1.x-dev/tests/src/Functional/Rest/KnowledgeJsonAnonTest.php
tests/src/Functional/Rest/KnowledgeJsonAnonTest.php
<?php
namespace Drupal\Tests\knowledge\Functional\Rest;
use Drupal\Tests\rest\Functional\AnonResourceTestTrait;
/**
* Tests json response without authentication.
*
* @group rest
*/
class KnowledgeJsonAnonTest extends KnowledgeResourceTestBase {
use AnonResourceTestTrait;
/**
* {@inheritdoc}
*/
protected static $format = 'json';
/**
* {@inheritdoc}
*/
protected static $mimeType = 'application/json';
/**
* {@inheritdoc}
*/
protected $defaultTheme = 'stark';
/**
* {@inheritdoc}
*
* Anonymous users cannot edit their own knowledge.
*
* @see \Drupal\knowledge\KnowledgeAccessControlHandler::checkAccess
*
* Therefore we grant them the 'administer knowledge' permission for the
* purpose of this test.
*
* @see ::setUpAuthorization
*/
protected static $patchProtectedFieldNames = [
'entity_id' => NULL,
'changed' => NULL,
'thread' => NULL,
'entity_type' => NULL,
'field_name' => NULL,
];
}
