Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
DataTest.php
Go to the documentation of this file.
1 <?php
7 
8 class DataTest extends \PHPUnit\Framework\TestCase
9 {
13  protected $_modulesReader;
14 
18  protected $_helper;
19 
20  protected function setUp()
21  {
22  $this->_modulesReader = $this->createMock(\Magento\Framework\Module\Dir\Reader::class);
23  $objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this);
24  $this->_helper = $objectManager->getObject(
25  \Magento\Persistent\Helper\Data::class,
26  ['modulesReader' => $this->_modulesReader]
27  );
28  }
29 
31  {
32  $this->_modulesReader->expects(
33  $this->once()
34  )->method(
35  'getModuleDir'
36  )->with(
37  'etc',
38  'Magento_Persistent'
39  )->will(
40  $this->returnValue('path123')
41  );
42  $this->assertEquals('path123/persistent.xml', $this->_helper->getPersistentConfigFilePath());
43  }
44 }
$objectManager
Definition: bootstrap.php:17