Skip to content
Permalink
Browse files

Applying patch from 'tkykmw'. Behavior mapped methods are no longer r…

…un through strtolower(). Mapped methods are now case sensitive. Fixes #318
  • Loading branch information...
markstory committed Sep 6, 2010
1 parent 2e46d2f commit 5789aaf24d5f6e527326878e62a099f1bf479b85
Showing with 4 additions and 4 deletions.
  1. +0 −4 cake/libs/model/behavior_collection.php
  2. +4 −0 cake/tests/cases/libs/model/model_behavior.test.php
@@ -191,10 +191,6 @@ public function detach($name) {
*/
public function dispatchMethod(&$model, $method, $params = array(), $strict = false) {
$methods = array_keys($this->__methods);
foreach ($methods as $key => $value) {
$methods[$key] = strtolower($value);
}
$method = strtolower($method);
$check = array_flip($methods);
$found = isset($check[$method]);
$call = null;
@@ -1024,6 +1024,10 @@ function testBehaviorMethodDispatching() {
$result = $Apple->{'look for the remote'}('in the couch');
$expected = "Item.name = 'the remote' AND Location.name = 'the couch'";
$this->assertEqual($result, $expected);
$result = $Apple->{'look for THE REMOTE'}('in the couch');
$expected = "Item.name = 'THE REMOTE' AND Location.name = 'the couch'";
$this->assertEqual($result, $expected, 'Mapped method was lowercased.');
}
/**

0 comments on commit 5789aaf

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