Skip to content

Commit

Permalink
Merge pull request #710 from driehle/feature/fix-ci
Browse files Browse the repository at this point in the history
Require orm ^2.11 and adapt cache implementation
  • Loading branch information
driehle authored Feb 4, 2022
2 parents 034c707 + 8514320 commit 19b568d
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
"doctrine/doctrine-laminas-hydrator": "^2.2.1",
"doctrine/doctrine-module": "^4.2.2",
"doctrine/event-manager": "^1.1.1",
"doctrine/orm": "^2.9.6",
"doctrine/orm": "^2.11.1",
"doctrine/persistence": "^2.2.2",
"laminas/laminas-eventmanager": "^3.4.0",
"laminas/laminas-modulemanager": "^2.11.0",
Expand Down
2 changes: 1 addition & 1 deletion src/Service/ConfigurationFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ public function __invoke(ContainerInterface $serviceLocator, $requestedName, ?ar
}

// As Second Level Cache caches queries results, we reuse the result cache impl
$cacheFactory = new DefaultCacheFactory($regionsConfig, $config->getResultCacheImpl());
$cacheFactory = new DefaultCacheFactory($regionsConfig, $config->getResultCache());
$cacheFactory->setFileLockRegionDirectory($secondLevelCache->getFileLockRegionDirectory());

$cacheConfiguration = new CacheConfiguration();
Expand Down
7 changes: 5 additions & 2 deletions tests/Service/ConfigurationFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
namespace DoctrineORMModuleTest\Service;

use Doctrine\Common\Cache\ArrayCache;
use Doctrine\Common\Cache\Psr6\CacheAdapter;
use Doctrine\ORM\Cache\CacheConfiguration;
use Doctrine\ORM\Cache\DefaultCacheFactory;
use Doctrine\ORM\Mapping\ClassMetadataFactory;
Expand Down Expand Up @@ -346,8 +347,10 @@ public function testCanInstantiateWithSecondLevelCacheConfig(): void

// Doctrine does not allow to retrieve the cache adapter from cache factory, so we are forced to use
// reflection here
$reflProperty = new ReflectionProperty($cacheFactory, 'cache');
$reflProperty = new ReflectionProperty($cacheFactory, 'cacheItemPool');
$reflProperty->setAccessible(true);
$this->assertInstanceOf(ArrayCache::class, $reflProperty->getValue($cacheFactory));
$cacheDecorator = $reflProperty->getValue($cacheFactory);
$this->assertInstanceOf(CacheAdapter::class, $cacheDecorator);
$this->assertInstanceOf(ArrayCache::class, $cacheDecorator->getCache());
}
}
1 change: 0 additions & 1 deletion tests/Service/DBALConnectionFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@ public function testDoctrineAddCustomCommentedType(): void
$type = Type::getType($platform->getDoctrineTypeMapping('money'));

$this->assertInstanceOf(MoneyType::class, $type);
$this->assertTrue($platform->isCommentedDoctrineType($type));
}

public function testGettingPlatformFromContainer(): void
Expand Down

0 comments on commit 19b568d

Please sign in to comment.