moved getProfile() from the WebTestCase to the Client
This commit is contained in:
parent
763a99e368
commit
220f8cecec
@ -62,6 +62,20 @@ class Client extends BaseClient
|
|||||||
return $this->kernel;
|
return $this->kernel;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets a profiler for the current Response.
|
||||||
|
*
|
||||||
|
* @return Symfony\Components\HttpKernel\Profiler\Profiler A Profiler instance
|
||||||
|
*/
|
||||||
|
public function getProfiler()
|
||||||
|
{
|
||||||
|
if (!$this->container->hasService('profiler')) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this->container->getProfilerService()->load($this->response);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Makes a request.
|
* Makes a request.
|
||||||
*
|
*
|
||||||
|
@ -24,22 +24,6 @@ use Symfony\Components\HttpKernel\Response;
|
|||||||
*/
|
*/
|
||||||
abstract class WebTestCase extends BaseWebTestCase
|
abstract class WebTestCase extends BaseWebTestCase
|
||||||
{
|
{
|
||||||
/**
|
|
||||||
* Gets a profiler for the given Response.
|
|
||||||
*
|
|
||||||
* @param Symfony\Components\HttpKernel\Response $response A Response instance
|
|
||||||
*
|
|
||||||
* @return Symfony\Components\HttpKernel\Profiler\Profiler A Profiler instance
|
|
||||||
*/
|
|
||||||
public function getProfiler(Response $response)
|
|
||||||
{
|
|
||||||
$container = $this->kernel->getContainer();
|
|
||||||
|
|
||||||
if ($container->hasService('profiler')) {
|
|
||||||
return $container->getProfilerService()->load($response);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a Kernel.
|
* Creates a Kernel.
|
||||||
*
|
*
|
||||||
|
Reference in New Issue
Block a user