-
Notifications
You must be signed in to change notification settings - Fork 23
/
LocalPurgeClientTest.php
40 lines (33 loc) · 1.07 KB
/
LocalPurgeClientTest.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?php
/**
* @copyright Copyright (C) eZ Systems AS. All rights reserved.
* @license For full copyright and license information view LICENSE file distributed with this source code.
*/
namespace eZ\Publish\Core\MVC\Symfony\Cache\Tests;
use EzSystems\PlatformHttpCacheBundle\PurgeClient\LocalPurgeClient;
use PHPUnit\Framework\TestCase;
use Toflar\Psr6HttpCacheStore\Psr6StoreInterface;
class LocalPurgeClientTest extends TestCase
{
/** @var \PHPUnit\Framework\MockObject\MockObject|\Toflar\Psr6HttpCacheStore\Psr6StoreInterface */
private $store;
protected function setUp(): void
{
parent::setUp();
$this->store = $this->createMock(Psr6StoreInterface::class);
}
public function testPurge()
{
$keys = array_map(static function ($id) {
return "l$id";
},
[123, 456, 789]
);
$this->store
->expects($this->once())
->method('invalidateTags')
->with($keys);
$purgeClient = new LocalPurgeClient($this->store);
$purgeClient->purge($keys);
}
}