Beispiel #1
0
 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');
 }
Beispiel #2
0
 /**
  * Install encryption key into the application, generate and return a random one, if no value is specified
  *
  * @param string $key
  * @return $this
  */
 public function installEncryptionKey($key)
 {
     $this->_encryptor->validateKey($key);
     $this->_installerConfig->replaceTmpEncryptKey($key);
     $this->_refreshConfig();
     return $this;
 }