Navigation Menu

Skip to content

Commit

Permalink
Merge pull request #338 from FriendsOfSymfony/2.0.x-property-access
Browse files Browse the repository at this point in the history
Fix missing getter for private field test for PropertyAccess 2.3+
  • Loading branch information
jmikola committed Jul 17, 2013
2 parents cd48a36 + 9e2e8ab commit a66a37a
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions Tests/Transformer/ModelToElasticaAutoTransformerTest.php
Expand Up @@ -203,10 +203,17 @@ public function testThatNullValuesAreNotFilteredOut()

public function testThatCannotTransformObjectWhenGetterDoesNotExistForPrivateMethod()
{
// Support both Symfony 2.1 (Form component) and 2.2 (PropertyAccess component)
$expectedException = class_exists('Symfony\Component\PropertyAccess\PropertyAccess')
? 'Symfony\Component\PropertyAccess\Exception\PropertyAccessDeniedException'
: 'Symfony\Component\Form\Exception\PropertyAccessDeniedException';
// Support both Symfony 2.1 (Form component) and 2.2+ (PropertyAccess component)
if (class_exists('Symfony\Component\PropertyAccess\PropertyAccess')) {
/* ProperyAccess 2.3+ removed PropertyAccessDeniedException, so we
* must expect NoSuchPropertyException in its absence.
*/
$expectedException = class_exists('Symfony\Component\Form\Exception\PropertyAccessDeniedException')
? 'Symfony\Component\Form\Exception\PropertyAccessDeniedException'
: 'Symfony\Component\PropertyAccess\Exception\NoSuchPropertyException';
} else {
$expectedException = 'Symfony\Component\Form\Exception\PropertyAccessDeniedException';
}

$this->setExpectedException($expectedException);

Expand Down

0 comments on commit a66a37a

Please sign in to comment.