Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Making CakeRequest toss an exception when it can't handle a method call.
  • Loading branch information
markstory committed May 4, 2010
1 parent c5fdeec commit c91d74a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions cake/libs/cake_request.php
Expand Up @@ -408,6 +408,7 @@ public function __call($name, $params) {
$type = strtolower(substr($name, 2));
return $this->is($type);
}
throw new BadMethodCallException('Method does not exist');
}

/**
Expand Down
3 changes: 3 additions & 0 deletions cake/tests/cases/libs/cake_request.test.php
Expand Up @@ -520,6 +520,9 @@ function testisAjaxFlashAndFriends() {
$_SERVER['HTTP_USER_AGENT'] = 'Android 2.0';
$this->assertTrue($request->is('mobile'));
$this->assertTrue($request->isMobile());

$this->expectException();
$request->IamABanana();
}

/**
Expand Down

0 comments on commit c91d74a

Please sign in to comment.