use PHPUnit\Framework\TestCase;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\HttpCache\Esi;
use Symfony\Component\HttpKernel\HttpCache\HttpCache;
class EsiTest extends TestCase
{ public function testHasSurrogateEsiCapability() { $esi =
new Esi();
$request = Request::
create('/'
);
$request->headers->
set('Surrogate-Capability', 'abc="ESI/1.0"'
);
$this->
assertTrue($esi->
hasSurrogateCapability($request));
$request = Request::
create('/'
);
$request->headers->
set('Surrogate-Capability', 'foobar'
);
$this->
assertFalse($esi->
hasSurrogateCapability($request));
$request = Request::
create('/'
);
$this->
assertFalse($esi->
hasSurrogateCapability($request));
}