/**
  * @expectedException \InvalidArgumentException
  * @expectedExceptionMessage Expected string, but got integer for argument 1
  */
 public function testAndReturnPropertyMustBeAString()
 {
     $mock = new MockBuilder($this, 'stdClass', true);
     $mock->andReturnProperty(123);
 }
Beispiel #2
0
 /**
  * @param object $instance
  * @return MockBuilder
  */
 public function partialMock($instance)
 {
     ArgumentChecker::check($instance, 'object');
     $mockBuilder = new MockBuilder($this, get_class($instance), true, array());
     $mockBuilder->disableConstructor();
     $mockBuilder->setObjectState($instance);
     return $mockBuilder;
 }