MaxDepth example


class MaxDepthTest extends TestCase
{
    /** * @testWith [-4] * [0] */
    public function testNotAnIntMaxDepthParameter(int $value)
    {
        $this->expectException(InvalidArgumentException::class);
        $this->expectExceptionMessage('Parameter of annotation "Symfony\Component\Serializer\Annotation\MaxDepth" must be a positive integer.');
        new MaxDepth($value);
    }

    public function testMaxDepthParameters()
    {
        $maxDepth = new MaxDepth(3);
        $this->assertEquals(3, $maxDepth->getMaxDepth());
    }
}
Home | Imprint | This part of the site doesn't use cookies.