Skip to content

Commit

Permalink
Applying patch from 'tkykmw'. Behavior mapped methods are no longer r…
Browse files Browse the repository at this point in the history
…un through strtolower(). Mapped methods are now case sensitive. Fixes #318
  • Loading branch information
markstory committed Sep 6, 2010
1 parent 2e46d2f commit 5789aaf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 0 additions & 4 deletions cake/libs/model/behavior_collection.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 4 additions & 0 deletions cake/tests/cases/libs/model/model_behavior.test.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.');
}

/**
Expand Down

0 comments on commit 5789aaf

Please sign in to comment.