Test workspace entities for XML requests with cookie authentication.
@group workspaces
Hierarchy
- class \Drupal\Tests\rest\Functional\ResourceTestBase extends \Drupal\Tests\BrowserTestBase
- class \Drupal\Tests\rest\Functional\EntityResource\EntityResourceTestBase
- class \Drupal\Tests\workspaces\Functional\Rest\WorkspaceResourceTestBase
- class \Drupal\Tests\workspaces\Functional\Rest\WorkspaceXmlBasicAuthTest uses BasicAuthResourceTestTrait, XmlEntityNormalizationQuirksTrait
- class \Drupal\Tests\workspaces\Functional\Rest\WorkspaceResourceTestBase
- class \Drupal\Tests\rest\Functional\EntityResource\EntityResourceTestBase
Expanded class hierarchy of WorkspaceXmlBasicAuthTest
File
- core/
modules/ workspaces/ tests/ src/ Functional/ Rest/ WorkspaceXmlBasicAuthTest.php, line 15
Namespace
Drupal\Tests\workspaces\Functional\RestView source
class WorkspaceXmlBasicAuthTest extends WorkspaceResourceTestBase {
use BasicAuthResourceTestTrait;
use XmlEntityNormalizationQuirksTrait;
/**
* {@inheritdoc}
*/
protected static $modules = [
'basic_auth',
];
/**
* {@inheritdoc}
*/
protected $defaultTheme = 'stark';
/**
* {@inheritdoc}
*/
protected static $format = 'xml';
/**
* {@inheritdoc}
*/
protected static $mimeType = 'text/xml; charset=UTF-8';
/**
* {@inheritdoc}
*/
protected static $auth = 'basic_auth';
/**
* {@inheritdoc}
*/
public function testPatchPath() {
// Deserialization of the XML format is not supported.
$this
->markTestSkipped();
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
BasicAuthResourceTestTrait:: |
protected | function | 1 | |
BasicAuthResourceTestTrait:: |
protected | function | 1 | |
BasicAuthResourceTestTrait:: |
protected | function | ||
EntityResourceTestBase:: |
protected | property | Another entity of the same type used for testing. | |
EntityResourceTestBase:: |
protected | property | The main entity used for testing. | 42 |
EntityResourceTestBase:: |
protected | property | The entity storage. | |
EntityResourceTestBase:: |
protected static | property | Optionally specify which field is the 'label' field. | 2 |
EntityResourceTestBase:: |
protected | function | Asserts a 406 response… or in some cases a 403 response, because weirdness. | |
EntityResourceTestBase:: |
protected | function | Recursively asserts that the expected items are set in the tested entity. | |
EntityResourceTestBase:: |
protected | function |
Asserts normalization-specific edge cases. Overrides ResourceTestBase:: |
|
EntityResourceTestBase:: |
protected | function | Asserts structure of $patchProtectedFieldNames. | |
EntityResourceTestBase:: |
protected | function | Asserts that a resource is unavailable: 404, 406 if it has canonical route. | |
EntityResourceTestBase:: |
protected | function | Asserts that the stored entity matches the sent normalization. | |
EntityResourceTestBase:: |
protected static | function | Transforms a normalization: casts all non-string types to strings. | |
EntityResourceTestBase:: |
protected | function | Gets an entity resource's POST URL. | |
EntityResourceTestBase:: |
protected | function | Gets an entity resource's GET/PATCH/DELETE URL. | |
EntityResourceTestBase:: |
protected | function | The expected cache contexts for the GET/HEAD response of the test entity. | 17 |
EntityResourceTestBase:: |
protected | function | The expected cache tags for the GET/HEAD response of the test entity. | 4 |
EntityResourceTestBase:: |
protected | function |
Returns the expected cacheability of an unauthorized access response. Overrides ResourceTestBase:: |
1 |
EntityResourceTestBase:: |
protected | function | The cacheability of unauthorized 'view' entity access. | 6 |
EntityResourceTestBase:: |
protected static | function | Clones the given entity and modifies all PATCH-protected fields. | |
EntityResourceTestBase:: |
protected | function | Makes the given entity normalization invalid. | |
EntityResourceTestBase:: |
protected | function | Provides an entity resource. | |
EntityResourceTestBase:: |
protected | function |
Overrides ResourceTestBase:: |
2 |
EntityResourceTestBase:: |
public | function | Tests a DELETE request for an entity, plus edge cases to ensure good DX. | 1 |
EntityResourceTestBase:: |
public | function | Tests a GET request for an entity, plus edge cases to ensure good DX. | 4 |
ResourceTestBase:: |
protected | property | The account to use for authentication, if any. | |
ResourceTestBase:: |
protected static | property | The REST Resource Config entity ID under test (i.e. a resource type). | 4 |
ResourceTestBase:: |
protected | property | The REST resource config entity storage. | |
ResourceTestBase:: |
protected | property | The serializer service. | |
ResourceTestBase:: |
protected | function | Asserts that a resource error response has the given message. | |
ResourceTestBase:: |
protected | function | Asserts that a resource response has the given status code and body. | |
ResourceTestBase:: |
protected | function | Adds the Xdebug cookie to the request options. | |
ResourceTestBase:: |
protected | function | Grants permissions to the anonymous role. | |
ResourceTestBase:: |
protected | function | Grants permissions to the authenticated role. | |
ResourceTestBase:: |
protected | function | Grants permissions to the tested role: anonymous or authenticated. | |
ResourceTestBase:: |
protected | function | Initializes authentication. | |
ResourceTestBase:: |
protected | function | Provisions the REST resource under test. | |
ResourceTestBase:: |
protected static | function | Recursively sorts an array by key. | |
ResourceTestBase:: |
protected | function | Refreshes the state of the tester to be in sync with the testee. | |
ResourceTestBase:: |
protected | function | Performs a HTTP request. Wraps the Guzzle HTTP client. | 1 |
WorkspaceResourceTestBase:: |
protected static | property |
The tested entity type. Overrides EntityResourceTestBase:: |
|
WorkspaceResourceTestBase:: |
protected static | property |
The entity ID for the first created entity in testPost(). Overrides EntityResourceTestBase:: |
|
WorkspaceResourceTestBase:: |
protected static | property |
The fields that are protected against modification during PATCH requests. Overrides EntityResourceTestBase:: |
|
WorkspaceResourceTestBase:: |
protected static | property |
The entity ID for the second created entity in testPost(). Overrides EntityResourceTestBase:: |
|
WorkspaceResourceTestBase:: |
protected static | property |
A list of fields that need a unique value. Overrides EntityResourceTestBase:: |
|
WorkspaceResourceTestBase:: |
protected | function |
Creates another entity to be tested. Overrides EntityResourceTestBase:: |
|
WorkspaceResourceTestBase:: |
protected | function |
Creates the entity to be tested. Overrides EntityResourceTestBase:: |
|
WorkspaceResourceTestBase:: |
protected | function |
Return the expected error message. Overrides EntityResourceTestBase:: |
|
WorkspaceResourceTestBase:: |
protected | function |
Gets the normalized POST entity with random values for its unique fields. Overrides EntityResourceTestBase:: |
|
WorkspaceResourceTestBase:: |
protected | function |
Returns the normalized PATCH entity. Overrides EntityResourceTestBase:: |
|
WorkspaceResourceTestBase:: |
protected | function |
Returns the normalized POST entity. Overrides EntityResourceTestBase:: |
|
WorkspaceResourceTestBase:: |
protected | function |
Sets up the necessary authorization. Overrides ResourceTestBase:: |
|
WorkspaceXmlBasicAuthTest:: |
protected static | property |
The authentication mechanism to use in this test. Overrides ResourceTestBase:: |
|
WorkspaceXmlBasicAuthTest:: |
protected | property | ||
WorkspaceXmlBasicAuthTest:: |
protected static | property |
The format to use in this test. Overrides ResourceTestBase:: |
|
WorkspaceXmlBasicAuthTest:: |
protected static | property |
The MIME type that corresponds to $format. Overrides ResourceTestBase:: |
|
WorkspaceXmlBasicAuthTest:: |
protected static | property |
Modules to install. Overrides WorkspaceResourceTestBase:: |
|
WorkspaceXmlBasicAuthTest:: |
public | function | ||
XmlEntityNormalizationQuirksTrait:: |
protected | function | Applies the XML config entity encoding quirks that remain after decoding. | |
XmlEntityNormalizationQuirksTrait:: |
protected | function | Applies the XML entity field encoding quirks that remain after decoding. | |
XmlEntityNormalizationQuirksTrait:: |
protected | function | ||
XmlEntityNormalizationQuirksTrait:: |
public | function | ||
XmlEntityNormalizationQuirksTrait:: |
public | function | ||
XmlNormalizationQuirksTrait:: |
protected | function | Applies the XML encoding quirks that remain after decoding. |