Exemplo n.º 1
0
 /**
  * @covers \Magento\Setup\Model\FilePermissions::getMissingWritableDirectoriesForInstallation
  * @covers \Magento\Setup\Model\FilePermissions::getMissingWritablePathsForInstallation
  */
 public function testGetMissingWritableDirectoriesAndPathsForInstallation()
 {
     $this->setUpDirectoryListInstallation();
     $this->setUpDirectoryWriteInstallation();
     $expected = [BP . '/var', BP . '/pub/media', BP . '/pub/static'];
     $this->assertEquals($expected, array_values($this->filePermissions->getMissingWritableDirectoriesForInstallation()));
     $this->assertEquals($expected, array_values($this->filePermissions->getMissingWritablePathsForInstallation()));
 }
 /**
  * Check permissions of directories that are expected to be writable for installation
  *
  * @return void
  * @throws \Exception
  */
 public function checkInstallationFilePermissions()
 {
     $results = $this->filePermissions->getMissingWritablePathsForInstallation();
     if ($results) {
         $errorMsg = "Missing write permissions to the following paths: '" . implode("' '", $results) . "'";
         throw new \Exception($errorMsg);
     }
 }