From e263426cdf3ccb784f17f505d24255064c575f40 Mon Sep 17 00:00:00 2001 From: Marco Pivetta Date: Thu, 10 Apr 2014 03:30:46 +0200 Subject: [PATCH 1/5] Removing eager assertion on error suppression when generating schema via tools --- tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2862Test.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2862Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2862Test.php index 325a9ad571c..4f322a9a169 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2862Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2862Test.php @@ -1,6 +1,7 @@ _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) { } } From abb4671bfc7086f079aa00a3c684d41399987a47 Mon Sep 17 00:00:00 2001 From: Marco Pivetta Date: Thu, 10 Apr 2014 03:42:11 +0200 Subject: [PATCH 2/5] Removing usage of memcache cache in tests (HHVM gets stuck on them on local setups) --- .../ORM/Functional/Ticket/DDC742Test.php | 44 ++++++++++++------- 1 file changed, 29 insertions(+), 15 deletions(-) diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC742Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC742Test.php index ad4fad95beb..cdef5aa42c1 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC742Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC742Test.php @@ -2,6 +2,7 @@ namespace Doctrine\Tests\ORM\Functional\Ticket; +use Doctrine\Common\Cache\FilesystemCache; use Doctrine\Common\Collections\ArrayCollection; /** @@ -9,27 +10,32 @@ */ class DDC742Test extends \Doctrine\Tests\OrmFunctionalTestCase { - private $userCm; - private $commentCm; + /** + * @var string + */ + private $testDir; + + /** + * @var FilesystemCache + */ + private $cache; + /** + * {@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.'); - } + $this->testDir = $testDir; + $this->cache = new FilesystemCache($testDir); + + // using a Filesystemcache to ensure that the cached data is serialized + $this->_em->getMetadataFactory()->setCacheDriver($this->cache); try { $this->_schemaTool->createSchema(array( @@ -37,7 +43,6 @@ protected function setUp() $this->_em->getClassMetadata(__NAMESPACE__ . '\DDC742Comment') )); } catch(\Exception $e) { - } // make sure classes will be deserialized from caches @@ -45,6 +50,15 @@ protected function setUp() $this->_em->getMetadataFactory()->setMetadataFor(__NAMESPACE__ . '\DDC742Comment', null); } + /** + * {@inheritDoc} + */ + protected function tearDown() + { + $this->cache->deleteAll(); + rmdir($this->testDir); + } + public function testIssue() { $user = new DDC742User(); From b4933d76c7d865f3b020fa8f3203ec4306ff62bb Mon Sep 17 00:00:00 2001 From: Marco Pivetta Date: Thu, 10 Apr 2014 03:54:41 +0200 Subject: [PATCH 3/5] HHVM tests are not allowed to fail anymore --- .travis.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 7894ea3a499..74cd837b08e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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 From 9ab6ef723aba28935f6b45bc4c4d890f9927732b Mon Sep 17 00:00:00 2001 From: Marco Pivetta Date: Thu, 10 Apr 2014 04:54:41 +0200 Subject: [PATCH 4/5] Removing too eager cache tests --- .../ORM/Functional/Ticket/DDC742Test.php | 24 +------------------ 1 file changed, 1 insertion(+), 23 deletions(-) diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC742Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC742Test.php index cdef5aa42c1..47ba185642d 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC742Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC742Test.php @@ -10,16 +10,6 @@ */ class DDC742Test extends \Doctrine\Tests\OrmFunctionalTestCase { - /** - * @var string - */ - private $testDir; - - /** - * @var FilesystemCache - */ - private $cache; - /** * {@inheritDoc} */ @@ -31,11 +21,8 @@ protected function setUp() mkdir($testDir); - $this->testDir = $testDir; - $this->cache = new FilesystemCache($testDir); - // using a Filesystemcache to ensure that the cached data is serialized - $this->_em->getMetadataFactory()->setCacheDriver($this->cache); + $this->_em->getMetadataFactory()->setCacheDriver(new FilesystemCache($testDir)); try { $this->_schemaTool->createSchema(array( @@ -50,15 +37,6 @@ protected function setUp() $this->_em->getMetadataFactory()->setMetadataFor(__NAMESPACE__ . '\DDC742Comment', null); } - /** - * {@inheritDoc} - */ - protected function tearDown() - { - $this->cache->deleteAll(); - rmdir($this->testDir); - } - public function testIssue() { $user = new DDC742User(); From e1259098f55f916c862fe039498be334d9133855 Mon Sep 17 00:00:00 2001 From: Marco Pivetta Date: Thu, 10 Apr 2014 18:46:39 +0200 Subject: [PATCH 5/5] Fixed whitespace around imported classes --- tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2862Test.php | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2862Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2862Test.php index 4f322a9a169..28535a3d722 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2862Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2862Test.php @@ -1,6 +1,7 @@