@@ -58,7 +58,7 @@ class PHPUnit_Extensions_MockFunction
58
58
*
59
59
* If the function did not exist before mocking, it's empty.
60
60
*
61
- * @var type
61
+ * @var string
62
62
*/
63
63
protected $ restore_name ;
64
64
@@ -72,7 +72,7 @@ class PHPUnit_Extensions_MockFunction
72
72
/**
73
73
* List of active mock object instances (those that are not restored) with their ID as key.
74
74
*
75
- * @var type
75
+ * @var PHPUnit_Extensions_MockFunction[]
76
76
*/
77
77
protected static $ instances = array ();
78
78
@@ -114,10 +114,13 @@ public function __construct( $function_name, $scope_object )
114
114
$ this ->function_name = $ function_name ;
115
115
$ this ->scope_object = $ scope_object ;
116
116
$ this ->test_case = self ::findTestCase ();
117
- $ this ->mock_object = $ this ->test_case ->getMock (
118
- 'Mock_ ' . str_replace ( ':: ' , '__ ' , $ this ->function_name ) . '_ ' . $ this ->id ,
119
- array ( 'invoked ' )
120
- );
117
+ $ this ->mock_object =
118
+ $ this ->test_case ->getMockBuilder (
119
+ 'Mock_ ' . str_replace ( ':: ' , '__ ' , $ this ->function_name ) . '_ ' . $ this ->id
120
+ )
121
+ ->disableAutoload ()
122
+ ->setMethods (array ( 'invoked ' ))
123
+ ->getMock ();
121
124
122
125
++self ::$ next_id ;
123
126
self ::$ instances [$ this ->id ] = $ this ;
@@ -229,7 +232,7 @@ public static function findMock( $id )
229
232
* Finds the rist object in the call cstack that is instance of a PHPUnit test case.
230
233
*
231
234
* @see self::TESTCASE_CLASSNAME
232
- * @return object
235
+ * @return PHPUnit_Framework_TestCase
233
236
*/
234
237
public static function findTestCase ()
235
238
{
0 commit comments