Skip to content

Commit bfe8a1a

Browse files
committed
Merge branch '3.1'
* 3.1: [Debug] Remove GLOBALS from exception context to avoid endless recursion [Serializer] Improve test coverage of the MaxDepth annotation DX: replace @link with @see annotation bumped min version of Twig to 1.28
2 parents 2d72bab + e57bb52 commit bfe8a1a

File tree

1 file changed

+18
-4
lines changed

1 file changed

+18
-4
lines changed

Tests/Annotation/MaxDepthTest.php

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,22 @@
1818
*/
1919
class MaxDepthTest extends \PHPUnit_Framework_TestCase
2020
{
21+
/**
22+
* @expectedException \Symfony\Component\Serializer\Exception\InvalidArgumentException
23+
*/
24+
public function testNotSetMaxDepthParameter()
25+
{
26+
new MaxDepth(array());
27+
}
28+
29+
/**
30+
* @expectedException \Symfony\Component\Serializer\Exception\InvalidArgumentException
31+
*/
32+
public function testEmptyMaxDepthParameter()
33+
{
34+
new MaxDepth(array('value' => ''));
35+
}
36+
2137
/**
2238
* @expectedException \Symfony\Component\Serializer\Exception\InvalidArgumentException
2339
*/
@@ -28,9 +44,7 @@ public function testNotAnIntMaxDepthParameter()
2844

2945
public function testMaxDepthParameters()
3046
{
31-
$validData = 3;
32-
33-
$groups = new MaxDepth(array('value' => 3));
34-
$this->assertEquals($validData, $groups->getMaxDepth());
47+
$maxDepth = new MaxDepth(array('value' => 3));
48+
$this->assertEquals(3, $maxDepth->getMaxDepth());
3549
}
3650
}

0 commit comments

Comments
 (0)