core/modules/rest/src/RequestHandler.php | 1 + core/modules/rest/tests/src/Kernel/RequestHandlerTest.php | 9 +++------ .../serialization/tests/src/Kernel/EntitySerializationTest.php | 6 +++++- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/core/modules/rest/src/RequestHandler.php b/core/modules/rest/src/RequestHandler.php index 11a578c..905af1a 100644 --- a/core/modules/rest/src/RequestHandler.php +++ b/core/modules/rest/src/RequestHandler.php @@ -192,6 +192,7 @@ protected function createArgumentResolver(RouteMatchInterface $route_match, $uns $wildcard_arguments[] = $request; if (isset($unserialized)) { $wildcard_arguments[] = $unserialized; + $raw_route_arguments['data'] = $unserialized; } return new ArgumentsResolver($raw_route_arguments, $upcasted_route_arguments, $wildcard_arguments); diff --git a/core/modules/rest/tests/src/Kernel/RequestHandlerTest.php b/core/modules/rest/tests/src/Kernel/RequestHandlerTest.php index 7d38a97..4ede7e4 100644 --- a/core/modules/rest/tests/src/Kernel/RequestHandlerTest.php +++ b/core/modules/rest/tests/src/Kernel/RequestHandlerTest.php @@ -42,10 +42,7 @@ class RequestHandlerTest extends KernelTestBase { public function setUp() { parent::setUp(); $this->entityStorage = $this->prophesize(EntityStorageInterface::class); - $config_factory = $this->prophesize(ConfigFactoryInterface::class); - $config_factory->get('rest.settings') - ->willReturn($this->prophesize(ImmutableConfig::class)->reveal()); - $this->requestHandler = new RequestHandler($this->entityStorage->reveal(), $config_factory->reveal()); + $this->requestHandler = new RequestHandler($this->entityStorage->reveal()); $this->requestHandler->setContainer($this->container); } @@ -98,9 +95,9 @@ public function testHandle() { */ class StubRequestHandlerResourcePlugin extends ResourceBase { - public function get($example, Request $request) {} + public function get($example = NULL, Request $request) {} public function post() {} - public function patch($example_original, Request $request) {} + public function patch($example_original = NULL, Request $request) {} public function delete() {} } diff --git a/core/modules/serialization/tests/src/Kernel/EntitySerializationTest.php b/core/modules/serialization/tests/src/Kernel/EntitySerializationTest.php index 5bde06b..81140d9 100644 --- a/core/modules/serialization/tests/src/Kernel/EntitySerializationTest.php +++ b/core/modules/serialization/tests/src/Kernel/EntitySerializationTest.php @@ -2,6 +2,7 @@ namespace Drupal\Tests\serialization\Kernel; +use Drupal\Component\Datetime\DateTimePlus; use Drupal\Component\Utility\SafeMarkup; use Drupal\entity_test\Entity\EntityTestMulRev; use Drupal\Tests\rest\Functional\BcTimestampNormalizerUnixTestTrait; @@ -189,7 +190,10 @@ public function testSerialize() { // Generate the expected xml in a way that allows changes to entity property // order. - $expected_created = $this->formatExpectedTimestampItemValues($this->entity->created->value); + $expected_created = [ + 'value' => DateTimePlus::createFromTimestamp($this->entity->created->value, 'UTC')->format(\DateTime::RFC3339), + 'format' => \DateTime::RFC3339, + ]; $expected = [ 'id' => '' . $this->entity->id() . '',