Skip to content

Commit 19b568d

Browse files
authored
Merge pull request #710 from driehle/feature/fix-ci
Require orm ^2.11 and adapt cache implementation
2 parents 034c707 + 8514320 commit 19b568d

File tree

4 files changed

+7
-5
lines changed

4 files changed

+7
-5
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
"doctrine/doctrine-laminas-hydrator": "^2.2.1",
5353
"doctrine/doctrine-module": "^4.2.2",
5454
"doctrine/event-manager": "^1.1.1",
55-
"doctrine/orm": "^2.9.6",
55+
"doctrine/orm": "^2.11.1",
5656
"doctrine/persistence": "^2.2.2",
5757
"laminas/laminas-eventmanager": "^3.4.0",
5858
"laminas/laminas-modulemanager": "^2.11.0",

src/Service/ConfigurationFactory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ public function __invoke(ContainerInterface $serviceLocator, $requestedName, ?ar
136136
}
137137

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

142142
$cacheConfiguration = new CacheConfiguration();

tests/Service/ConfigurationFactoryTest.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
namespace DoctrineORMModuleTest\Service;
66

77
use Doctrine\Common\Cache\ArrayCache;
8+
use Doctrine\Common\Cache\Psr6\CacheAdapter;
89
use Doctrine\ORM\Cache\CacheConfiguration;
910
use Doctrine\ORM\Cache\DefaultCacheFactory;
1011
use Doctrine\ORM\Mapping\ClassMetadataFactory;
@@ -346,8 +347,10 @@ public function testCanInstantiateWithSecondLevelCacheConfig(): void
346347

347348
// Doctrine does not allow to retrieve the cache adapter from cache factory, so we are forced to use
348349
// reflection here
349-
$reflProperty = new ReflectionProperty($cacheFactory, 'cache');
350+
$reflProperty = new ReflectionProperty($cacheFactory, 'cacheItemPool');
350351
$reflProperty->setAccessible(true);
351-
$this->assertInstanceOf(ArrayCache::class, $reflProperty->getValue($cacheFactory));
352+
$cacheDecorator = $reflProperty->getValue($cacheFactory);
353+
$this->assertInstanceOf(CacheAdapter::class, $cacheDecorator);
354+
$this->assertInstanceOf(ArrayCache::class, $cacheDecorator->getCache());
352355
}
353356
}

tests/Service/DBALConnectionFactoryTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,6 @@ public function testDoctrineAddCustomCommentedType(): void
122122
$type = Type::getType($platform->getDoctrineTypeMapping('money'));
123123

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

128127
public function testGettingPlatformFromContainer(): void

0 commit comments

Comments
 (0)