Ejemplo n.º 1
0
 public function setUp()
 {
     $this->dbValidator = $this->getMock('Magento\\Setup\\Validator\\DbValidator', [], [], '', false);
     $this->deploymentConfig = $this->getMock('Magento\\Framework\\App\\DeploymentConfig', [], [], '', false);
     $this->deploymentConfig->expects($this->once())->method('get')->willReturn([ConfigOptionsListConstants::KEY_NAME => 'dbname', ConfigOptionsListConstants::KEY_HOST => 'host', ConfigOptionsListConstants::KEY_USER => 'username', ConfigOptionsListConstants::KEY_PASSWORD => 'password']);
     $this->filesystem = $this->getMock('Magento\\Framework\\Filesystem', [], [], '', false);
     $this->write = $this->getMock('Magento\\Framework\\Filesystem\\Directory\\Write', [], [], '', false);
     $this->filesystem->expects($this->once())->method('getDirectoryWrite')->willReturn($this->write);
     $this->phpReadinessCheck = $this->getMock('Magento\\Setup\\Model\\PhpReadinessCheck', [], [], '', false);
     $this->basePackageInfo = $this->getMock('Magento\\Setup\\Model\\BasePackageInfo', [], [], '', false);
     $this->basePackageInfo->expects($this->once())->method('getPaths')->willReturn([__FILE__]);
     $this->status = $this->getMock('Magento\\Setup\\Model\\Cron\\Status', [], [], '', false);
     $this->readinessCheck = new ReadinessCheck($this->dbValidator, $this->deploymentConfig, $this->filesystem, $this->phpReadinessCheck, $this->basePackageInfo, $this->status);
     $this->phpReadinessCheck->expects($this->once())->method('checkPhpVersion')->willReturn(['responseType' => 'success']);
     $this->phpReadinessCheck->expects($this->once())->method('checkPhpExtensions')->willReturn(['responseType' => 'success']);
     $this->phpReadinessCheck->expects($this->once())->method('checkPhpCronSettings')->willReturn(['responseType' => 'success']);
     $this->expected = [ReadinessCheck::KEY_PHP_VERSION_VERIFIED => ['responseType' => 'success'], ReadinessCheck::KEY_PHP_EXTENSIONS_VERIFIED => ['responseType' => 'success'], ReadinessCheck::KEY_PHP_SETTINGS_VERIFIED => ['responseType' => 'success']];
 }