sebastianbergmann/phpunit-mock-objects — pull request #128 by Zetruger (2013-03-30 06:31:21+00:00)
Title: Check methods only if they were not set directly

It needs for the following test:
```php
public function testInstance()
{
$mockClass = $this->getMockClass('SomeClass', array('__construct'));
$this->assertInstanceOf('SomeClass', $mockClass::getInstance());
$object1 = $mockClass::getInstance();
$this->assertSame($object1, $mockClass::getInstance());
$object2 = new $mockClass();
$this->assertNotSame($object2, $mockClass::getInstance());
$this->assertSame($object2, $mockClass::setInstance($object2));
$this->assertSame($object2, $mockClass::getInstance());
$this->assertNotSame($object1, $mockClass::getInstance());
}
```