mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 09:06:17 +00:00
Adding Fennec as a built-in mobile browser.
Refactoring a test case to pull out the exceptional case. Fixes #932
This commit is contained in:
parent
1166806218
commit
d7847288e4
2 changed files with 14 additions and 2 deletions
|
@ -100,7 +100,7 @@ class CakeRequest implements ArrayAccess {
|
|||
'ajax' => array('env' => 'HTTP_X_REQUESTED_WITH', 'value' => 'XMLHttpRequest'),
|
||||
'flash' => array('env' => 'HTTP_USER_AGENT', 'pattern' => '/^(Shockwave|Adobe) Flash/'),
|
||||
'mobile' => array('env' => 'HTTP_USER_AGENT', 'options' => array(
|
||||
'Android', 'AvantGo', 'BlackBerry', 'DoCoMo', 'iPod', 'iPhone',
|
||||
'Android', 'AvantGo', 'BlackBerry', 'DoCoMo', 'Fennec', 'iPod', 'iPhone',
|
||||
'J2ME', 'MIDP', 'NetFront', 'Nokia', 'Opera Mini', 'PalmOS', 'PalmSource',
|
||||
'portalmmm', 'Plucker', 'ReqwirelessWeb', 'SonyEricsson', 'Symbian', 'UP\\.Browser',
|
||||
'webOS', 'Windows CE', 'Xiino'
|
||||
|
|
|
@ -606,7 +606,19 @@ class CakeRequestTestCase extends CakeTestCase {
|
|||
$this->assertTrue($request->is('mobile'));
|
||||
$this->assertTrue($request->isMobile());
|
||||
|
||||
$this->expectException();
|
||||
$_SERVER['HTTP_USER_AGENT'] = 'Mozilla/5.0 (Windows NT 5.1; rv:2.0b6pre) Gecko/20100902 Firefox/4.0b6pre Fennec/2.0b1pre';
|
||||
$this->assertTrue($request->is('mobile'));
|
||||
$this->assertTrue($request->isMobile());
|
||||
}
|
||||
|
||||
/**
|
||||
* test __call expcetions
|
||||
*
|
||||
* @expectedException Exception
|
||||
* @return void
|
||||
*/
|
||||
function test__callExceptionOnUnknownMethod() {
|
||||
$request = new CakeRequest('some/path');
|
||||
$request->IamABanana();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue