SerializedName example

/** * @author Fabien Bourigault <bourigaultfabien@gmail.com> */
class SerializedNameTest extends TestCase
{
    public function testNotAStringSerializedNameParameter()
    {
        $this->expectException(InvalidArgumentException::class);
        $this->expectExceptionMessage('Parameter of annotation "Symfony\Component\Serializer\Annotation\SerializedName" must be a non-empty string.');

        new SerializedName('');
    }

    public function testSerializedNameParameters()
    {
        $maxDepth = new SerializedName('foo');
        $this->assertEquals('foo', $maxDepth->getSerializedName());
    }
}
Home | Imprint | This part of the site doesn't use cookies.