/** * @covers eZ\Publish\Core\MVC\Symfony\Cache\Http\LocalPurgeClient::__construct * @covers eZ\Publish\Core\MVC\Symfony\Cache\Http\LocalPurgeClient::purge */ public function testPurge() { $cacheStore = $this->getMock('eZ\\Publish\\Core\\MVC\\Symfony\\Cache\\Http\\ContentPurger'); $cacheStore->expects($this->once())->method('purgeByRequest')->with($this->isInstanceOf('Symfony\\Component\\HttpFoundation\\Request')); $purgeClient = new LocalPurgeClient($cacheStore); $purgeClient->purge(array(123, 456, 789)); }
public function testPurge() { $locationIds = array(123, 456, 789); $expectedBanRequest = Request::create('http://localhost', 'BAN'); $expectedBanRequest->headers->set('X-Location-Id', '(' . implode('|', $locationIds) . ')'); $cacheStore = $this->getMock('eZ\\Publish\\Core\\MVC\\Symfony\\Cache\\Http\\ContentPurger'); $cacheStore->expects($this->once())->method('purgeByRequest')->with($this->equalTo($expectedBanRequest)); $purgeClient = new LocalPurgeClient($cacheStore); $purgeClient->purge($locationIds); }