Exemple #1
0
 /**
  * @expectedException \UnexpectedValueException
  * @expectedExceptionMessage \Magento\Framework\ObjectManager\Factory\FactoryTest::EXCEPTION_MESSAGE
  */
 public function testResolveArgumentsException()
 {
     $configMock = $this->getMock('\\Magento\\Framework\\ObjectManager\\Config\\Config', array(), array(), '', false);
     $configMock->expects($this->once())->method('getArguments')->will($this->returnValue(array('firstParam' => 1)));
     $definitionsMock = $this->getMock('\\Magento\\Framework\\ObjectManager\\Definition', array(), array(), '', false);
     $definitionsMock->expects($this->once())->method('getParameters')->will($this->returnValue(array(array('firstParam', 'string', true, 'default_val'))));
     $this->factory = new Factory($configMock, null, $definitionsMock);
     $this->objectManager = new ObjectManager($this->factory, $this->config);
     $this->factory->setObjectManager($this->objectManager);
     $this->factory->create('Magento\\Framework\\ObjectManager\\Factory\\Fixture\\OneScalar', array('foo' => 'bar'));
 }