Exemplo n.º 1
0
 public function whenMethodCalled($methodName, array $arguments)
 {
     if ($this->expectationComponent->isMethodExpected($methodName)) {
         return;
     }
     return new PartialInterface();
 }
Exemplo n.º 2
0
 public function testUnexpectedCallbackWhenMethodUnignored()
 {
     $component = new ExpectationComponent();
     $component->ignore('foo');
     $component->unignore('foo');
     $this->assertUnexpectedCallback($component, 'foo');
 }
Exemplo n.º 3
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');
 }