From bf92a40171e98c47a9c607bcded37daa0cb89a93 Mon Sep 17 00:00:00 2001 From: Adam Prager Date: Fri, 19 Apr 2013 14:49:32 +0200 Subject: [PATCH] skip test if php 5.3 --- .../Tests/ORM/Tools/EntityGeneratorTest.php | 42 ++++++++++--------- 1 file changed, 22 insertions(+), 20 deletions(-) diff --git a/tests/Doctrine/Tests/ORM/Tools/EntityGeneratorTest.php b/tests/Doctrine/Tests/ORM/Tools/EntityGeneratorTest.php index bdf2090ef..f687d06ed 100644 --- a/tests/Doctrine/Tests/ORM/Tools/EntityGeneratorTest.php +++ b/tests/Doctrine/Tests/ORM/Tools/EntityGeneratorTest.php @@ -458,27 +458,29 @@ class EntityGeneratorTest extends \Doctrine\Tests\OrmTestCase */ public function testTraitPropertiesAndMethodsAreNotDuplicated() { - if (PHP_VERSION_ID >= 50400) { - $cmf = new ClassMetadataFactory(); - $em = $this->_getTestEntityManager(); - $cmf->setEntityManager($em); - - $user = new DDC2372User(); - $metadata = $cmf->getMetadataFor(get_class($user)); - $metadata->name = $this->_namespace . "\DDC2372User"; - $metadata->namespace = $this->_namespace; - - $this->_generator->writeEntityClass($metadata, $this->_tmpDir); - - $this->assertFileExists($this->_tmpDir . "/" . $this->_namespace . "/DDC2372User.php"); - require $this->_tmpDir . "/" . $this->_namespace . "/DDC2372User.php"; - - $reflClass = new \ReflectionClass($metadata->name); - - $this->assertSame($reflClass->hasProperty('address'), false); - $this->assertSame($reflClass->hasMethod('setAddress'), false); - $this->assertSame($reflClass->hasMethod('getAddress'), false); + if (PHP_VERSION_ID < 50400) { + $this->markTestSkipped('Traits are not available before php 5.4.'); } + + $cmf = new ClassMetadataFactory(); + $em = $this->_getTestEntityManager(); + $cmf->setEntityManager($em); + + $user = new DDC2372User(); + $metadata = $cmf->getMetadataFor(get_class($user)); + $metadata->name = $this->_namespace . "\DDC2372User"; + $metadata->namespace = $this->_namespace; + + $this->_generator->writeEntityClass($metadata, $this->_tmpDir); + + $this->assertFileExists($this->_tmpDir . "/" . $this->_namespace . "/DDC2372User.php"); + require $this->_tmpDir . "/" . $this->_namespace . "/DDC2372User.php"; + + $reflClass = new \ReflectionClass($metadata->name); + + $this->assertSame($reflClass->hasProperty('address'), false); + $this->assertSame($reflClass->hasMethod('setAddress'), false); + $this->assertSame($reflClass->hasMethod('getAddress'), false); } /**