class TestHttpKernel in Zircon Profile 8.0
Same name in this branch
- 8.0 vendor/symfony/http-kernel/Tests/TestHttpKernel.php \Symfony\Component\HttpKernel\Tests\TestHttpKernel
- 8.0 vendor/symfony/http-kernel/Tests/HttpCache/TestHttpKernel.php \Symfony\Component\HttpKernel\Tests\HttpCache\TestHttpKernel
Same name and namespace in other branches
- 8 vendor/symfony/http-kernel/Tests/HttpCache/TestHttpKernel.php \Symfony\Component\HttpKernel\Tests\HttpCache\TestHttpKernel
Hierarchy
- class \Symfony\Component\HttpKernel\HttpKernel implements HttpKernelInterface, TerminableInterface
- class \Symfony\Component\HttpKernel\Tests\HttpCache\TestHttpKernel implements ControllerResolverInterface
Expanded class hierarchy of TestHttpKernel
File
- vendor/
symfony/ http-kernel/ Tests/ HttpCache/ TestHttpKernel.php, line 21
Namespace
Symfony\Component\HttpKernel\Tests\HttpCacheView source
class TestHttpKernel extends HttpKernel implements ControllerResolverInterface {
protected $body;
protected $status;
protected $headers;
protected $called = false;
protected $customizer;
protected $catch = false;
protected $backendRequest;
public function __construct($body, $status, $headers, \Closure $customizer = null) {
$this->body = $body;
$this->status = $status;
$this->headers = $headers;
$this->customizer = $customizer;
parent::__construct(new EventDispatcher(), $this);
}
public function getBackendRequest() {
return $this->backendRequest;
}
public function handle(Request $request, $type = HttpKernelInterface::MASTER_REQUEST, $catch = false) {
$this->catch = $catch;
$this->backendRequest = $request;
return parent::handle($request, $type, $catch);
}
public function isCatchingExceptions() {
return $this->catch;
}
public function getController(Request $request) {
return array(
$this,
'callController',
);
}
public function getArguments(Request $request, $controller) {
return array(
$request,
);
}
public function callController(Request $request) {
$this->called = true;
$response = new Response($this->body, $this->status, $this->headers);
if (null !== ($customizer = $this->customizer)) {
$customizer($request, $response);
}
return $response;
}
public function hasBeenCalled() {
return $this->called;
}
public function reset() {
$this->called = false;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
HttpKernel:: |
protected | property | ||
HttpKernel:: |
protected | property | ||
HttpKernel:: |
protected | property | ||
HttpKernel:: |
private | function | Filters a response object. | |
HttpKernel:: |
private | function | Publishes the finish request event, then pop the request from the stack. | |
HttpKernel:: |
private | function | Handles an exception by trying to convert it to a Response. | |
HttpKernel:: |
private | function | Handles a request to convert it to a response. | |
HttpKernel:: |
public | function |
Terminates a request/response cycle. Overrides TerminableInterface:: |
|
HttpKernel:: |
public | function | @internal | |
HttpKernel:: |
private | function | ||
HttpKernelInterface:: |
constant | |||
HttpKernelInterface:: |
constant | |||
TestHttpKernel:: |
protected | property | ||
TestHttpKernel:: |
protected | property | ||
TestHttpKernel:: |
protected | property | ||
TestHttpKernel:: |
protected | property | ||
TestHttpKernel:: |
protected | property | ||
TestHttpKernel:: |
protected | property | ||
TestHttpKernel:: |
protected | property | ||
TestHttpKernel:: |
public | function | ||
TestHttpKernel:: |
public | function |
Returns the arguments to pass to the controller. Overrides ControllerResolverInterface:: |
|
TestHttpKernel:: |
public | function | ||
TestHttpKernel:: |
public | function |
Returns the Controller instance associated with a Request. Overrides ControllerResolverInterface:: |
|
TestHttpKernel:: |
public | function |
Handles a Request to convert it to a Response. Overrides HttpKernel:: |
|
TestHttpKernel:: |
public | function | ||
TestHttpKernel:: |
public | function | ||
TestHttpKernel:: |
public | function | ||
TestHttpKernel:: |
public | function |
Constructor. Overrides HttpKernel:: |