Skip to content
This repository has been archived by the owner on Jun 1, 2023. It is now read-only.

Commit

Permalink
Merge pull request doctrine#1009 from doctrine/feature/hhvm-tests
Browse files Browse the repository at this point in the history
HHVM compatibility
  • Loading branch information
FabioBatSilva committed Apr 17, 2014
2 parents 6af3236 + e125909 commit 54d9f05
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 20 deletions.
2 changes: 0 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ after_script:
- php vendor/bin/coveralls -v

matrix:
allow_failures:
- php: hhvm
exclude:
- php: hhvm
env: DB=pgsql # driver currently unsupported by HHVM
Expand Down
5 changes: 3 additions & 2 deletions tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2862Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

namespace Doctrine\Tests\ORM\Functional\Ticket;

use Doctrine\ORM\Tools\ToolsException;

/**
* @group DDC-2862
* @group DDC-2183
Expand All @@ -18,8 +20,7 @@ public function setUp()
$this->_em->getClassMetadata(DDC2862User::CLASSNAME),
$this->_em->getClassMetadata(DDC2862Driver::CLASSNAME),
));
} catch (\Doctrine\ORM\Tools\ToolsException $exc) {
$this->assertInstanceOf('Doctrine\DBAL\Exception\TableExistsException', $exc->getPrevious());
} catch (ToolsException $exc) {
}
}

Expand Down
24 changes: 8 additions & 16 deletions tests/Doctrine/Tests/ORM/Functional/Ticket/DDC742Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,42 +2,34 @@

namespace Doctrine\Tests\ORM\Functional\Ticket;

use Doctrine\Common\Cache\FilesystemCache;
use Doctrine\Common\Collections\ArrayCollection;

/**
* @group non-cacheable
*/
class DDC742Test extends \Doctrine\Tests\OrmFunctionalTestCase
{
private $userCm;
private $commentCm;

/**
* {@inheritDoc}
*/
protected function setUp()
{
parent::setUp();

if (\extension_loaded('memcache') && @fsockopen('localhost', 11211)) {
$memcache = new \Memcache();
$memcache->addServer('localhost');
$memcache->flush();
$testDir = sys_get_temp_dir() . '/DDC742Test' . uniqid();

$cacheDriver = new \Doctrine\Common\Cache\MemcacheCache();
$cacheDriver->setMemcache($memcache);
mkdir($testDir);

$this->_em->getMetadataFactory()->setCacheDriver($cacheDriver);
} else if (\extension_loaded('apc')) {
$this->_em->getMetadataFactory()->setCacheDriver(new \Doctrine\Common\Cache\ApcCache());
} else {
$this->markTestSkipped('Test only works with a cache enabled.');
}
// using a Filesystemcache to ensure that the cached data is serialized
$this->_em->getMetadataFactory()->setCacheDriver(new FilesystemCache($testDir));

try {
$this->_schemaTool->createSchema(array(
$this->_em->getClassMetadata(__NAMESPACE__ . '\DDC742User'),
$this->_em->getClassMetadata(__NAMESPACE__ . '\DDC742Comment')
));
} catch(\Exception $e) {

}

// make sure classes will be deserialized from caches
Expand Down

0 comments on commit 54d9f05

Please sign in to comment.