Phprest\Service\Hateoas\UtilTest::testJsonDeserialize PHP Method

testJsonDeserialize() public method

public testJsonDeserialize ( )
    public function testJsonDeserialize()
    {
        $this->container->add(Application::CONTAINER_ID_VENDOR, 'phprest');
        $this->container->add(Application::CONTAINER_ID_API_VERSION, '3.2');
        $request = new Request([], [], [], [], [], [], '{"a":1,"b":2}');
        $request->headers->set('Content-Type', 'application/json', true);
        $sample = $this->deserialize('Phprest\\Stub\\Entity\\Sample', $request);
        $this->assertInstanceOf('Phprest\\Stub\\Entity\\Sample', $sample);
        $this->assertEquals(1, $sample->a);
        $this->assertEquals(2, $sample->b);
    }