Skip to content

Commit

Permalink
moved getProfile() from the WebTestCase to the Client
Browse files Browse the repository at this point in the history
  • Loading branch information
fabpot committed Jun 25, 2010
1 parent 763a99e commit 220f8ce
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 16 deletions.
14 changes: 14 additions & 0 deletions src/Symfony/Foundation/Client.php
Expand Up @@ -62,6 +62,20 @@ public function getKernel()
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.
*
Expand Down
16 changes: 0 additions & 16 deletions src/Symfony/Framework/FoundationBundle/Test/WebTestCase.php
Expand Up @@ -24,22 +24,6 @@
*/
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.
*
Expand Down

0 comments on commit 220f8ce

Please sign in to comment.