Merge remote branch 'danielholmes/functional_test_changes'

* danielholmes/functional_test_changes:
  [FrameworkBundle] fixed CS
  [FrameworkBundle][HttpKernel] added a default tearDown on the WebTestCase which will shut down the currently used kernel (if there is one) in Web functional tests
This commit is contained in:
Fabien Potencier 2011-05-11 10:33:23 +02:00
commit b7d64c5304
2 changed files with 20 additions and 0 deletions

View File

@ -150,4 +150,14 @@ abstract class WebTestCase extends BaseWebTestCase
isset($options['debug']) ? $options['debug'] : true
);
}
/**
* Shuts the kernel down if it was used in the test
*/
protected function tearDown()
{
if ($this->kernel !== null && $this->kernel->isBooted()) {
$this->kernel->shutdown();
}
}
}

View File

@ -296,6 +296,16 @@ abstract class Kernel implements KernelInterface
{
return $this->name;
}
/**
* Checks if the Kernel is currently booted.
*
* @return Boolean true if kernel is booted, false otherwise
*/
public function isBooted()
{
return $this->booted;
}
/**
* Gets the environment.