* * 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:----PBlnexhnB/bPw4lN7+WM41rg2zJUqngF5/UaLNGgm0FkXejuoUXAqSIurSa80tbtaHKthKecLmncaVKfuPJ+RTp9hypxF8/L7I8aXJf3INupLJoiDEKBzwEOZHz4vMUmLtwXmh66oiXynTePJbrd4yhjGlCdcgupYJek1tgkeAd12BaT9vY/6bBn+FrsRHgBNODoZ9iVaWmEN6lesc1QXy6xNoAI0Vku1cJ1o96dpd4Ke2BsjjnYsmDwDIisdKzbLatPDqAQJDV12x2uWBfgdxN7CuBIq/QH6+n9p7Qjj8CZoqEoZDsjITe1sMxsvfEmXwAgB7NlB4+H6IF2gErS30lhgAJGpqElLrznj77ovL2J3rwoOU04LA0MStCN5MWzKhuDJjA9gSXy9TOAO1phiR3BpTgur1cIN2aMCmJG55ZflFP565UcI/Fii8fjpn8McGghgeBaZmCujwX/3hDpyK2mc3XTDuroGEHBGFoTwDdYjoBZTUpVEUK7V5Z+HoGFrfMd6D/g9dYtbohAtNQaxDgDvDK3COdY+2U0qj9EP+25RdWmBWjQR5MoR0EipwhfVtQcQvk0tLFzpyWK1uNYw2yB+p5+50KLHFh+MrmmuMEC9CMb0BFtgEc6IBs+YlHpvU6QHQ2w73ly7zljW1hSVHlG8D3WCunK5K7Yz+eKcS0=----ATTACHMENT:----NTk1Mjc2MDU4ODEwODcyNCA2MjUyMzc3Mjk2NDQyNTgzIDg1OTI5MzY5MzExMzg4Nw==