summaryrefslogtreecommitdiff
path: root/vendor/symfony/http-kernel/Tests/KernelTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/symfony/http-kernel/Tests/KernelTest.php')
-rw-r--r--vendor/symfony/http-kernel/Tests/KernelTest.php19
1 files changed, 17 insertions, 2 deletions
diff --git a/vendor/symfony/http-kernel/Tests/KernelTest.php b/vendor/symfony/http-kernel/Tests/KernelTest.php
index a16ac37dee..7cde2ac5e2 100644
--- a/vendor/symfony/http-kernel/Tests/KernelTest.php
+++ b/vendor/symfony/http-kernel/Tests/KernelTest.php
@@ -902,6 +902,21 @@ EOF;
}
/**
+ * @group time-sensitive
+ */
+ public function testKernelStartTimeIsResetWhileBootingAlreadyBootedKernel()
+ {
+ $kernel = $this->getKernelForTest(array('initializeBundles'), true);
+ $kernel->boot();
+ $preReBoot = $kernel->getStartTime();
+
+ sleep(3600); //Intentionally large value to detect if ClockMock ever breaks
+ $kernel->reboot(null);
+
+ $this->assertGreaterThan($preReBoot, $kernel->getStartTime());
+ }
+
+ /**
* Returns a mock for the BundleInterface.
*
* @return BundleInterface
@@ -970,10 +985,10 @@ EOF;
return $kernel;
}
- protected function getKernelForTest(array $methods = array())
+ protected function getKernelForTest(array $methods = array(), $debug = false)
{
$kernel = $this->getMockBuilder('Symfony\Component\HttpKernel\Tests\Fixtures\KernelForTest')
- ->setConstructorArgs(array('test', false))
+ ->setConstructorArgs(array('test', $debug))
->setMethods($methods)
->getMock();
$p = new \ReflectionProperty($kernel, 'rootDir');