3 namespace Drupal\Tests\rest\Functional\EntityResource\DateFormat;
5 use Drupal\Core\Datetime\Entity\DateFormat;
6 use Drupal\Tests\rest\Functional\EntityResource\EntityResourceTestBase;
9 * ResourceTestBase for DateFormat entity.
11 abstract class DateFormatResourceTestBase extends EntityResourceTestBase {
16 public static $modules = [];
21 protected static $entityTypeId = 'date_format';
24 * The DateFormat entity.
26 * @var \Drupal\Core\Datetime\DateFormatInterface
33 protected function setUpAuthorization($method) {
34 $this->grantPermissionsToTestedRole(['administer site configuration']);
40 protected function createEntity() {
41 // Create a date format.
42 $date_format = DateFormat::create([
45 'pattern' => 'F d, Y',
56 protected function getExpectedNormalizedEntity() {
63 'pattern' => 'F d, Y',
65 'uuid' => $this->entity->uuid(),
72 protected function getNormalizedPostEntity() {
73 // @todo Update in https://www.drupal.org/node/2300677.