Skip to content

Commit 2845013

Browse files
committed
TDMET-5 fix integration test issues
1 parent 86e27aa commit 2845013

File tree

8 files changed

+26
-16
lines changed

8 files changed

+26
-16
lines changed

Model/Command/ApplyMediaFiles.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
use Firegento\ContentProvisioning\Api\TargetMediaDirectoryPathProviderInterface;
88
use Magento\Framework\Exception\FileSystemException;
99
use Magento\Framework\Filesystem\DriverInterface;
10-
use SplFileInfo;
1110

1211
class ApplyMediaFiles
1312
{
@@ -61,7 +60,7 @@ private function copyFile(string $sourceDirPath, string $fileName): void
6160
$targetPathname = $targetDirPath . DIRECTORY_SEPARATOR . $fileName;
6261

6362
if ($this->fileSystemDriver->isFile($sourcePathname)
64-
&& $this->fileSystemDriver->isReadable($sourcePathname)()
63+
&& $this->fileSystemDriver->isReadable($sourcePathname)
6564
) {
6665
$this->createDirectory($targetDirPath, $sourceDirPath, $sourcePathname);
6766
$this->fileSystemDriver->copy($sourcePathname, $targetPathname);

Model/Config/Parser/ParserChain.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
use Firegento\ContentProvisioning\Api\ConfigParserInterface;
88
use Magento\Framework\Exception\LocalizedException;
99

10+
/**
11+
* @api
12+
*/
1013
class ParserChain implements ConfigParserInterface
1114
{
1215
/**

Model/Config/Parser/Query/FetchMediaFilesChain.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
use Firegento\ContentProvisioning\Api\MediaFilesParserInterface;
77
use Magento\Framework\Exception\LocalizedException;
88

9+
/**
10+
* @api
11+
*/
912
class FetchMediaFilesChain implements MediaFilesParserInterface
1013
{
1114
/**
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<h5>Some foobar</h5>
2-
<p>Foobar: <a href="{{media url=&quot;image-1.png&quot;}}">Link zu einem Bilder</a></p>
2+
<p>Foobar: <a href="{{media url=image-1.png}}">Link zu einem Bilder</a></p>
33
<p>Dummy content...</p>
4-
<p>Image:&nbsp;<img src="{{media url=&quot;some-test-image.png&quot;}}" alt="fooo" width="300"></p>
5-
<p>Image 2:&nbsp;<img src="{{media url=&quot;foobar/test.png&quot;}}" alt="" width="450" height="150"></p>
4+
<p>Image:&nbsp;<img src="{{media url=some-test-image.png}}" alt="fooo" width="300"></p>
5+
<p>Image 2:&nbsp;<img src="{{media url=foobar/test.png}}" alt="" width="450" height="150"></p>

Test/Integration/Model/PageInstaller/InstallMediaFilesTest.php

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -81,13 +81,7 @@ protected function setUp(): void
8181
*/
8282
private function getChildDirectoryUrl(string $name): string
8383
{
84-
foreach ($this->fileSystem->getChildren() as $child) {
85-
if ($child->getName() === $name) {
86-
return $child->url();
87-
}
88-
}
89-
90-
$this->fail('Unknown child name for virtual directory!');
84+
return $this->fileSystem->getChild($name)->url();
9185
}
9286

9387
protected function initEntries()
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<h5>Some foobar</h5>
2-
<p>Foobar: <a href="{{media url=&quot;image-1.png&quot;}}">Link zu einem Bilder</a></p>
2+
<p>Foobar: <a href="{{media url=image-1.png}}">Link zu einem Bilder</a></p>
33
<p>Dummy content...</p>
4-
<p>Image:&nbsp;<img src="{{media url=&quot;some-test-image.png&quot;}}" alt="fooo" width="300"></p>
5-
<p>Image 2:&nbsp;<img src="{{media url=&quot;foobar/test.png&quot;}}" alt="" width="450" height="150"></p>
4+
<p>Image:&nbsp;<img src="{{media url=some-test-image.png}}" alt="fooo" width="300"></p>
5+
<p>Image 2:&nbsp;<img src="{{media url=foobar/test.png}}" alt="" width="450" height="150"></p>

Test/Integration/phpunit.gitlab.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
<!-- Semicolon-separated 'glob' patterns, that match global XML configuration files -->
4343
<const name="TESTS_GLOBAL_CONFIG_DIR" value="../../../app/etc"/>
4444
<!-- Whether to cleanup the application before running tests or not -->
45-
<const name="TESTS_CLEANUP" value="enabled"/>
45+
<const name="TESTS_CLEANUP" value="disabled"/>
4646
<!-- Memory usage and estimated leaks thresholds -->
4747
<!--<const name="TESTS_MEM_USAGE_LIMIT" value="1024M"/>-->
4848
<const name="TESTS_MEM_LEAK_LIMIT" value=""/>

etc/di.xml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,17 @@
105105
</arguments>
106106
</type>
107107

108+
<type name="Firegento\ContentProvisioning\Model\Resolver\FileContentResolver">
109+
<arguments>
110+
<argument name="fileSystemDriver" xsi:type="object">Magento\Framework\Filesystem\Driver\File</argument>
111+
</arguments>
112+
</type>
113+
<type name="Firegento\ContentProvisioning\Model\Command\ApplyMediaFiles">
114+
<arguments>
115+
<argument name="fileSystemDriver" xsi:type="object">Magento\Framework\Filesystem\Driver\File</argument>
116+
</arguments>
117+
</type>
118+
108119
<type name="Firegento\ContentProvisioning\Model\Resolver\ContentResolverProvider">
109120
<arguments>
110121
<argument name="contentResolvers" xsi:type="array">

0 commit comments

Comments
 (0)