Exemplo n.º 1
0
 public function testWhenUndefinedMethodCalledReturnsGeneratedDoubleWhenComponentMethodReturnsNull()
 {
     $sut = new TestDouble();
     $component = new DummyComponent();
     $sut->addComponent($component);
     $this->assertInstanceOf('\\Doubles\\Core\\FluentInterface', $sut->whenUndefinedMethodCalled('dummy', array()));
 }
Exemplo n.º 2
0
 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');
 }