8000 [Serializer] Improve test coverage of the MaxDepth annotation by dunglas · Pull Request #20523 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Serializer] Improve test coverage of the MaxDepth annotation #20523

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 15, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
[Serializer] Improve test coverage of the MaxDepth annotation
  • Loading branch information
dunglas committed Nov 15, 2016
commit 531169656e3e3901eedd869fa04b04d006f80aab
22 changes: 18 additions & 4 deletions src/Symfony/Component/Serializer/Tests/Annotation/MaxDepthTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,22 @@
*/
class MaxDepthTest extends \PHPUnit_Framework_TestCase
{
/**
* @expectedException \Symfony\Component\Serializer\Exception\InvalidArgumentException
*/
public function testNotSetMaxDepthParameter()
{
new MaxDepth(array());
}

/**
* @expectedException \Symfony\Component\Serializer\Exception\InvalidArgumentException
*/
public function testEmptyMaxDepthParameter()
{
new MaxDepth(array('value' => ''));
}

/**
* @expectedException \Symfony\Component\Serializer\Exception\InvalidArgumentException
*/
Expand All @@ -28,9 +44,7 @@ public function testNotAnIntMaxDepthParameter()

public function testMaxDepthParameters()
{
$validData = 3;

$groups = new MaxDepth(array('value' => 3));
$this->assertEquals($validData, $groups->getMaxDepth());
$maxDepth = new MaxDepth(array('value' => 3));
$this->assertEquals(3, $maxDepth->getMaxDepth());
}
}
0