3 namespace Drupal\Tests\rest\Functional\EntityResource\EntityTestBundle;
5 use Drupal\entity_test\Entity\EntityTestBundle;
6 use Drupal\Tests\rest\Functional\BcTimestampNormalizerUnixTestTrait;
7 use Drupal\Tests\rest\Functional\EntityResource\EntityResourceTestBase;
9 abstract class EntityTestBundleResourceTestBase extends EntityResourceTestBase {
11 use BcTimestampNormalizerUnixTestTrait;
16 public static $modules = ['entity_test'];
21 protected static $entityTypeId = 'entity_test_bundle';
26 protected static $patchProtectedFieldNames = [];
29 * @var \Drupal\entity_test\Entity\EntityTestBundle
36 protected function setUpAuthorization($method) {
37 $this->grantPermissionsToTestedRole(['administer entity_test_bundle content']);
43 protected function createEntity() {
44 $entity_test_bundle = EntityTestBundle::create([
46 'label' => 'Camelids',
47 'description' => 'Camelids are large, strictly herbivorous animals with slender necks and long legs.',
49 $entity_test_bundle->save();
51 return $entity_test_bundle;
57 protected function getExpectedNormalizedEntity() {
60 'description' => 'Camelids are large, strictly herbivorous animals with slender necks and long legs.',
62 'label' => 'Camelids',
65 'uuid' => $this->entity->uuid(),
72 protected function getNormalizedPostEntity() {
73 // @todo Update in https://www.drupal.org/node/2300677.