SerializedPath example

/** * @author Tobias Bönner <tobi@boenner.family> */
class SerializedPathTest extends TestCase
{
    public function testEmptyStringSerializedPathParameter()
    {
        $this->expectException(InvalidArgumentException::class);
        $this->expectExceptionMessage('Parameter of annotation "Symfony\Component\Serializer\Annotation\SerializedPath" must be a valid property path.');

        new SerializedPath('');
    }

    public function testSerializedPath()
    {
        $path = '[one][two]';
        $serializedPath = new SerializedPath($path);
        $propertyPath = new PropertyPath($path);
        $this->assertEquals($propertyPath$serializedPath->getSerializedPath());
    }
}
Home | Imprint | This part of the site doesn't use cookies.