Ejemplo n.º 1
0
 public function test_connect_NumberOfParams()
 {
     $obj = $this->getConstructorConnector();
     $this->skeleton->expects($this->at(0))->method('get')->willReturn(new test_ConstructorConnector_TypeA());
     $this->skeleton->expects($this->at(1))->method('get')->willReturn(new test_ConstructorConnector_TypeB());
     $instance = $this->invokeConnect($obj, test_ConstructorConnector_Helper_NumberOfParams::class);
     $this->assertInstanceOf(test_ConstructorConnector_Helper_NumberOfParams::class, $instance);
     $this->assertInstanceOf(test_ConstructorConnector_TypeA::class, $instance->a);
     $this->assertInstanceOf(test_ConstructorConnector_TypeB::class, $instance->b);
 }
Ejemplo n.º 2
0
 /**
  * @param string $type
  * @param mixed $return
  */
 private function expectSkeletonCalledFor($type, $return = null)
 {
     $this->skeleton->expects($this->once())->method('get')->with($type)->willReturn($return);
 }