8000 minor #20523 [Serializer] Improve test coverage of the MaxDepth annot… · src-run/symfony@a813cb7 · GitHub
[go: up one dir, main page]

Skip to content

Commit a813cb7

Browse files
committed
minor symfony#20523 [Serializer] Improve test coverage of the MaxDepth annotation (dunglas)
This PR was merged into the 3.1 branch. Discussion ---------- [Serializer] Improve test coverage of the MaxDepth annotation | Q | A | ------------- | --- | Branch? | 3.1 | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | n/a | License | MIT | Doc PR | n/a Commits ------- 5311696 [Serializer] Improve test coverage of the MaxDepth annotation
2 parents 30e83dc + 5311696 commit a813cb7

File tree

1 file changed

+18
-4
lines changed

1 file changed

+18
-4
lines changed

src/Symfony/Component/Serializer/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)
0