Skip to content

Commit 30a501c

Browse files
committed
Allow Doctrine Cache 2
1 parent df46dc8 commit 30a501c

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

Tests/Domain/DoctrineAclCacheTest.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,16 @@
1111

1212
namespace Symfony\Component\Security\Acl\Tests\Domain;
1313

14-
use Doctrine\Common\Cache\ArrayCache;
14+
use Doctrine\Common\Cache\Psr6\DoctrineProvider;
15+
use PHPUnit\Framework\TestCase;
16+
use Symfony\Component\Cache\Adapter\ArrayAdapter;
1517
use Symfony\Component\Security\Acl\Domain\Acl;
1618
use Symfony\Component\Security\Acl\Domain\DoctrineAclCache;
1719
use Symfony\Component\Security\Acl\Domain\ObjectIdentity;
1820
use Symfony\Component\Security\Acl\Domain\PermissionGrantingStrategy;
1921
use Symfony\Component\Security\Acl\Domain\UserSecurityIdentity;
2022

21-
class DoctrineAclCacheTest extends \PHPUnit\Framework\TestCase
23+
class DoctrineAclCacheTest extends TestCase
2224
{
2325
protected $permissionGrantingStrategy;
2426

@@ -29,7 +31,7 @@ public function testConstructorDoesNotAcceptEmptyPrefix($empty)
2931
{
3032
$this->expectException(\InvalidArgumentException::class);
3133

32-
new DoctrineAclCache(new ArrayCache(), $this->getPermissionGrantingStrategy(), $empty);
34+
new DoctrineAclCache(DoctrineProvider::wrap(new ArrayAdapter()), $this->getPermissionGrantingStrategy(), $empty);
3335
}
3436

3537
public function getEmptyValue()
@@ -94,7 +96,7 @@ protected function getPermissionGrantingStrategy()
9496
protected function getCache($cacheDriver = null, $prefix = DoctrineAclCache::PREFIX)
9597
{
9698
if (null === $cacheDriver) {
97-
$cacheDriver = new ArrayCache();
99+
$cacheDriver = DoctrineProvider::wrap(new ArrayAdapter());
98100
}
99101

100102
return new DoctrineAclCache($cacheDriver, $this->getPermissionGrantingStrategy(), $prefix);

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"symfony/cache": "^4.4|^5.0|^6.0",
2424
"symfony/finder": "^4.4|^5.0|^6.0",
2525
"symfony/phpunit-bridge": "^5.2|^6.0",
26-
"doctrine/cache": "^1.6",
26+
"doctrine/cache": "^1.11|^2.0",
2727
"doctrine/common": "^2.2|^3",
2828
"doctrine/persistence": "^1.3.3|^2",
2929
"doctrine/dbal": "^2.13.1|^3.1",
@@ -36,6 +36,7 @@
3636
]
3737
},
3838
"conflict": {
39+
"doctrine/cache": "<1.11",
3940
"doctrine/dbal": "<2.13.1|~3.0.0"
4041
},
4142
"extra": {

0 commit comments

Comments
 (0)