See also: https://developers.whatismybrowser.com/reference
Author: Martin Keckeis (martin.keckeis1@gmail.com)
Inheritance: extends AbstractHttpProvider
 /**
  * Device only
  */
 public function testParseDeviceDefaultValue()
 {
     $parseResult = new stdClass();
     $parseResult->user_agent = 'A real user agent...';
     $parseResult->operating_platform = 'Android Phone';
     $parseResult->operating_platform_vendor_name = 'Dell';
     $rawResult = new stdClass();
     $rawResult->result = 'success';
     $rawResult->parse = $parseResult;
     $responseQueue = [new Response(200, ['Content-Type' => 'application/json'], json_encode($rawResult))];
     $provider = new WhatIsMyBrowserCom($this->getClient($responseQueue), 'apiKey123');
     $result = $provider->parse('A real user agent...');
     $expectedResult = ['device' => ['model' => null, 'brand' => 'Dell', 'type' => null, 'isMobile' => null, 'isTouch' => null]];
     $this->assertProviderResult($result, $expectedResult);
 }
 public function testEncodeIsCorrect()
 {
     if (!defined('CREDENTIALS_WHAT_IS_MY_BROWSER_COM_KEY')) {
         $this->markTestSkipped('no credentials available. Please provide tests/credentials.php');
     }
     $provider = new WhatIsMyBrowserCom($this->getClient(), CREDENTIALS_WHAT_IS_MY_BROWSER_COM_KEY);
     $userAgent = 'Mozilla/5.0 (Linux; U; Android 3.0.1; en-us; HTC T9299+ For AT&T Build/GRJ22) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1';
     $result = $provider->parse($userAgent);
     $this->assertEquals($userAgent, $result->getProviderResultRaw()->user_agent);
 }