Skip to content
Permalink
Browse files

Adding Fennec as a built-in mobile browser.

Refactoring a test case to pull out the exceptional case.
Fixes #932
  • Loading branch information...
markstory committed Oct 28, 2010
1 parent 1166806 commit d7847288e482217bf060c5ad667c5e0bbc93d144
Showing with 14 additions and 2 deletions.
  1. +1 −1 cake/libs/cake_request.php
  2. +13 −1 cake/tests/cases/libs/cake_request.test.php
@@ -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'
@@ -605,8 +605,20 @@ function testisAjaxFlashAndFriends() {
$_SERVER['HTTP_USER_AGENT'] = 'Android 2.0';
$this->assertTrue($request->is('mobile'));
$this->assertTrue($request->isMobile());
$_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());
}
$this->expectException();
/**
* test __call expcetions
*
* @expectedException Exception
* @return void
*/
function test__callExceptionOnUnknownMethod() {
$request = new CakeRequest('some/path');
$request->IamABanana();
}

0 comments on commit d784728

Please sign in to comment.
You can’t perform that action at this time.