Пример #1
0
 public function testClearRequest()
 {
     $response = new Response();
     $response->error = '';
     $response->content = "Some header\r\n\r\n" . serialize(array());
     Phake::when($this->fastCgiConnection)->request(Phake::anyParameters())->thenReturn($response);
     $connector = new Connector($this->fastCgiClient);
     $connector->clearCache();
     /** @var Request $request */
     $request = null;
     Phake::verify($this->fastCgiConnection, Phake::times(1))->request(Phake::capture($request));
     $this->assertContains('cache-control.clear', $request->parameters['SCRIPT_FILENAME']);
 }
Пример #2
0
<?php

use Crunch\CacheControl\Connector;
use Crunch\FastCGI\Client;
require_once __DIR__ . '/../vendor/autoload.php';
$apc = new Connector(new Client('unix:///var/run/php5-fpm.sock', null));
var_dump($apc->clearCache());