8000 [Config] Extra tests for Config component by zomberg · Pull Request #19399 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Config] Extra tests for Config component #19399

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

Closed
wants to merge 4 commits into from
Closed
Changes from 1 commit
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
Prev Previous commit
Next Next commit
[Config] Added extra tests for ExprBuilder class
  • Loading branch information
zomberg committed Jul 25, 2016
commit e9b8f0ec4edb8c53c130dd26b3a4bf090acc4af2
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,30 @@ public function testThenUnsetExpression()
$this->assertEquals(array(), $this->finalizeTestBuilder($test));
}

/**
* @expectedException \RuntimeException
* @expectedExceptionMessage You must specify an if part.
*/
public function testEndIfPartNotSpecified()
{
$this->getTestBuilder()->end();
}

/**
* @expectedException \RuntimeException
* @expectedExceptionMessage You must specify a then part.
*/
public function testEndThenPartNotSpecified()
{
$builder = $this->getTestBuilder();

$reflection = new \ReflectionProperty($builder, 'ifPart');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you need reflection here?

Copy link
Contributor Author
@zomberg zomberg Jul 22, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. You are right. I didn't notice that this is public property. I fixed it.

$reflection->setAccessible(true);
$reflection->setValue($builder, 'test');

$builder->end();
}

/**
* Create a test treebuilder with a variable node, and init the validation.
*
Expand Down
0