mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-02-12 02:42:33 +01:00
Added IE11 test to testGetBrowserInfo
This commit is contained in:
@@ -26,20 +26,20 @@
|
||||
global $conf,$user,$langs,$db;
|
||||
//define('TEST_DB_FORCE_TYPE','mysql'); // This is to force using mysql driver
|
||||
//require_once 'PHPUnit/Autoload.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/core/lib/date.lib.php';
|
||||
|
||||
if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER','1');
|
||||
if (! defined('NOREQUIREDB')) define('NOREQUIREDB','1');
|
||||
if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1');
|
||||
if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1');
|
||||
if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK','1');
|
||||
if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL','1');
|
||||
if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU','1'); // If there is no menu to show
|
||||
if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML','1'); // If we don't need to load the html.form.class.php
|
||||
if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1');
|
||||
if (! defined("NOLOGIN")) define("NOLOGIN",'1'); // If this page is public (can be called outside logged session)
|
||||
|
||||
//require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
|
||||
//require_once dirname(__FILE__).'/../../htdocs/core/lib/date.lib.php';
|
||||
//
|
||||
//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER','1');
|
||||
//if (! defined('NOREQUIREDB')) define('NOREQUIREDB','1');
|
||||
//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1');
|
||||
//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1');
|
||||
//if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK','1');
|
||||
//if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL','1');
|
||||
//if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU','1'); // If there is no menu to show
|
||||
//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML','1'); // If we don't need to load the html.form.class.php
|
||||
//if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1');
|
||||
//if (! defined("NOLOGIN")) define("NOLOGIN",'1'); // If this page is public (can be called outside logged session)
|
||||
require_once dirname(__FILE__).'/../../htdocs/core/lib/functions.lib.php';
|
||||
|
||||
/**
|
||||
* Class for PHPUnit tests
|
||||
@@ -126,12 +126,14 @@ class FunctionsLibTest extends PHPUnit_Framework_TestCase
|
||||
*/
|
||||
public function testGetBrowserInfo()
|
||||
{
|
||||
$user_agent ='Mozilla/4.0 (compatible; MSIE 5.0; Windows 98; DigExt; KITV4 Wanadoo; KITV5 Wanadoo)'; // MSIE 5.0
|
||||
// MSIE 5.0
|
||||
$user_agent ='Mozilla/4.0 (compatible; MSIE 5.0; Windows 98; DigExt; KITV4 Wanadoo; KITV5 Wanadoo)';
|
||||
$tmp=getBrowserInfo($user_agent);
|
||||
$this->assertEquals('ie',$tmp['browsername']);
|
||||
$this->assertEquals('5.0',$tmp['browserversion']);
|
||||
|
||||
$user_agent ='Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.5a) Gecko/20030728 Mozilla Firefox/0.9.1'; // Firefox 0.9.1
|
||||
// Firefox 0.9.1
|
||||
$user_agent ='Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.5a) Gecko/20030728 Mozilla Firefox/0.9.1';
|
||||
$tmp=getBrowserInfo($user_agent);
|
||||
$this->assertEquals('firefox',$tmp['browsername']);
|
||||
$this->assertEquals('0.9.1',$tmp['browserversion']);
|
||||
@@ -155,6 +157,12 @@ class FunctionsLibTest extends PHPUnit_Framework_TestCase
|
||||
$tmp=getBrowserInfo($user_agent);
|
||||
$this->assertEquals('safari',$tmp['browsername']);
|
||||
$this->assertEquals('533.21.1',$tmp['browserversion']);
|
||||
|
||||
//Internet Explorer 11
|
||||
$user_agent = 'Mozilla/5.0 (Windows NT 6.3; Trident/7.0; rv:11.0) like Gecko';
|
||||
$tmp=getBrowserInfo($user_agent);
|
||||
$this->assertEquals('ie',$tmp['browsername']);
|
||||
$this->assertEquals('11.0',$tmp['browserversion']);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user