Esempio n. 1
0
 public function testCreateUsingReflection()
 {
     $type = 'Magento\\Framework\\ObjectManager\\Factory\\Fixture\\Polymorphous';
     $definitions = $this->getMock('Magento\\Framework\\ObjectManager\\DefinitionInterface');
     // should be more than defined in "switch" of create() method
     $definitions->expects($this->once())->method('getParameters')->with($type)->will($this->returnValue([['one', null, false, null], ['two', null, false, null], ['three', null, false, null], ['four', null, false, null], ['five', null, false, null], ['six', null, false, null], ['seven', null, false, null], ['eight', null, false, null], ['nine', null, false, null], ['ten', null, false, null]]));
     $factory = new Developer($this->config, null, $definitions);
     $result = $factory->create($type, ['one' => 1, 'two' => 2, 'three' => 3, 'four' => 4, 'five' => 5, 'six' => 6, 'seven' => 7, 'eight' => 8, 'nine' => 9, 'ten' => 10]);
     $this->assertSame(10, $result->getArg(9));
 }