Skip to content

Commit

Permalink
Merge branch 'release-12.33.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions committed Oct 11, 2022
2 parents 05791a6 + d576d84 commit c08f5dc
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 5 deletions.
6 changes: 3 additions & 3 deletions model/sharedStimulus/service/CopyService.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,14 +111,14 @@ private function copyCSSFilesFrom(SharedStimulusInstanceData $source): array

$newCssFiles = [];

foreach ($cssFiles as $baseName) {
foreach ($cssFiles['children'] as $child) {
$newCssFiles[] = $this->tempFileWriter->writeFile(
self::NAMESPACE_TEMP_FILES,
$baseName,
$child['name'],
$this->stylesheetRepository->read(
implode(
DIRECTORY_SEPARATOR,
[$cssPath , StoreService::CSS_DIR_NAME, $baseName]
[$cssPath , StoreService::CSS_DIR_NAME, $child['name']]
)
)
);
Expand Down
25 changes: 23 additions & 2 deletions test/unit/model/sharedStimulus/service/CopyServiceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -230,13 +230,34 @@ public function testSuccessfulCopy(): void
->expects($this->once())
->method('getList')
->willReturnCallback(function (ListStylesheets $dto) {
if ($dto->getUri() != 'http://example.com/resource1') {
if ($dto->getUri() !== 'http://example.com/resource1') {
$this->fail(
"Unexpected call to getList for URI {$dto->getUri()}"
);
}
})
->willReturn(['cssBasename1', 'cssBasename2']);
->willReturn([
'path' => DIRECTORY_SEPARATOR,
'label' => 'Passage stylesheets',
'childrenLimit' => 100,
'total' => 2,
'children' => [
[
'name' => 'cssBasename1',
'uri' => DIRECTORY_SEPARATOR . 'cssBasename1',
'mime' => 'text/css',
'filePath' => DIRECTORY_SEPARATOR . 'cssBasename1',
'size' => 100,
],
[
'name' => 'cssBasename2',
'uri' => DIRECTORY_SEPARATOR . 'cssBasename2',
'mime' => 'text/css',
'filePath' => DIRECTORY_SEPARATOR . 'cssBasename2',
'size' => 200,
],
],
]);

$this->tempFileWriter
->expects($this->exactly(2))
Expand Down

0 comments on commit c08f5dc

Please sign in to comment.