ApiPlatform\Core\Tests\EventListener\DeserializeListenerTest::testDoNotCallWhenRequestMethodIsSafe PHP Method

testDoNotCallWhenRequestMethodIsSafe() public method

    public function testDoNotCallWhenRequestMethodIsSafe()
    {
        $eventProphecy = $this->prophesize(GetResponseEvent::class);
        $request = new Request([], [], ['data' => new \stdClass()]);
        $request->setMethod(Request::METHOD_GET);
        $eventProphecy->getRequest()->willReturn($request)->shouldBeCalled();
        $serializerProphecy = $this->prophesize(SerializerInterface::class);
        $serializerProphecy->deserialize()->shouldNotBeCalled();
        $serializerContextBuilderProphecy = $this->prophesize(SerializerContextBuilderInterface::class);
        $serializerContextBuilderProphecy->createFromRequest(Argument::type(Request::class), false, Argument::type('array'))->shouldNotBeCalled();
        $listener = new DeserializeListener($serializerProphecy->reveal(), $serializerContextBuilderProphecy->reveal(), self::FORMATS);
        $listener->onKernelRequest($eventProphecy->reveal());
    }