diff --git a/src/Symfony/Foundation/Client.php b/src/Symfony/Foundation/Client.php index 3690dc0fb0..1c3fef7863 100644 --- a/src/Symfony/Foundation/Client.php +++ b/src/Symfony/Foundation/Client.php @@ -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. * diff --git a/src/Symfony/Framework/FoundationBundle/Test/WebTestCase.php b/src/Symfony/Framework/FoundationBundle/Test/WebTestCase.php index ee9be6c52b..73b11d7ec6 100644 --- a/src/Symfony/Framework/FoundationBundle/Test/WebTestCase.php +++ b/src/Symfony/Framework/FoundationBundle/Test/WebTestCase.php @@ -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. *