Skip to content

Commit bab62df

Browse files
committed
Fixing fails caused by PHP4 and all lowercase classnames.
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@8278 3807eeeb-6ff5-0310-8944-8be069107fe0
1 parent 401796e commit bab62df

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

cake/tests/cases/libs/model/behavior.test.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -265,8 +265,8 @@ function onError(&$model) {
265265
* @return void
266266
*/
267267
function beforeTest(&$model) {
268-
$model->beforeTestResult[] = get_class($this);
269-
return get_class($this);
268+
$model->beforeTestResult[] = strtolower(get_class($this));
269+
return strtolower(get_class($this));
270270
}
271271
/**
272272
* testMethod method
@@ -983,24 +983,24 @@ function testBehaviorMethodDispatchingWithData() {
983983
* @return void
984984
*/
985985
function testBehaviorTrigger() {
986-
$Apple = new Apple();
986+
$Apple =& new Apple();
987987
$Apple->Behaviors->attach('Test');
988988
$Apple->Behaviors->attach('Test2');
989989
$Apple->Behaviors->attach('Test3');
990990

991991
$Apple->beforeTestResult = array();
992992
$Apple->Behaviors->trigger($Apple, 'beforeTest');
993-
$expected = array('TestBehavior', 'Test2Behavior', 'Test3Behavior');
993+
$expected = array('testbehavior', 'test2behavior', 'test3behavior');
994994
$this->assertIdentical($Apple->beforeTestResult, $expected);
995995

996996
$Apple->beforeTestResult = array();
997-
$Apple->Behaviors->trigger($Apple, 'beforeTest', array(), array('break' => true, 'breakOn' => 'Test2Behavior'));
998-
$expected = array('TestBehavior', 'Test2Behavior');
997+
$Apple->Behaviors->trigger($Apple, 'beforeTest', array(), array('break' => true, 'breakOn' => 'test2behavior'));
998+
$expected = array('testbehavior', 'test2behavior');
999999
$this->assertIdentical($Apple->beforeTestResult, $expected);
10001000

10011001
$Apple->beforeTestResult = array();
1002-
$Apple->Behaviors->trigger($Apple, 'beforeTest', array(), array('break' => true, 'breakOn' => array('Test2Behavior', 'Test3Behavior')));
1003-
$expected = array('TestBehavior', 'Test2Behavior');
1002+
$Apple->Behaviors->trigger($Apple, 'beforeTest', array(), array('break' => true, 'breakOn' => array('test2behavior', 'test3behavior')));
1003+
$expected = array('testbehavior', 'test2behavior');
10041004
$this->assertIdentical($Apple->beforeTestResult, $expected);
10051005
}
10061006
/**

0 commit comments

Comments
 (0)