class PathAliasHalJsonTestBase
Same name and namespace in other branches
- 8.9.x core/modules/path_alias/tests/src/Functional/Hal/PathAliasHalJsonTestBase.php \Drupal\Tests\path_alias\Functional\Hal\PathAliasHalJsonTestBase
Base hal_json test class for the path_alias entity type.
Hierarchy
- class \Drupal\Tests\BrowserTestBase uses \Drupal\Core\Test\FunctionalTestSetupTrait, \Drupal\Tests\UiHelperTrait, \Drupal\Core\Test\TestSetupTrait, \Drupal\Tests\block\Traits\BlockCreationTrait, \Drupal\FunctionalTests\AssertLegacyTrait, \Drupal\Tests\RandomGeneratorTrait, \Drupal\Tests\node\Traits\NodeCreationTrait, \Drupal\Tests\node\Traits\ContentTypeCreationTrait, \Drupal\Tests\ConfigTestTrait, \Drupal\Tests\TestRequirementsTrait, \Drupal\Tests\user\Traits\UserCreationTrait, \Drupal\Tests\XdebugRequestTrait, \Drupal\Tests\Traits\PhpUnitWarnings, \Drupal\Tests\PhpUnitCompatibilityTrait, \Symfony\Bridge\PhpUnit\ExpectDeprecationTrait, \Drupal\Tests\ExtensionListTestTrait implements \PHPUnit\Framework\TestCase
- class \Drupal\Tests\rest\Functional\ResourceTestBase implements \Drupal\Tests\BrowserTestBase
- class \Drupal\Tests\rest\Functional\EntityResource\EntityResourceTestBase implements \Drupal\Tests\rest\Functional\ResourceTestBase
- class \Drupal\Tests\path_alias\Functional\Rest\PathAliasResourceTestBase implements \Drupal\Tests\rest\Functional\EntityResource\EntityResourceTestBase
- class \Drupal\Tests\hal\Functional\path_alias\PathAliasHalJsonTestBase uses \Drupal\Tests\hal\Functional\EntityResource\HalEntityNormalizationTrait implements \Drupal\Tests\path_alias\Functional\Rest\PathAliasResourceTestBase
- class \Drupal\Tests\path_alias\Functional\Rest\PathAliasResourceTestBase implements \Drupal\Tests\rest\Functional\EntityResource\EntityResourceTestBase
- class \Drupal\Tests\rest\Functional\EntityResource\EntityResourceTestBase implements \Drupal\Tests\rest\Functional\ResourceTestBase
- class \Drupal\Tests\rest\Functional\ResourceTestBase implements \Drupal\Tests\BrowserTestBase
Expanded class hierarchy of PathAliasHalJsonTestBase
File
-
core/
modules/ hal/ tests/ src/ Functional/ path_alias/ PathAliasHalJsonTestBase.php, line 11
Namespace
Drupal\Tests\hal\Functional\path_aliasView source
abstract class PathAliasHalJsonTestBase extends PathAliasResourceTestBase {
use HalEntityNormalizationTrait;
/**
* {@inheritdoc}
*/
protected function getExpectedNormalizedEntity() {
$default_normalization = parent::getExpectedNormalizedEntity();
$normalization = $this->applyHalFieldNormalization($default_normalization);
return $normalization + [
'_links' => [
'self' => [
'href' => $this->baseUrl . '/entity/path_alias/1?_format=hal_json',
],
'type' => [
'href' => $this->baseUrl . '/rest/type/path_alias/path_alias',
],
],
];
}
/**
* {@inheritdoc}
*/
protected function getNormalizedPostEntity() {
return parent::getNormalizedPostEntity() + [
'_links' => [
'type' => [
'href' => $this->baseUrl . '/rest/type/path_alias/path_alias',
],
],
];
}
/**
* {@inheritdoc}
*/
protected function getExpectedCacheContexts() {
return [
'url.site',
'user.permissions',
];
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.