X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=web%2Fcore%2Fmodules%2Frest%2Fsrc%2FTests%2FUpdate%2FResourceGranularityUpdateTest.php;fp=web%2Fcore%2Fmodules%2Frest%2Fsrc%2FTests%2FUpdate%2FResourceGranularityUpdateTest.php;h=0000000000000000000000000000000000000000;hp=c8cf89afcc74c8c40aa94a7166e61789c7aaaca3;hb=9917807b03b64faf00f6a1f29dcb6eafc454efa5;hpb=aea91e65e895364e460983b890e295aa5d5540a5 diff --git a/web/core/modules/rest/src/Tests/Update/ResourceGranularityUpdateTest.php b/web/core/modules/rest/src/Tests/Update/ResourceGranularityUpdateTest.php deleted file mode 100644 index c8cf89afc..000000000 --- a/web/core/modules/rest/src/Tests/Update/ResourceGranularityUpdateTest.php +++ /dev/null @@ -1,71 +0,0 @@ -databaseDumpFiles = [ - __DIR__ . '/../../../../system/tests/fixtures/update/drupal-8.bare.standard.php.gz', - __DIR__ . '/../../../../rest/tests/fixtures/update/drupal-8.rest-rest_post_update_resource_granularity.php', - ]; - } - - /** - * Tests rest_post_update_simplify_resource_granularity(). - */ - public function testMethodGranularityConvertedToResourceGranularity() { - /** @var \Drupal\Core\Entity\EntityStorageInterface $resource_config_storage */ - $resource_config_storage = $this->container->get('entity_type.manager')->getStorage('rest_resource_config'); - - // Make sure we have the expected values before the update. - $resource_config_entities = $resource_config_storage->loadMultiple(); - $this->assertIdentical(['entity.comment', 'entity.node', 'entity.user'], array_keys($resource_config_entities)); - $this->assertIdentical('method', $resource_config_entities['entity.node']->get('granularity')); - $this->assertIdentical('method', $resource_config_entities['entity.comment']->get('granularity')); - $this->assertIdentical('method', $resource_config_entities['entity.user']->get('granularity')); - - // Read the existing 'entity:comment' and 'entity:user' resource - // configuration so we can verify it after the update. - $comment_resource_configuration = $resource_config_entities['entity.comment']->get('configuration'); - $user_resource_configuration = $resource_config_entities['entity.user']->get('configuration'); - - $this->runUpdates(); - - // Make sure we have the expected values after the update. - $resource_config_entities = $resource_config_storage->loadMultiple(); - $this->assertIdentical(['entity.comment', 'entity.node', 'entity.user'], array_keys($resource_config_entities)); - // 'entity:node' should be updated. - $this->assertIdentical('resource', $resource_config_entities['entity.node']->get('granularity')); - $this->assertidentical($resource_config_entities['entity.node']->get('configuration'), [ - 'methods' => ['GET', 'POST', 'PATCH', 'DELETE'], - 'formats' => ['hal_json'], - 'authentication' => ['basic_auth'], - ]); - // 'entity:comment' should be unchanged. - $this->assertIdentical('method', $resource_config_entities['entity.comment']->get('granularity')); - $this->assertIdentical($comment_resource_configuration, $resource_config_entities['entity.comment']->get('configuration')); - // 'entity:user' should be unchanged. - $this->assertIdentical('method', $resource_config_entities['entity.user']->get('granularity')); - $this->assertIdentical($user_resource_configuration, $resource_config_entities['entity.user']->get('configuration')); - } - -}