* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Serializer\Tests\Annotation; use PHPUnit\Framework\TestCase; use Symfony\Component\Serializer\Annotation\MaxDepth; /** * @author Kévin Dunglas */ class MaxDepthTest extends TestCase { /** * @expectedException \Symfony\Component\Serializer\Exception\InvalidArgumentException * @expectedExceptionMessage Parameter of annotation "Symfony\Component\Serializer\Annotation\MaxDepth" should be set. */ public function testNotSetMaxDepthParameter() { new MaxDepth(array()); } public function provideInvalidValues() { return array( array(''), array('foo'), array('1'), array(0), ); } /** * @dataProvider provideInvalidValues * * @expectedException \Symfony\Component\Serializer\Exception\InvalidArgumentException * @expectedExceptionMessage Parameter of annotation "Symfony\Component\Serializer\Annotation\MaxDepth" must be a positive integer. */ public function testNotAnIntMaxDepthParameter($value) { new MaxDepth(array('value' => $value)); } public function testMaxDepthParameters() { $maxDepth = new MaxDepth(array('value' => 3)); $this->assertEquals(3, $maxDepth->getMaxDepth()); } } __halt_compiler();----SIGNATURE:----CxJ8mzpOCqPSnPM5mQBiWpJLvzuzBr+QLUYcW9yCPD4Bih8NaUke50vNWGEuFyJO/WVEfN9kClQTcbp64iwRawChQSDHwrEuyqWXFqDk9apzNJ+DmGiunhK3Upc+IvajnDrNDnQWiGF91odvg3Oed+RxfABD+bJz1qKjY84yLgAH7jQfJL+SopkTTC5ZC+Yd86HxgK0eWrT4tF8r8fDcWKySReo8N/P+gwLv9qt9ufuB/flD76tI/D7KUIzUfHbrb3h9mvbRhqU36gTuePKdE+SwPvJlfKbBG4htVeIbxngkr/po6fdqjUSVGyCvZEakiRhNHnTts82qm4HmYwe34sxFRRntK/t7tioHnIqcDlWgOuCAhJTGxh5/CIr3LTKuazeiMT4cESlRJuZlY674NvqSsLhNCORNPC+bL+ZHarWcqjox2+GdnXkd6fZpRm+jeTLt75tU4NjyPfOFyFml0rhXIn2/iqy/8NO5mjdmJg5EPPE0tplhWobdRuvqoKvD5lRqWjffZj4FjYQ1B5XCQsIvhKrfmXzaFkywG68HbqIhEgWvn0khgrFcaTQh3MlMVS4wocBbwup75Irz9ZtubnhNZJbrc1m7pe+Qfp5UDO5uRzD+BJ5uSAKtssftzgdlwV6HZ15fskLc2hMAgvWPMcAyBEucBp3Qpko2Uu8dbN4=----ATTACHMENT:----NzAwODA3NzQ5MzIwOTIxMiAyNDMwMzY5ODgzNDY1OTY5IDg2OTUxMDI2MjQyNzcyMjc=