Skip to content
This repository was archived by the owner on Feb 20, 2023. It is now read-only.

Commit 4edde7c

Browse files
committed
Add test case can invoke method on non existent class.
1 parent e9aea7f commit 4edde7c

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

tests/GeneratorTest.php

+14
Original file line numberDiff line numberDiff line change
@@ -204,4 +204,18 @@ public function testCanConfigureMethodsForDoubleOfNonExistentClass()
204204

205205
$this->assertInstanceOf($className, $mock);
206206
}
207+
208+
/**
209+
* @covers PHPUnit_Framework_MockObject_Generator::getMock
210+
*/
211+
public function testCanInvokeMethodsOfNonExistentClass()
212+
{
213+
$className = 'X' . md5(microtime());
214+
215+
$mock = $this->generator->getMock($className, ['someMethod']);
216+
217+
$mock->expects($this->once())->method('someMethod');
218+
219+
$mock->someMethod();
220+
}
207221
}

0 commit comments

Comments
 (0)