moved getProfile() from the WebTestCase to the Client

This commit is contained in:
Fabien Potencier 2010-06-25 16:13:07 +02:00
parent 763a99e368
commit 220f8cecec
2 changed files with 14 additions and 16 deletions

View File

@ -62,6 +62,20 @@ class Client extends BaseClient
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.
*

View File

@ -24,22 +24,6 @@ use Symfony\Components\HttpKernel\Response;
*/
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.
*