Skip to content

Commit 80847f6

Browse files
MAGETWO-63295: Installation fails because 'generated' directory is not writable
1 parent e0b2623 commit 80847f6

File tree

1 file changed

+23
-34
lines changed

1 file changed

+23
-34
lines changed

lib/internal/Magento/Framework/App/Test/Unit/Filesystem/DirectoryListTest.php

Lines changed: 23 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
namespace Magento\Framework\App\Test\Unit\Filesystem;
88

99
use \Magento\Framework\App\Filesystem\DirectoryList;
10-
use Magento\Framework\Code\Generator\Io;
1110

1211
class DirectoryListTest extends \PHPUnit_Framework_TestCase
1312
{
@@ -42,38 +41,28 @@ public function testUnknownDirectory()
4241

4342
public function testGetDefaultConfig()
4443
{
45-
$this->assertEquals(
46-
[
47-
DirectoryList::ROOT => [DirectoryList::PATH => ''],
48-
DirectoryList::APP => [DirectoryList::PATH => 'app'],
49-
DirectoryList::CONFIG => [DirectoryList::PATH => 'app/etc'],
50-
DirectoryList::LIB_INTERNAL => [DirectoryList::PATH => 'lib/internal'],
51-
DirectoryList::VAR_DIR => [DirectoryList::PATH => 'var'],
52-
DirectoryList::CACHE => [DirectoryList::PATH => 'var/cache'],
53-
DirectoryList::LOG => [DirectoryList::PATH => 'var/log'],
54-
DirectoryList::DI => [DirectoryList::PATH => 'generated/metadata'],
55-
DirectoryList::GENERATION => [DirectoryList::PATH => Io::DEFAULT_DIRECTORY],
56-
DirectoryList::SESSION => [DirectoryList::PATH => 'var/session'],
57-
DirectoryList::MEDIA => [DirectoryList::PATH => 'pub/media', DirectoryList::URL_PATH => 'pub/media'],
58-
DirectoryList::STATIC_VIEW => [
59-
DirectoryList::PATH => 'pub/static',
60-
DirectoryList::URL_PATH => 'pub/static'
61-
],
62-
DirectoryList::PUB => [DirectoryList::PATH => 'pub', DirectoryList::URL_PATH => 'pub'],
63-
DirectoryList::LIB_WEB => [DirectoryList::PATH => 'lib/web'],
64-
DirectoryList::TMP => [DirectoryList::PATH => 'var/tmp'],
65-
DirectoryList::UPLOAD => [
66-
DirectoryList::PATH => 'pub/media/upload',
67-
DirectoryList::URL_PATH => 'pub/media/upload'
68-
],
69-
DirectoryList::TMP_MATERIALIZATION_DIR => [DirectoryList::PATH => 'var/view_preprocessed'],
70-
DirectoryList::TEMPLATE_MINIFICATION_DIR => [DirectoryList::PATH => 'var/view_preprocessed/html'],
71-
DirectoryList::SETUP => [DirectoryList::PATH => 'setup/src'],
72-
DirectoryList::COMPOSER_HOME => [DirectoryList::PATH => 'var/composer_home'],
73-
DirectoryList::GENERATED => [DirectoryList::PATH => 'generated'],
74-
DirectoryList::SYS_TMP => [DirectoryList::PATH => '']
75-
],
76-
DirectoryList::getDefaultConfig()
77-
);
44+
$defaultConfig = DirectoryList::getDefaultConfig();
45+
46+
$this->assertArrayHasKey(DirectoryList::GENERATED, $defaultConfig);
47+
$this->assertArrayHasKey(DirectoryList::DI, $defaultConfig);
48+
$this->assertArrayHasKey(DirectoryList::GENERATION, $defaultConfig);
49+
$this->assertArrayHasKey(DirectoryList::ROOT, $defaultConfig);
50+
$this->assertArrayHasKey(DirectoryList::APP, $defaultConfig);
51+
$this->assertArrayHasKey(DirectoryList::CONFIG, $defaultConfig);
52+
$this->assertArrayHasKey(DirectoryList::LIB_INTERNAL, $defaultConfig);
53+
$this->assertArrayHasKey(DirectoryList::VAR_DIR, $defaultConfig);
54+
$this->assertArrayHasKey(DirectoryList::CACHE, $defaultConfig);
55+
$this->assertArrayHasKey(DirectoryList::LOG, $defaultConfig);
56+
$this->assertArrayHasKey(DirectoryList::SESSION, $defaultConfig);
57+
$this->assertArrayHasKey(DirectoryList::MEDIA, $defaultConfig);
58+
$this->assertArrayHasKey(DirectoryList::STATIC_VIEW, $defaultConfig);
59+
$this->assertArrayHasKey(DirectoryList::PUB, $defaultConfig);
60+
$this->assertArrayHasKey(DirectoryList::LIB_WEB, $defaultConfig);
61+
$this->assertArrayHasKey(DirectoryList::TMP, $defaultConfig);
62+
$this->assertArrayHasKey(DirectoryList::UPLOAD, $defaultConfig);
63+
$this->assertArrayHasKey(DirectoryList::TEMPLATE_MINIFICATION_DIR, $defaultConfig);
64+
$this->assertArrayHasKey(DirectoryList::TMP_MATERIALIZATION_DIR, $defaultConfig);
65+
$this->assertArrayHasKey(DirectoryList::SETUP, $defaultConfig);
66+
$this->assertArrayHasKey(DirectoryList::COMPOSER_HOME, $defaultConfig);
7867
}
7968
}

0 commit comments

Comments
 (0)