1
0
mirror of synced 2024-12-14 15:16:04 +03:00

skip test if php 5.3

This commit is contained in:
Adam Prager 2013-04-19 14:49:32 +02:00
parent b7b107b08a
commit bf92a40171

View File

@ -458,27 +458,29 @@ class EntityGeneratorTest extends \Doctrine\Tests\OrmTestCase
*/ */
public function testTraitPropertiesAndMethodsAreNotDuplicated() public function testTraitPropertiesAndMethodsAreNotDuplicated()
{ {
if (PHP_VERSION_ID >= 50400) { if (PHP_VERSION_ID < 50400) {
$cmf = new ClassMetadataFactory(); $this->markTestSkipped('Traits are not available before php 5.4.');
$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);
} }
$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);
} }
/** /**