Bläddra i källkod

made a slight change to the previous merge

Fabien Potencier 14 år sedan
förälder
incheckning
e2df25b43a

+ 3 - 3
src/Symfony/Bundle/FrameworkBundle/Test/WebTestCase.php

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

+ 4 - 10
src/Symfony/Component/HttpKernel/Kernel.php

@@ -121,6 +121,10 @@ abstract class Kernel implements KernelInterface
      */
     public function shutdown()
     {
+        if (false === $this->booted) {
+            return;
+        }
+
         $this->booted = false;
 
         foreach ($this->getBundles() as $bundle) {
@@ -296,16 +300,6 @@ 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.