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

Add test broken method mock #324

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion tests/GeneratorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -196,12 +196,26 @@ public function testCanImplementInterfacesThatHaveMethodsWithReturnTypes()
*
* @ticket https://github.com/sebastianbergmann/phpunit-mock-objects/issues/322
*/
public function testCanConfigureMethodsForDoubleOfNonExistantClass()
public function testCanConfigureMethodsForDoubleOfNonExistentClass()
{
$className = 'X' . md5(microtime());

$mock = $this->generator->getMock($className, ['someMethod']);

$this->assertInstanceOf($className, $mock);
}

/**
* @covers PHPUnit_Framework_MockObject_Generator::getMock
*/
public function testCanInvokeMethodsOfNonExistentClass()
{
$className = 'X' . md5(microtime());

$mock = $this->generator->getMock($className, ['someMethod']);

$mock->expects($this->once())->method('someMethod');

$mock->someMethod();
}
}