Skip to content

Commit 2c32859

Browse files
committed
Fixing stupid issue with memoization inside getClassAndMethod
1 parent 7cc920c commit 2c32859

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

PHPUnit/Extensions/MockStaticMethod.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,11 @@ protected function createFunction()
6767
*/
6868
protected function getClassAndMethod()
6969
{
70-
static $class_and_method;
70+
static $classses_and_methods = array();
7171

72-
if ( isset( $class_and_method ) )
72+
if ( isset( $classses_and_methods[$this->function_name] ) )
7373
{
74-
return $class_and_method;
74+
return $classses_and_methods[$this->function_name];
7575
}
7676

7777
$class_and_method = explode( '::', $this->function_name );
@@ -91,6 +91,6 @@ protected function getClassAndMethod()
9191
trigger_error( "Static method '{$this->function_name}' must exist and be public.", E_USER_ERROR );
9292
}
9393

94-
return $class_and_method;
94+
return $classses_and_methods[$this->function_name] = $class_and_method;
9595
}
9696
}

0 commit comments

Comments
 (0)