public function testReplaceTmpEncryptKey() { $keyPlaceholder = \Magento\Install\Model\Installer\Config::TMP_ENCRYPT_KEY_VALUE; $fixtureConfigData = "<key>{$keyPlaceholder}</key>"; $expectedConfigData = '<key>3c7cf2e909fd5e2268a6e1539ae3c835</key>'; $this->_directoryMock->expects($this->once())->method('readFile')->with($this->equalTo($this->_tmpConfigFile))->will($this->returnValue($fixtureConfigData)); $this->_directoryMock->expects($this->once())->method('writeFile')->with($this->equalTo($this->_tmpConfigFile), $this->equalTo($expectedConfigData))->will($this->returnValue($fixtureConfigData)); $this->_model->replaceTmpEncryptKey('3c7cf2e909fd5e2268a6e1539ae3c835'); }
/** * Retrieve configuration form data object * * @return \Magento\Framework\Object */ public function getFormData() { $data = $this->getData('form_data'); if (is_null($data)) { $data = $this->_session->getConfigData(true); if (empty($data)) { $data = $this->_installerConfig->getFormData(); } else { $data = new \Magento\Framework\Object($data); } $this->setFormData($data); } return $data; }
public function testFinish() { $cacheTypeListArray = array('one', 'two'); $this->_cache->expects($this->once())->method('clean'); $this->_config->expects($this->once())->method('reinit'); $this->_cacheState->expects($this->once())->method('persist'); $this->_cacheState->expects($this->exactly(count($cacheTypeListArray)))->method('setEnabled'); $this->_cacheTypeList->expects($this->once())->method('getTypes')->will($this->returnValue($cacheTypeListArray)); $this->_appState->expects($this->once())->method('setInstallDate')->with($this->greaterThanOrEqual(date('r'))); $this->_installerConfig->expects($this->once())->method('replaceTmpInstallDate')->with($this->greaterThanOrEqual(date('r'))); $this->assertSame($this->_model, $this->_model->finish()); }
/** * Store install date and set application into installed state * * @return void */ protected function _setAppInstalled() { $dateTime = date('r'); $this->_installerConfig->replaceTmpInstallDate($dateTime); $this->_appState->setInstallDate($dateTime); }