3 namespace Drupal\Tests\rest\Functional\EntityResource\ConfigurableLanguage;
5 use Drupal\Core\Cache\Cache;
6 use Drupal\Tests\rest\Functional\EntityResource\EntityResourceTestBase;
7 use Drupal\language\Entity\ConfigurableLanguage;
9 abstract class ConfigurableLanguageResourceTestBase extends EntityResourceTestBase {
14 public static $modules = ['language'];
19 protected static $entityTypeId = 'configurable_language';
22 * @var \Drupal\language\ConfigurableLanguageInterface
29 protected function setUpAuthorization($method) {
30 $this->grantPermissionsToTestedRole(['administer languages']);
36 protected function createEntity() {
37 $configurable_language = ConfigurableLanguage::create([
39 'label' => 'Llama Language',
41 $configurable_language->save();
43 return $configurable_language;
49 protected function getExpectedNormalizedEntity() {
54 'label' => 'Llama Language',
58 'uuid' => $this->entity->uuid(),
66 protected function getExpectedCacheContexts() {
67 return Cache::mergeContexts(parent::getExpectedCacheContexts(), ['languages:language_interface']);
73 protected function getNormalizedPostEntity() {
74 // @todo Update in https://www.drupal.org/node/2300677.