[HttpKernel] fixed failing tests
This commit is contained in:
parent
a1e5c6d359
commit
08d5d7c89b
@ -35,12 +35,14 @@ class TimeDataCollector extends DataCollector
|
||||
*/
|
||||
public function collect(Request $request, Response $response, \Exception $exception = null)
|
||||
{
|
||||
if (null === $this->kernel) {
|
||||
$requestTime = $request->server->get('REQUEST_TIME_FLOAT', $request->server->get('REQUEST_TIME'));
|
||||
if (null !== $this->kernel) {
|
||||
$startTime = $this->kernel->getStartTime();
|
||||
} else {
|
||||
$startTime = $request->server->get('REQUEST_TIME_FLOAT', $request->server->get('REQUEST_TIME'));
|
||||
}
|
||||
|
||||
$this->data = array(
|
||||
'start_time' => (isset($requestTime) ? $requestTime : $this->kernel->getStartTime()) * 1000,
|
||||
'start_time' => $startTime * 1000,
|
||||
'events' => array(),
|
||||
);
|
||||
}
|
||||
|
@ -55,5 +55,4 @@ class TimeDataCollectorTest extends \PHPUnit_Framework_TestCase
|
||||
$c->collect($request, new Response());
|
||||
$this->assertEquals(123456000, $c->getStartTime());
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user