Merge pull request #1009 from doctrine/feature/hhvm-tests
HHVM compatibility
This commit is contained in:
commit
54d9f05e39
@ -27,8 +27,6 @@ after_script:
|
|||||||
- php vendor/bin/coveralls -v
|
- php vendor/bin/coveralls -v
|
||||||
|
|
||||||
matrix:
|
matrix:
|
||||||
allow_failures:
|
|
||||||
- php: hhvm
|
|
||||||
exclude:
|
exclude:
|
||||||
- php: hhvm
|
- php: hhvm
|
||||||
env: DB=pgsql # driver currently unsupported by HHVM
|
env: DB=pgsql # driver currently unsupported by HHVM
|
||||||
|
@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
namespace Doctrine\Tests\ORM\Functional\Ticket;
|
namespace Doctrine\Tests\ORM\Functional\Ticket;
|
||||||
|
|
||||||
|
use Doctrine\ORM\Tools\ToolsException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @group DDC-2862
|
* @group DDC-2862
|
||||||
* @group DDC-2183
|
* @group DDC-2183
|
||||||
@ -18,8 +20,7 @@ class DDC2862Test extends \Doctrine\Tests\OrmFunctionalTestCase
|
|||||||
$this->_em->getClassMetadata(DDC2862User::CLASSNAME),
|
$this->_em->getClassMetadata(DDC2862User::CLASSNAME),
|
||||||
$this->_em->getClassMetadata(DDC2862Driver::CLASSNAME),
|
$this->_em->getClassMetadata(DDC2862Driver::CLASSNAME),
|
||||||
));
|
));
|
||||||
} catch (\Doctrine\ORM\Tools\ToolsException $exc) {
|
} catch (ToolsException $exc) {
|
||||||
$this->assertInstanceOf('Doctrine\DBAL\Exception\TableExistsException', $exc->getPrevious());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
namespace Doctrine\Tests\ORM\Functional\Ticket;
|
namespace Doctrine\Tests\ORM\Functional\Ticket;
|
||||||
|
|
||||||
|
use Doctrine\Common\Cache\FilesystemCache;
|
||||||
use Doctrine\Common\Collections\ArrayCollection;
|
use Doctrine\Common\Collections\ArrayCollection;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -9,27 +10,19 @@ use Doctrine\Common\Collections\ArrayCollection;
|
|||||||
*/
|
*/
|
||||||
class DDC742Test extends \Doctrine\Tests\OrmFunctionalTestCase
|
class DDC742Test extends \Doctrine\Tests\OrmFunctionalTestCase
|
||||||
{
|
{
|
||||||
private $userCm;
|
/**
|
||||||
private $commentCm;
|
* {@inheritDoc}
|
||||||
|
*/
|
||||||
protected function setUp()
|
protected function setUp()
|
||||||
{
|
{
|
||||||
parent::setUp();
|
parent::setUp();
|
||||||
|
|
||||||
if (\extension_loaded('memcache') && @fsockopen('localhost', 11211)) {
|
$testDir = sys_get_temp_dir() . '/DDC742Test' . uniqid();
|
||||||
$memcache = new \Memcache();
|
|
||||||
$memcache->addServer('localhost');
|
|
||||||
$memcache->flush();
|
|
||||||
|
|
||||||
$cacheDriver = new \Doctrine\Common\Cache\MemcacheCache();
|
mkdir($testDir);
|
||||||
$cacheDriver->setMemcache($memcache);
|
|
||||||
|
|
||||||
$this->_em->getMetadataFactory()->setCacheDriver($cacheDriver);
|
// using a Filesystemcache to ensure that the cached data is serialized
|
||||||
} else if (\extension_loaded('apc')) {
|
$this->_em->getMetadataFactory()->setCacheDriver(new FilesystemCache($testDir));
|
||||||
$this->_em->getMetadataFactory()->setCacheDriver(new \Doctrine\Common\Cache\ApcCache());
|
|
||||||
} else {
|
|
||||||
$this->markTestSkipped('Test only works with a cache enabled.');
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$this->_schemaTool->createSchema(array(
|
$this->_schemaTool->createSchema(array(
|
||||||
@ -37,7 +30,6 @@ class DDC742Test extends \Doctrine\Tests\OrmFunctionalTestCase
|
|||||||
$this->_em->getClassMetadata(__NAMESPACE__ . '\DDC742Comment')
|
$this->_em->getClassMetadata(__NAMESPACE__ . '\DDC742Comment')
|
||||||
));
|
));
|
||||||
} catch(\Exception $e) {
|
} catch(\Exception $e) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// make sure classes will be deserialized from caches
|
// make sure classes will be deserialized from caches
|
||||||
|
Loading…
x
Reference in New Issue
Block a user