/** * Check permissions of directories that are expected to be writable for installation * * @return void * @throws \Exception */ private function checkInstallationFilePermissions() { $results = $this->filePermissions->getMissingWritablePathsForInstallation(); if ($results) { $errorMsg = "Missing write permissions to the following paths:" . PHP_EOL . implode(PHP_EOL, $results); throw new \Exception($errorMsg); } }
/** * @covers \Magento\Framework\Setup\FilePermissions::getMissingWritableDirectoriesForInstallation * @covers \Magento\Framework\Setup\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())); }