public function testWhenUndefinedMethodCalledReturnsGeneratedDoubleWhenComponentMethodReturnsNull() { $sut = new TestDouble(); $component = new DummyComponent(); $sut->addComponent($component); $this->assertInstanceOf('\\Doubles\\Core\\FluentInterface', $sut->whenUndefinedMethodCalled('dummy', array())); }
private static function create($subjectName, $type) { $subject = new Core\Subject($subjectName, $type); $testDouble = new Core\TestDouble(); $expectationComponent = new ExpectationComponent(); $stubComponent = new StubComponent(); $mockComponent = new Mock\MockComponent(); $expectationComponent->addExpecter($stubComponent); $expectationComponent->addExpecter($mockComponent); $testDouble->addComponent($expectationComponent); $testDouble->addComponent($stubComponent); $testDouble->addComponent($mockComponent); $testDouble->addComponent(new Spy\SpyComponent()); return Core\TestDoubleFactory::create($subject, $testDouble, 'Mock%s'); }