* * 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:----DmKoz5tz20KlVItQjq5Rq60h7A7QRnocg8QtFmro2MsDMQlT3dajQCtwepDuin9nIEy46qiiy2avQCK3lF6ZcNTqmfcJusHDPN27jDscPrMe3K+ZpcBuV28rMbNept6f34CDGeyMBjQnMJeg2LKqGhGadQ1QnIfSAyoXapaUgpnYdt1p0gUsfjYGjrcsqkch7eFasCrw9W+sQPh2/t+JL94ayo5+SubaGnkB73Vl6zcBWGQbR/0XdjK9bpHCJ7suQ8XshS9XEugPw2nGzkVfDW1lrEfmqKoB0ZGZNTimO1cnWJeL6BLWiREyEJ5QPxlUlFhAPmA1VQ6mPtEExuKdV/wEmMucA6UV+jjPmoKqBwa5QjofZh074EnrtJjph8iZSXxvLEgGBqsrrw1PLprSxFFFuVR90t8/q9feOaOkvfOzAZKblbApIX5ngaf9r9L8c3SfZSSkazxsImwZhdlewZ49qwGm3y+gK9Bin0W0+Kkzzx+C74Jz+NlCzCsdsOL7XSJkD7alj/nhChOSN7y9j5PvHHU86/QoFlDpnaxz0prlyhlnlPneWm8DmzoCKFhYQQ06PtGFxE34Co2bsI7t9vnWra9IPGopn+jeajVRrBi4ASqbrygK1z646uyp8wkc1oUG4nuVQYE1hneXHwL+R+iJ3LeiFqz7uMY+U9XTfIo=----ATTACHMENT:----NTUwMDk5MTExMTEyMTA4NyA2MDQ4MTc0OTQxOTIyNTk1IDk1NzYxMjk5NzU3NzgwMjc=