Skip to content

Commit 0e7e6d1

Browse files
author
Pavlo Cherniavskyi
committed
MAGETWO-33622: Junior+ Developer Workflow
- fix tests
1 parent 95c2147 commit 0e7e6d1

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

dev/tests/unit/testsuite/Magento/Framework/App/View/Asset/MaterializationStrategy/SymlinkTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
namespace Magento\Framework\App\View\Asset\MaterializationStrategy;
88

9+
use Magento\Framework\App\Filesystem\DirectoryList;
910
use Magento\Framework\View\Asset;
1011

1112
class SymlinkTest extends \PHPUnit_Framework_TestCase
@@ -61,7 +62,7 @@ public function sourceFileDataProvider()
6162
{
6263
return [
6364
['path/to/file', true],
64-
[Asset\Source::TMP_MATERIALIZATION_DIR . '/path/to/file', false]
65+
[DirectoryList::TMP_MATERIALIZATION_DIR . '/path/to/file', false]
6566
];
6667
}
6768
}

dev/tests/unit/testsuite/Magento/Framework/Less/FileGeneratorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ public function testGenerateLessFileTree()
7979
$expectedPath = '/var/view_preprocessed/less/some/file.less';
8080

8181
$asset = $this->getMock('\Magento\Framework\View\Asset\File', [], [], '', false);
82-
$asset->expects($this->once())
82+
$asset->expects($this->exactly(2))
8383
->method('getPath')
8484
->will($this->returnValue('some/file.css'));
8585
$chain = new \Magento\Framework\View\Asset\PreProcessor\Chain($asset, $originalContent, 'less');

lib/internal/Magento/Framework/View/Asset/PreProcessor/Chain.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,14 @@ class Chain
5353
* @param \Magento\Framework\View\Asset\LocalInterface $asset
5454
* @param string $origContent
5555
* @param string $origContentType
56+
* @param null $origAssetPath
57+
* @param string $appMode
5658
*/
5759
public function __construct(
5860
\Magento\Framework\View\Asset\LocalInterface $asset,
5961
$origContent,
6062
$origContentType,
61-
$origPath,
63+
$origAssetPath = null,
6264
$appMode = \Magento\Framework\App\State::MODE_DEFAULT
6365
) {
6466
$this->asset = $asset;
@@ -67,13 +69,12 @@ public function __construct(
6769
$this->origContentType = $origContentType;
6870
$this->contentType = $origContentType;
6971
$this->appMode = $appMode;
72+
$this->targetContentType = $asset->getContentType();
73+
$this->targetAssetPath = $asset->getPath();
7074

7175
if ($appMode == \Magento\Framework\App\State::MODE_DEVELOPER) {
7276
$this->targetContentType = $this->origContentType;
73-
$this->targetAssetPath = $origPath;
74-
} else {
75-
$this->targetContentType = $asset->getContentType();
76-
$this->targetAssetPath = $asset->getPath();
77+
$this->targetAssetPath = $origAssetPath;
7778
}
7879
}
7980

0 commit comments

Comments
 (0)