Skip to content

Commit 86744b3

Browse files
committed
ACP2E-4246: Merged js files are not properly generated on projects with many stores.
1 parent c08a3fc commit 86744b3

File tree

2 files changed

+21
-19
lines changed

2 files changed

+21
-19
lines changed

lib/internal/Magento/Framework/View/Asset/File.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
/**
3-
* Copyright © Magento, Inc. All rights reserved.
4-
* See COPYING.txt for license details.
3+
* Copyright 2014 Adobe
4+
* All Rights Reserved.
55
*/
66

77
namespace Magento\Framework\View\Asset;
@@ -208,7 +208,6 @@ public function getContent()
208208
);
209209
}
210210

211-
212211
/**
213212
* @inheritdoc
214213
*/

lib/internal/Magento/Framework/View/Test/Unit/Asset/FileTest.php

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
/**
3-
* Copyright © Magento, Inc. All rights reserved.
4-
* See COPYING.txt for license details.
3+
* Copyright 2014 Adobe
4+
* All Rights Reserved.
55
*/
66
declare(strict_types=1);
77

@@ -124,36 +124,39 @@ public function testGetSourceFileMissing()
124124
}
125125

126126
/**
127-
* @param string $content
128-
*
129-
* @dataProvider getContentDataProvider
127+
* @return void
130128
*/
131-
public function testGetContent($content)
129+
public function testGetContentRegularRead(): void
132130
{
133-
$this->source->expects($this->exactly(2))
131+
$content = 'some content here';
132+
$this->source->expects($this->once())
134133
->method('getContent')
135134
->with($this->object)
136135
->willReturn($content);
137136
$this->assertEquals($content, $this->object->getContent());
138-
$this->assertEquals($content, $this->object->getContent()); // no in-memory caching for content
139137
}
140138

141139
/**
142-
* @return array
140+
* @return void
143141
*/
144-
public static function getContentDataProvider()
142+
public function testGetContentWithRetries(): void
145143
{
146-
return [
147-
'normal content' => ['content'],
148-
'empty content' => [''],
149-
];
144+
$content = 'some content here';
145+
$this->source->expects($this->exactly(3))
146+
->method('getContent')
147+
->with($this->object)
148+
->willReturnOnConsecutiveCalls('', false, $content);
149+
$this->assertEquals($content, $this->object->getContent());
150150
}
151151

152-
public function testGetContentNotFound()
152+
/**
153+
* @return void
154+
*/
155+
public function testGetContentNotFound(): void
153156
{
154157
$this->expectException('Magento\Framework\View\Asset\File\NotFoundException');
155158
$this->expectExceptionMessage('Unable to get content for \'Magento_Module/dir/file.css\'');
156-
$this->source->expects($this->once())
159+
$this->source->expects($this->exactly(3))
157160
->method('getContent')
158161
->with($this->object)
159162
->willReturn(false);

0 commit comments

Comments
 (0)