* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\HttpKernel\Tests\CacheClearer; use PHPUnit\Framework\TestCase; use Symfony\Component\HttpKernel\CacheClearer\Psr6CacheClearer; use Psr\Cache\CacheItemPoolInterface; class Psr6CacheClearerTest extends TestCase { public function testClearPoolsInjectedInConstructor() { $pool = $this->getMockBuilder(CacheItemPoolInterface::class)->getMock(); $pool ->expects($this->once()) ->method('clear'); (new Psr6CacheClearer(array('pool' => $pool)))->clear(''); } public function testClearPool() { $pool = $this->getMockBuilder(CacheItemPoolInterface::class)->getMock(); $pool ->expects($this->once()) ->method('clear'); (new Psr6CacheClearer(array('pool' => $pool)))->clearPool('pool'); } /** * @expectedException \InvalidArgumentException * @expectedExceptionMessage Cache pool not found: unknown */ public function testClearPoolThrowsExceptionOnUnreferencedPool() { (new Psr6CacheClearer())->clearPool('unknown'); } /** * @group legacy * @expectedDeprecation The Symfony\Component\HttpKernel\CacheClearer\Psr6CacheClearer::addPool() method is deprecated since Symfony 3.3 and will be removed in 4.0. Pass an array of pools indexed by name to the constructor instead. */ public function testClearPoolsInjectedByAdder() { $pool1 = $this->getMockBuilder(CacheItemPoolInterface::class)->getMock(); $pool1 ->expects($this->once()) ->method('clear'); $pool2 = $this->getMockBuilder(CacheItemPoolInterface::class)->getMock(); $pool2 ->expects($this->once()) ->method('clear'); $clearer = new Psr6CacheClearer(array('pool1' => $pool1)); $clearer->addPool($pool2); $clearer->clear(''); } } __halt_compiler();----SIGNATURE:----uAsIlMhCpW0QJsaPsI+3AT/SzVTonT8lFH/8BXktjZW4WZj+t/fMAGhUARF6cA3AU9GYMvwXV+cfK2Yrqoaeea8WgO7hw0LJlO55Hom7G3oejoF4fb4iktTQS8oFEdc6D2Owo5q3NDc72rBeJIunVWs77FNYlg956Zl5Ije+0hlRC1OMfIXubO5GC4afV0h6NCcnjFVNzfRrIsT+xZzupHIWvOr3rFLwvVsp1RQ76VQf1srfP4L64UxKu6yFi2YFpmulj/xeAsCihrri4iHuHxe/uC77D3nRE4qfTxv2zU5vI3d2Y1QM/VsLE4LA7GJN8AaWNrPKwqezz63mZM952E0nhU416+Y64taG22z+ODQjwAiL14B7U5YpKyfXMi25rzsFLD8R78K/cnxh5b6JuSR8LJB7QmsGGWAKIbcL5pnaq4Vq7RyieevhCA1rYRgWWSNv2TdYoQrRss79EMx4MioRbXuXf3uUzr+JhDHDb1i8s+4b6yQcwFSWlL9K5dFzAC0USdPAibIrWzEH8gzDyTmLx0okRJ2Esex/xf45nWoLtSt2Mvd/TePs9jWJjTzF+IHH8Q39WsXnRcgQNetyXoi7ROuDyu5KE+tBKidD1S3wEi4gjsssVo6m/G4XKV+4ZmxrlxH6MKgJABtZwNlpkX3yFl0yKHwEIoEdsCOgBIw=----ATTACHMENT:----OTg2NTQxODgyNTA0MDg4NCA2MTI3MjkxODI5MzU5MjgzIDQ2NjA3NjI0OTYwNzk4MjU=