Skip to content

Commit

Permalink
Allow Doctrine Cache 2
Browse files Browse the repository at this point in the history
  • Loading branch information
derrabus committed May 19, 2021
1 parent df46dc8 commit 30a501c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
10 changes: 6 additions & 4 deletions Tests/Domain/DoctrineAclCacheTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,16 @@

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

use Doctrine\Common\Cache\ArrayCache;
use Doctrine\Common\Cache\Psr6\DoctrineProvider;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Cache\Adapter\ArrayAdapter;
use Symfony\Component\Security\Acl\Domain\Acl;
use Symfony\Component\Security\Acl\Domain\DoctrineAclCache;
use Symfony\Component\Security\Acl\Domain\ObjectIdentity;
use Symfony\Component\Security\Acl\Domain\PermissionGrantingStrategy;
use Symfony\Component\Security\Acl\Domain\UserSecurityIdentity;

class DoctrineAclCacheTest extends \PHPUnit\Framework\TestCase
class DoctrineAclCacheTest extends TestCase
{
protected $permissionGrantingStrategy;

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

new DoctrineAclCache(new ArrayCache(), $this->getPermissionGrantingStrategy(), $empty);
new DoctrineAclCache(DoctrineProvider::wrap(new ArrayAdapter()), $this->getPermissionGrantingStrategy(), $empty);
}

public function getEmptyValue()
Expand Down Expand Up @@ -94,7 +96,7 @@ protected function getPermissionGrantingStrategy()
protected function getCache($cacheDriver = null, $prefix = DoctrineAclCache::PREFIX)
{
if (null === $cacheDriver) {
$cacheDriver = new ArrayCache();
$cacheDriver = DoctrineProvider::wrap(new ArrayAdapter());
}

return new DoctrineAclCache($cacheDriver, $this->getPermissionGrantingStrategy(), $prefix);
Expand Down
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"symfony/cache": "^4.4|^5.0|^6.0",
"symfony/finder": "^4.4|^5.0|^6.0",
"symfony/phpunit-bridge": "^5.2|^6.0",
"doctrine/cache": "^1.6",
"doctrine/cache": "^1.11|^2.0",
"doctrine/common": "^2.2|^3",
"doctrine/persistence": "^1.3.3|^2",
"doctrine/dbal": "^2.13.1|^3.1",
Expand All @@ -36,6 +36,7 @@
]
},
"conflict": {
"doctrine/cache": "<1.11",
"doctrine/dbal": "<2.13.1|~3.0.0"
},
"extra": {
Expand Down

0 comments on commit 30a501c

Please sign in to comment.