/** * Set up before test */ public function setUp() { $this->_objectManager = new \Magento\TestFramework\Helper\ObjectManager($this); $this->_configMock = $this->getMock('\\Magento\\Install\\Model\\Config', array(), array(), '', false); $this->_configMock->expects($this->any())->method('getWizardSteps')->will($this->returnValue(array())); $this->_urlBuilderMock = $this->getMock('\\Magento\\Framework\\UrlInterface', array(), array(), '', false); $this->_requestMock = $this->getMock('\\Magento\\Framework\\App\\RequestInterface', array(), array(), '', false); $this->_model = $this->_objectManager->getObject('Magento\\Install\\Model\\Wizard', array('urlBuilder' => $this->_urlBuilderMock, 'installConfig' => $this->_configMock)); }
public function testGetPathForCheck() { $directories = $this->_object->getPathForCheck(); $this->assertEquals(2, count($directories['writeable'])); $this->assertCount(2, $directories['writeable']); $expected = array(array('existence' => '1', 'recursive' => '0'), array('existence' => '1', 'recursive' => '1')); $this->assertEquals($expected, $directories['writeable']); }
/** * Check file system by config * * @return bool */ protected function _checkFilesystem() { $res = true; $config = $this->_installConfig->getWritableFullPathsForCheck(); if (is_array($config)) { foreach ($config as $item) { $recursive = isset($item['recursive']) ? (bool) $item['recursive'] : false; $existence = isset($item['existence']) ? (bool) $item['existence'] : false; $checkRes = $this->_checkFullPath($item['path'], $recursive, $existence); $res = $res && $checkRes; } } return $res; }
/** * Init install wizard * @param UrlInterface $urlBuilder * @param Config $installConfig */ public function __construct(UrlInterface $urlBuilder, Config $installConfig) { $this->_steps = $installConfig->getWizardSteps(); $this->_urlBuilder = $urlBuilder; $this->_initSteps(); }