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); }
/** * @param string $type * @param mixed $return */ private function expectSkeletonCalledFor($type, $return = null) { $this->skeleton->expects($this->once())->method('get')->with($type)->willReturn($return); }