コード例 #1
0
 public function testGetInstanceWithParameters()
 {
     $one = 'foo';
     $two = 'bar';
     $class = 'ChangeLog\\Stub\\GetableConstructorStub';
     $this->factory->addClass('bazbat', $class);
     /** @var GetableConstructorStub $instance */
     $instance = $this->factory->getInstance('bazbat', [$one, $two]);
     $this->assertInstanceOf($class, $instance);
     $this->assertEquals($one, $instance->one);
     $this->assertEquals($two, $instance->two);
 }
コード例 #2
0
 protected function setOutput($factoryName)
 {
     $factory = new GenericFactory('\\ChangeLog\\IO\\');
     $instance = $factory->getInstance($this->config['output'][$factoryName]['strategy'], $this->config['output'][$factoryName]['config']);
     $this->changeLog->setOutput($instance);
 }