DateFormatResourceTestBase.php in Drupal 9
File
core/tests/Drupal/FunctionalTests/Rest/DateFormatResourceTestBase.php
View source
<?php
namespace Drupal\FunctionalTests\Rest;
use Drupal\Core\Datetime\Entity\DateFormat;
use Drupal\Tests\rest\Functional\EntityResource\EntityResourceTestBase;
abstract class DateFormatResourceTestBase extends EntityResourceTestBase {
protected static $modules = [];
protected static $entityTypeId = 'date_format';
protected $entity;
protected function setUpAuthorization($method) {
$this
->grantPermissionsToTestedRole([
'administer site configuration',
]);
}
protected function createEntity() {
$date_format = DateFormat::create([
'id' => 'llama',
'label' => 'Llama',
'pattern' => 'F d, Y',
]);
$date_format
->save();
return $date_format;
}
protected function getExpectedNormalizedEntity() {
return [
'dependencies' => [],
'id' => 'llama',
'label' => 'Llama',
'langcode' => 'en',
'locked' => FALSE,
'pattern' => 'F d, Y',
'status' => TRUE,
'uuid' => $this->entity
->uuid(),
];
}
protected function getNormalizedPostEntity() {
}
}