Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
DomFactoryTest.php
Go to the documentation of this file.
1 <?php
8 
9 use \Magento\Framework\ObjectManager\Config\Reader\DomFactory;
10 
11 class DomFactoryTest extends \PHPUnit\Framework\TestCase
12 {
16  protected $_factory;
17 
21  protected $_object;
22 
26  protected $_objectManager;
27 
28  protected function setUp()
29  {
30  $this->_object = $this->createMock(\Magento\Framework\ObjectManager\Config\Reader\Dom::class);
31  $this->_objectManager =
32  $this->createPartialMock(\Magento\Framework\ObjectManager\ObjectManager::class, ['create']);
33  $this->_factory = new DomFactory($this->_objectManager);
34  }
35 
36  public function testCreate()
37  {
38  $this->_objectManager->expects($this->once())
39  ->method('create')
40  ->with(\Magento\Framework\ObjectManager\Config\Reader\Dom::class)
41  ->will($this->returnValue($this->_object));
42 
43  $this->_factory->create([1]);
44  }
45 }