* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\HttpKernel\Tests\DataCollector; use PHPUnit\Framework\TestCase; use Symfony\Component\HttpKernel\DataCollector\TimeDataCollector; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; /** * @group time-sensitive */ class TimeDataCollectorTest extends TestCase { public function testCollect() { $c = new TimeDataCollector(); $request = new Request(); $request->server->set('REQUEST_TIME', 1); $c->collect($request, new Response()); $this->assertEquals(0, $c->getStartTime()); $request->server->set('REQUEST_TIME_FLOAT', 2); $c->collect($request, new Response()); $this->assertEquals(2000, $c->getStartTime()); $request = new Request(); $c->collect($request, new Response()); $this->assertEquals(0, $c->getStartTime()); $kernel = $this->getMockBuilder('Symfony\Component\HttpKernel\KernelInterface')->getMock(); $kernel->expects($this->once())->method('getStartTime')->will($this->returnValue(123456)); $c = new TimeDataCollector($kernel); $request = new Request(); $request->server->set('REQUEST_TIME', 1); $c->collect($request, new Response()); $this->assertEquals(123456000, $c->getStartTime()); } } __halt_compiler();----SIGNATURE:----RhZ7lajFX4/5G0KsDikfRxfoE7q5MHYRGCTwPM19Sq6VVTVhxGHo5QCEbGvFWMXCu3lT/4A4ZIkWpG8AvXh7zKF2qvvloONtNSx9npJglzPkuApK2f9L1Euh+A3XLy8S044iKDIq6/2SU1SpWRVr6q+GL+aoag6TaYuBediCxDoyj+fEcLbq3LYbSbblCwml0Vjv1b+bx9Y96VRtjXW+CpS0y0bWtub3qcy8mquMHNkWDtUcaUdDAECVVYfqIqJIwtJUwtvpHjSgzoeSEjZ1RCp77M2MHgiJTbbuTLX/QjE/xO62wG6BRbaRk1i3aCASpTyqsDgkp5ULJpCwMEQ+cJ2+vhVMJbKZ8G2JpQKyOtc2ksL/nZkETJiCyE7+iZ2QCOMDnViu7QwEbtkkUYt5NcxgLQ4gnO5W8DrjstEf5+gKHmX2xAo9m/4JaUw6LXNs5HmVq5UliUhGeeVddlx3VtWvGrnV2xHc6OzjJ8/Qb8mBZIS4N7xO6eLLHd2VIpIMO7j0fp1vFlDehNE1GbkBhrmFZzCRnr0mxP0sW8F1P2V1PfuOP12VMgQgZyOw8TCJ8PSgYB0GuAlbD5YlI7PGk01nv17BO8IP+Bxab0ds7Rcmp0C5QedUBp621k9Dk/GUvV5GAvklxx/l8xbGLAZWuSzU+6QJu4cZODnthUzx+E4=----ATTACHMENT:----OTQwMzk4NjE5ODcxMTIzMSA3NDMxMDc0NTUwMjI5MTAwIDI5NzAzNDIxMzY5ODg4NjQ=