Skip to content

Commit d471820

Browse files
author
He, Joan(johe)
committed
Merge pull request #565 from magento-extensibility/MAGETWO-41996-merchant-beta
[Extensibility] MAGETWO-41996: [GitHub] DI compilation fails on class keyword #1722, MAGETWO-41792: Multiple stores at different paths rendering wrong store base_url
2 parents 18b6326 + 1965343 commit d471820

File tree

10 files changed

+38
-226
lines changed

10 files changed

+38
-226
lines changed

app/code/Magento/Directory/Test/Unit/Block/CurrencyTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ class CurrencyTest extends \PHPUnit_Framework_TestCase
2626
public function setUp()
2727
{
2828
$this->urlBuilder = $this->getMock(
29-
'\Magento\Framework\UrlInterface\Proxy',
30-
['getUrl'],
29+
'\Magento\Framework\UrlInterface',
30+
[],
3131
[],
3232
'',
3333
false

app/code/Magento/Store/etc/di.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@
9292
<arguments>
9393
<argument name="session" xsi:type="object" shared="false">Magento\Framework\Session\Generic\Proxy</argument>
9494
<argument name="isCustomEntryPoint" xsi:type="init_parameter">Magento\Store\Model\Store::CUSTOM_ENTRY_POINT_PARAM</argument>
95-
<argument name="url" xsi:type="object" shared="false">Magento\Framework\UrlInterface\Proxy</argument>
95+
<argument name="url" xsi:type="object" shared="false">Magento\Framework\UrlInterface</argument>
9696
</arguments>
9797
</type>
9898
<type name="Magento\Store\Model\StoreManager">
@@ -249,7 +249,7 @@
249249
</type>
250250
<type name="Magento\Framework\App\Helper\Context">
251251
<arguments>
252-
<argument name="urlBuilder" xsi:type="object">Magento\Framework\UrlInterface\Proxy</argument>
252+
<argument name="urlBuilder" xsi:type="object">Magento\Framework\UrlInterface</argument>
253253
<argument name="httpRequest" xsi:type="object">Magento\Framework\App\Request\Http\Proxy</argument>
254254
</arguments>
255255
</type>

app/code/Magento/Wishlist/Test/Unit/Helper/DataTest.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
use Magento\Framework\App\Helper\Context;
1010
use Magento\Framework\Data\Helper\PostHelper;
1111
use Magento\Framework\Registry;
12-
use Magento\Framework\UrlInterface\Proxy as UrlInterface;
12+
use Magento\Framework\UrlInterface;
1313
use Magento\Store\Model\Store;
1414
use Magento\Store\Model\StoreManagerInterface;
1515
use Magento\Wishlist\Controller\WishlistProviderInterface;
@@ -69,9 +69,8 @@ public function setUp()
6969
->method('getStore')
7070
->willReturn($this->store);
7171

72-
$this->urlBuilder = $this->getMockBuilder('Magento\Framework\UrlInterface\Proxy')
72+
$this->urlBuilder = $this->getMockBuilder('Magento\Framework\UrlInterface')
7373
->disableOriginalConstructor()
74-
->setMethods(['getUrl'])
7574
->getMock();
7675

7776
$this->context = $this->getMockBuilder('Magento\Framework\App\Helper\Context')

app/etc/di.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1128,7 +1128,7 @@
11281128
</type>
11291129
<type name="Magento\Framework\Url\Decoder">
11301130
<arguments>
1131-
<argument name="urlBuilder" xsi:type="object">Magento\Framework\UrlInterface\Proxy</argument>
1131+
<argument name="urlBuilder" xsi:type="object">Magento\Framework\UrlInterface</argument>
11321132
</arguments>
11331133
</type>
11341134
</config>

dev/tests/static/testsuite/Magento/Test/Integrity/_files/blacklist/namespace.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,3 +98,4 @@ setup/src/Magento/Setup/Test/Unit/Module/Di/_files/app/code/Magento/SomeModule/M
9898
setup/src/Magento/Setup/Test/Unit/Module/Di/_files/app/code/Magento/SomeModule/Helper/Test.php
9999
setup/src/Magento/Setup/Test/Unit/Module/Di/_files/app/code/Magento/SomeModule/Element.php
100100
setup/src/Magento/Setup/Test/Unit/Module/Di/_files/app/code/Magento/SomeModule/ElementFactory.php
101+
setup/src/Magento/Setup/Test/Unit/Module/Di/_files/app/code/Magento/SomeModule/Model/DoubleColon.php

dev/tests/static/testsuite/Magento/Test/Integrity/_files/blacklist/reference.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,4 +70,5 @@ Model3
7070
\Magento\Mtf\Client\Element
7171
\Magento\Mtf\TestSuite\AppState
7272
\Magento\Framework\A
73-
\Magento\Framework\B
73+
\Magento\Framework\B
74+
DoubleColon

lib/internal/Magento/Framework/UrlInterface/Proxy.php

Lines changed: 0 additions & 212 deletions
This file was deleted.

setup/src/Magento/Setup/Module/Di/Code/Scanner/PhpScanner.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -227,17 +227,17 @@ protected function _fetchClasses($namespace, $tokenIterator, $count, $tokens)
227227
protected function _getDeclaredClasses($file)
228228
{
229229
$classes = [];
230-
$namespace = "";
230+
$namespace = '';
231231
$tokens = token_get_all(file_get_contents($file));
232232
$count = count($tokens);
233233

234234
for ($tokenIterator = 0; $tokenIterator < $count; $tokenIterator++) {
235-
if ($tokens[$tokenIterator][0] === T_NAMESPACE) {
235+
if ($tokens[$tokenIterator][0] == T_NAMESPACE) {
236236
$namespace .= $this->_fetchNamespace($tokenIterator, $count, $tokens);
237237
}
238238

239-
if ($tokens[$tokenIterator][0] === T_CLASS
240-
|| $tokens[$tokenIterator][0] === T_INTERFACE
239+
if (($tokens[$tokenIterator][0] == T_CLASS || $tokens[$tokenIterator][0] == T_INTERFACE)
240+
&& $tokens[$tokenIterator - 1][0] != T_DOUBLE_COLON
241241
) {
242242
$classes = array_merge($classes, $this->_fetchClasses($namespace, $tokenIterator, $count, $tokens));
243243
}

setup/src/Magento/Setup/Test/Unit/Module/Di/Code/Scanner/PhpScannerTest.php

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

88
require_once __DIR__ . '/../../_files/app/code/Magento/SomeModule/Helper/Test.php';
99
require_once __DIR__ . '/../../_files/app/code/Magento/SomeModule/ElementFactory.php';
10+
require_once __DIR__ . '/../../_files/app/code/Magento/SomeModule/Model/DoubleColon.php';
11+
1012
class PhpScannerTest extends \PHPUnit_Framework_TestCase
1113
{
1214
/**
@@ -35,7 +37,10 @@ protected function setUp()
3537
$this->_logMock = $this->getMock('\Magento\Setup\Module\Di\Compiler\Log\Log', [], [], '', false)
3638
);
3739
$this->_testDir = str_replace('\\', '/', realpath(__DIR__ . '/../../') . '/_files');
38-
$this->_testFiles = [$this->_testDir . '/app/code/Magento/SomeModule/Helper/Test.php'];
40+
$this->_testFiles = [
41+
$this->_testDir . '/app/code/Magento/SomeModule/Helper/Test.php',
42+
$this->_testDir . '/app/code/Magento/SomeModule/Model/DoubleColon.php'
43+
];
3944
}
4045

4146
public function testCollectEntities()
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?php
2+
/**
3+
* Copyright © 2015 Magento. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
namespace Magento\SomeModule\Model;
7+
8+
class DoubleColon
9+
{
10+
public function __construct()
11+
{
12+
DoubleColon::class;
13+
}
14+
15+
public function method()
16+
{
17+
}
18+
}

0 commit comments

Comments
 (0)