コード例 #1
0
	/**
	 * Tests the JApplicationWebClient::detectRobot method.
	 *
	 * @param   string   $userAgent  The user agent
	 * @param   boolean  $expected   The expected results of the function
	 *
	 * @return  void
	 *
	 * @dataProvider detectRobotData
	 * @since   12.3
	 */
	public function testDetectRobot($userAgent, $expected)
	{
		$this->inspector->detectRobot($userAgent);

		// Test the assertions.
		$this->assertEquals($this->inspector->robot, $expected, 'Robot detection failed');
	}
コード例 #2
0
 /**
  * Tests the JWebClient::detectPlatform method.
  *
  * @param   string   $p   The expected platform.
  * @param   boolean  $m   The expected mobile result.
  * @param   string   $e   The expected engine.
  * @param   string   $b   The expected browser.
  * @param   string   $v   The expected browser version.
  * @param   string   $ua  The input user agent.
  *
  * @return  void
  *
  * @dataProvider getUserAgentData
  * @since   11.3
  */
 public function testDetectPlatform($p, $m, $e, $b, $v, $ua)
 {
     $this->inspector->detectPlatform($ua);
     // Test the assertions.
     $this->assertEquals($this->inspector->mobile, $m, 'Mobile detection failed.');
     $this->assertEquals($this->inspector->platform, $p, 'Platform detection failed.');
 }