|
|
@@ -25,8 +25,13 @@ class ChromePHPHandlerTest extends TestCase
|
|
|
$_SERVER['HTTP_USER_AGENT'] = 'Monolog Test; Chrome/1.0';
|
|
|
}
|
|
|
|
|
|
- public function testHeaders()
|
|
|
+ /**
|
|
|
+ * @dataProvider agentsProvider
|
|
|
+ */
|
|
|
+ public function testHeaders($agent)
|
|
|
{
|
|
|
+ $_SERVER['HTTP_USER_AGENT'] = $agent;
|
|
|
+
|
|
|
$handler = new TestChromePHPHandler();
|
|
|
$handler->setFormatter($this->getIdentityFormatter());
|
|
|
$handler->handle($this->getRecord(Logger::DEBUG));
|
|
|
@@ -47,6 +52,16 @@ class ChromePHPHandlerTest extends TestCase
|
|
|
$this->assertEquals($expected, $handler->getHeaders());
|
|
|
}
|
|
|
|
|
|
+ public static function agentsProvider()
|
|
|
+ {
|
|
|
+ return array(
|
|
|
+ array('Monolog Test; Chrome/1.0'),
|
|
|
+ array('Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:52.0) Gecko/20100101 Firefox/52.0'),
|
|
|
+ array('Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/56.0.2924.76 Chrome/56.0.2924.76 Safari/537.36'),
|
|
|
+ array('Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome Safari/537.36'),
|
|
|
+ );
|
|
|
+ }
|
|
|
+
|
|
|
public function testHeadersOverflow()
|
|
|
{
|
|
|
$handler = new TestChromePHPHandler();
|