See also: https://github.com/browscap/browscap-php
Author: Martin Keckeis (martin.keckeis1@gmail.com)
Inheritance: extends AbstractBrowscap
 public function testRealResultDevice()
 {
     $provider = new BrowscapPhp($this->getParserWithWarmCache(''));
     $result = $provider->parse('Mozilla/5.0 (SMART-TV; X11; Linux armv7l) AppleWebkit/537.42 (KHTML, like Gecko) Chromium/48.0.1349.2 Chrome/25.0.1349.2 Safari/537.42');
     $this->assertEquals(['browser' => ['name' => 'Chromium', 'version' => ['major' => 48, 'minor' => null, 'patch' => null, 'alias' => null, 'complete' => '48.0']], 'renderingEngine' => ['name' => null, 'version' => ['major' => null, 'minor' => null, 'patch' => null, 'alias' => null, 'complete' => null]], 'operatingSystem' => ['name' => 'Linux', 'version' => ['major' => null, 'minor' => null, 'patch' => null, 'alias' => null, 'complete' => null]], 'device' => ['model' => null, 'brand' => null, 'type' => 'TV Device', 'isMobile' => null, 'isTouch' => null], 'bot' => ['isBot' => null, 'name' => null, 'type' => null]], $result->toArray());
 }
 public function testDetectionCapabilities()
 {
     $provider = new BrowscapPhp($this->getParser());
     $this->assertEquals(['browser' => ['name' => true, 'version' => true], 'renderingEngine' => ['name' => false, 'version' => false], 'operatingSystem' => ['name' => true, 'version' => false], 'device' => ['model' => false, 'brand' => false, 'type' => true, 'isMobile' => true, 'isTouch' => true], 'bot' => ['isBot' => true, 'name' => true, 'type' => false]], $provider->getDetectionCapabilities());
 }
 /**
  * Browser with all)
  */
 public function testParseDevice1()
 {
     $result = new \stdClass();
     $result->browser = 'Midori';
     $result->version = '1.5.2';
     $result->renderingengine_name = 'WebKit';
     $result->renderingengine_version = '13.0';
     $result->platform = 'iOS';
     $result->platform_version = '5.0';
     $result->device_name = 'iPad';
     $result->device_brand_name = 'Apple';
     $result->device_type = 'Tablet';
     $result->ismobiledevice = true;
     $result->device_pointing_method = 'touchscreen';
     $provider = new BrowscapPhp($this->getParser($result));
     $result = $provider->parse('A real user agent...');
     $expectedResult = ['browser' => ['name' => 'Midori', 'version' => ['major' => 1, 'minor' => 5, 'patch' => 2, 'alias' => null, 'complete' => '1.5.2']], 'renderingEngine' => ['name' => 'WebKit', 'version' => ['major' => 13, 'minor' => 0, 'patch' => null, 'alias' => null, 'complete' => '13.0']], 'operatingSystem' => ['name' => 'iOS', 'version' => ['major' => 5, 'minor' => 0, 'patch' => null, 'alias' => null, 'complete' => '5.0']], 'device' => ['model' => 'iPad', 'brand' => 'Apple', 'type' => 'Tablet', 'isMobile' => true, 'isTouch' => true]];
     $this->assertProviderResult($result, $expectedResult);
 }
 public function testParser()
 {
     $parser = $this->getParser();
     $provider = new BrowscapPhp($parser);
     $this->assertSame($parser, $provider->getParser());
 }