From ee6f3cb04d8f3678596ed9557d7dd1e1b2265072 Mon Sep 17 00:00:00 2001 From: Jeremy Mikola Date: Thu, 2 May 2013 11:24:27 -0400 Subject: [PATCH] Expect a more specific PropertyAccess exception RuntimeException is the nearest common ancestor of the PropertyAccessDeniedException (removed in 2.3) and NoSuchPropertyException. See: symfony/symfony@2a666cb7c3ecbaa6226e5a9da0476b10b6e997db --- Tests/Transformer/ModelToElasticaAutoTransformerTest.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Tests/Transformer/ModelToElasticaAutoTransformerTest.php b/Tests/Transformer/ModelToElasticaAutoTransformerTest.php index 1c8905b..cbcb6bd 100644 --- a/Tests/Transformer/ModelToElasticaAutoTransformerTest.php +++ b/Tests/Transformer/ModelToElasticaAutoTransformerTest.php @@ -201,10 +201,11 @@ class ModelToElasticaAutoTransformerTest extends \PHPUnit_Framework_TestCase $this->assertTrue(array_key_exists('nullValue', $data)); } + /** + * @expectedException Symfony\Component\PropertyAccess\Exception\RuntimeException + */ public function testThatCannotTransformObjectWhenGetterDoesNotExistForPrivateMethod() { - $this->setExpectedException('Symfony\Component\PropertyAccess\Exception\ExceptionInterface'); - $transformer = $this->getTransformer(); $transformer->transform(new POPO(), array('desc' => array())); }