Test workspace entities for XML requests with cookie authentication.

@group workspaces

Hierarchy

Expanded class hierarchy of WorkspaceXmlBasicAuthTest

File

core/modules/workspaces/tests/src/Functional/Rest/WorkspaceXmlBasicAuthTest.php, line 15

Namespace

Drupal\Tests\workspaces\Functional\Rest
View 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

Namesort descending Modifiers Type Description Overrides
BasicAuthResourceTestTrait::assertAuthenticationEdgeCases protected function 1
BasicAuthResourceTestTrait::assertResponseWhenMissingAuthentication protected function 1
BasicAuthResourceTestTrait::getAuthenticationRequestOptions protected function
EntityResourceTestBase::$anotherEntity protected property Another entity of the same type used for testing.
EntityResourceTestBase::$entity protected property The main entity used for testing. 42
EntityResourceTestBase::$entityStorage protected property The entity storage.
EntityResourceTestBase::$labelFieldName protected static property Optionally specify which field is the 'label' field. 2
EntityResourceTestBase::assert406Response protected function Asserts a 406 response… or in some cases a 403 response, because weirdness.
EntityResourceTestBase::assertEntityArraySubset protected function Recursively asserts that the expected items are set in the tested entity.
EntityResourceTestBase::assertNormalizationEdgeCases protected function Asserts normalization-specific edge cases. Overrides ResourceTestBase::assertNormalizationEdgeCases
EntityResourceTestBase::assertPatchProtectedFieldNamesStructure protected function Asserts structure of $patchProtectedFieldNames.
EntityResourceTestBase::assertResourceNotAvailable protected function Asserts that a resource is unavailable: 404, 406 if it has canonical route.
EntityResourceTestBase::assertStoredEntityMatchesSentNormalization protected function Asserts that the stored entity matches the sent normalization.
EntityResourceTestBase::castToString protected static function Transforms a normalization: casts all non-string types to strings.
EntityResourceTestBase::getEntityResourcePostUrl protected function Gets an entity resource's POST URL.
EntityResourceTestBase::getEntityResourceUrl protected function Gets an entity resource's GET/PATCH/DELETE URL.
EntityResourceTestBase::getExpectedCacheContexts protected function The expected cache contexts for the GET/HEAD response of the test entity. 17
EntityResourceTestBase::getExpectedCacheTags protected function The expected cache tags for the GET/HEAD response of the test entity. 4
EntityResourceTestBase::getExpectedUnauthorizedAccessCacheability protected function Returns the expected cacheability of an unauthorized access response. Overrides ResourceTestBase::getExpectedUnauthorizedAccessCacheability 1
EntityResourceTestBase::getExpectedUnauthorizedEntityAccessCacheability protected function The cacheability of unauthorized 'view' entity access. 6
EntityResourceTestBase::getModifiedEntityForPatchTesting protected static function Clones the given entity and modifies all PATCH-protected fields.
EntityResourceTestBase::makeNormalizationInvalid protected function Makes the given entity normalization invalid.
EntityResourceTestBase::provisionEntityResource protected function Provides an entity resource.
EntityResourceTestBase::setUp protected function Overrides ResourceTestBase::setUp 2
EntityResourceTestBase::testDelete public function Tests a DELETE request for an entity, plus edge cases to ensure good DX. 1
EntityResourceTestBase::testGet public function Tests a GET request for an entity, plus edge cases to ensure good DX. 4
ResourceTestBase::$account protected property The account to use for authentication, if any.
ResourceTestBase::$resourceConfigId protected static property The REST Resource Config entity ID under test (i.e. a resource type). 4
ResourceTestBase::$resourceConfigStorage protected property The REST resource config entity storage.
ResourceTestBase::$serializer protected property The serializer service.
ResourceTestBase::assertResourceErrorResponse protected function Asserts that a resource error response has the given message.
ResourceTestBase::assertResourceResponse protected function Asserts that a resource response has the given status code and body.
ResourceTestBase::decorateWithXdebugCookie protected function Adds the Xdebug cookie to the request options.
ResourceTestBase::grantPermissionsToAnonymousRole protected function Grants permissions to the anonymous role.
ResourceTestBase::grantPermissionsToAuthenticatedRole protected function Grants permissions to the authenticated role.
ResourceTestBase::grantPermissionsToTestedRole protected function Grants permissions to the tested role: anonymous or authenticated.
ResourceTestBase::initAuthentication protected function Initializes authentication.
ResourceTestBase::provisionResource protected function Provisions the REST resource under test.
ResourceTestBase::recursiveKSort protected static function Recursively sorts an array by key.
ResourceTestBase::refreshTestStateAfterRestConfigChange protected function Refreshes the state of the tester to be in sync with the testee.
ResourceTestBase::request protected function Performs a HTTP request. Wraps the Guzzle HTTP client. 1
WorkspaceResourceTestBase::$entityTypeId protected static property The tested entity type. Overrides EntityResourceTestBase::$entityTypeId
WorkspaceResourceTestBase::$firstCreatedEntityId protected static property The entity ID for the first created entity in testPost(). Overrides EntityResourceTestBase::$firstCreatedEntityId
WorkspaceResourceTestBase::$patchProtectedFieldNames protected static property The fields that are protected against modification during PATCH requests. Overrides EntityResourceTestBase::$patchProtectedFieldNames
WorkspaceResourceTestBase::$secondCreatedEntityId protected static property The entity ID for the second created entity in testPost(). Overrides EntityResourceTestBase::$secondCreatedEntityId
WorkspaceResourceTestBase::$uniqueFieldNames protected static property A list of fields that need a unique value. Overrides EntityResourceTestBase::$uniqueFieldNames
WorkspaceResourceTestBase::createAnotherEntity protected function Creates another entity to be tested. Overrides EntityResourceTestBase::createAnotherEntity
WorkspaceResourceTestBase::createEntity protected function Creates the entity to be tested. Overrides EntityResourceTestBase::createEntity
WorkspaceResourceTestBase::getExpectedUnauthorizedAccessMessage protected function Return the expected error message. Overrides EntityResourceTestBase::getExpectedUnauthorizedAccessMessage
WorkspaceResourceTestBase::getModifiedEntityForPostTesting protected function Gets the normalized POST entity with random values for its unique fields. Overrides EntityResourceTestBase::getModifiedEntityForPostTesting
WorkspaceResourceTestBase::getNormalizedPatchEntity protected function Returns the normalized PATCH entity. Overrides EntityResourceTestBase::getNormalizedPatchEntity
WorkspaceResourceTestBase::getNormalizedPostEntity protected function Returns the normalized POST entity. Overrides EntityResourceTestBase::getNormalizedPostEntity
WorkspaceResourceTestBase::setUpAuthorization protected function Sets up the necessary authorization. Overrides ResourceTestBase::setUpAuthorization
WorkspaceXmlBasicAuthTest::$auth protected static property The authentication mechanism to use in this test. Overrides ResourceTestBase::$auth
WorkspaceXmlBasicAuthTest::$defaultTheme protected property
WorkspaceXmlBasicAuthTest::$format protected static property The format to use in this test. Overrides ResourceTestBase::$format
WorkspaceXmlBasicAuthTest::$mimeType protected static property The MIME type that corresponds to $format. Overrides ResourceTestBase::$mimeType
WorkspaceXmlBasicAuthTest::$modules protected static property Modules to install. Overrides WorkspaceResourceTestBase::$modules
WorkspaceXmlBasicAuthTest::testPatchPath public function
XmlEntityNormalizationQuirksTrait::applyXmlConfigEntityDecodingQuirks protected function Applies the XML config entity encoding quirks that remain after decoding.
XmlEntityNormalizationQuirksTrait::applyXmlFieldDecodingQuirks protected function Applies the XML entity field encoding quirks that remain after decoding.
XmlEntityNormalizationQuirksTrait::getExpectedNormalizedEntity protected function
XmlEntityNormalizationQuirksTrait::testPatch public function
XmlEntityNormalizationQuirksTrait::testPost public function
XmlNormalizationQuirksTrait::applyXmlDecodingQuirks protected function Applies the XML encoding quirks that remain after decoding.