Skip to content

Commit bfa4583

Browse files
committed
MAGETWO-69235: Do not di:compile tests/ folder #9660
- Merge Pull Request #9660 from kassner/magento2:patch-8
2 parents 8a84178 + 7b2647c commit bfa4583

File tree

18 files changed

+172
-34
lines changed

18 files changed

+172
-34
lines changed

app/code/Magento/Config/Model/Config/Backend/Email/Logo.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111
*/
1212
namespace Magento\Config\Model\Config\Backend\Email;
1313

14+
/**
15+
* @deprecated
16+
*/
1417
class Logo extends \Magento\Config\Model\Config\Backend\Image
1518
{
1619
/**

app/code/Magento/Email/Model/AbstractTemplate.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ protected function getLogoUrl($store)
389389
$store
390390
);
391391
if ($fileName) {
392-
$uploadDir = \Magento\Config\Model\Config\Backend\Email\Logo::UPLOAD_DIR;
392+
$uploadDir = \Magento\Email\Model\Design\Backend\Logo::UPLOAD_DIR;
393393
$mediaDirectory = $this->filesystem->getDirectoryRead(DirectoryList::MEDIA);
394394
if ($mediaDirectory->isFile($uploadDir . '/' . $fileName)) {
395395
return $this->storeManager->getStore()->getBaseUrl(
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<?php
2+
/**
3+
* Copyright © 2013-2017 Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
namespace Magento\Email\Model\Design\Backend;
7+
8+
use Magento\Theme\Model\Design\Backend\Logo as DesignLogo;
9+
10+
class Logo extends DesignLogo
11+
{
12+
/**
13+
* The tail part of directory path for uploading
14+
*/
15+
const UPLOAD_DIR = 'email/logo';
16+
17+
/**
18+
* Upload max file size in kilobytes
19+
*
20+
* @var int
21+
*/
22+
protected $maxFileSize = 2048;
23+
24+
/**
25+
* Getter for allowed extensions of uploaded files
26+
*
27+
* @return string[]
28+
*/
29+
public function getAllowedExtensions()
30+
{
31+
return ['jpg', 'jpeg', 'gif', 'png'];
32+
}
33+
}

app/code/Magento/Email/composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"description": "N/A",
44
"require": {
55
"php": "~5.6.5|7.0.2|7.0.4|~7.0.6",
6+
"magento/module-theme": "100.1.*",
67
"magento/module-config": "100.1.*",
78
"magento/module-store": "100.1.*",
89
"magento/module-cms": "101.0.*",

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
<item name="email_logo" xsi:type="array">
2828
<item name="path" xsi:type="string">design/email/logo</item>
2929
<item name="fieldset" xsi:type="string">other_settings/email</item>
30-
<item name="backend_model" xsi:type="string">Magento\Theme\Model\Design\Backend\Logo</item>
30+
<item name="backend_model" xsi:type="string">Magento\Email\Model\Design\Backend\Logo</item>
3131
<item name="base_url" xsi:type="array">
3232
<item name="type" xsi:type="string">media</item>
3333
<item name="scope_info" xsi:type="string">1</item>

app/code/Magento/Reports/view/adminhtml/layout/reports_report_product_exportlowstockcsv.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@
88
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
99
<update handle="reports_report_product_lowstock_grid"/>
1010
<body>
11-
<container name="adminhtml.block.report.product.lowstock.grid.container" label="Export CSV"/>
11+
<block class="Magento\Backend\Block\Widget\Grid\Container" name="adminhtml.report.grid.container" template="Magento_Backend::widget/grid/container/empty.phtml"/>
1212
</body>
1313
</page>

app/code/Magento/Reports/view/adminhtml/layout/reports_report_product_exportlowstockexcel.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@
88
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
99
<update handle="reports_report_product_lowstock_grid"/>
1010
<body>
11-
<container name="adminhtml.block.report.product.lowstock.grid.container" label="Excel XML"/>
11+
<block class="Magento\Backend\Block\Widget\Grid\Container" name="adminhtml.report.grid.container" template="Magento_Backend::widget/grid/container/empty.phtml"/>
1212
</body>
1313
</page>

app/code/Magento/Theme/Model/Design/Backend/Logo.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class Logo extends Image
2121
*/
2222
protected function _getUploadDir()
2323
{
24-
return $this->_mediaDirectory->getRelativePath($this->_appendScopeInfo(self::UPLOAD_DIR));
24+
return $this->_mediaDirectory->getRelativePath($this->_appendScopeInfo(static::UPLOAD_DIR));
2525
}
2626

2727
/**

app/code/Magento/Wishlist/Pricing/ConfiguredPrice/ConfigurableProduct.php

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,12 @@ class ConfigurableProduct extends FinalPrice implements ConfiguredPriceInterface
2121
*/
2222
public function getValue()
2323
{
24-
$result = 0.;
2524
/** @var \Magento\Wishlist\Model\Item\Option $customOption */
2625
$customOption = $this->getProduct()->getCustomOption('simple_product');
27-
if ($customOption) {
28-
/** @var \Magento\Framework\Pricing\PriceInfoInterface $priceInfo */
29-
$priceInfo = $customOption->getProduct()->getPriceInfo();
30-
$result = $priceInfo->getPrice(self::PRICE_CODE)->getValue();
31-
}
32-
return max(0, $result);
26+
$product = $customOption ? $customOption->getProduct() : $this->getProduct();
27+
$price = $product->getPriceInfo()->getPrice(self::PRICE_CODE)->getValue();
28+
29+
return max(0, $price);
3330
}
3431

3532
/**

app/code/Magento/Wishlist/Test/Unit/Pricing/ConfiguredPrice/ConfigurableProductTest.php

Lines changed: 25 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,36 +5,30 @@
55
*/
66
namespace Magento\Wishlist\Test\Unit\Pricing\ConfiguredPrice;
77

8-
use Magento\Framework\Pricing\Adjustment\CalculatorInterface;
9-
use Magento\Framework\Pricing\PriceCurrencyInterface;
10-
use Magento\Framework\Pricing\PriceInfoInterface;
11-
use Magento\Framework\Pricing\SaleableInterface;
12-
use Magento\Wishlist\Pricing\ConfiguredPrice\ConfigurableProduct;
13-
148
class ConfigurableProductTest extends \PHPUnit_Framework_TestCase
159
{
1610
/**
17-
* @var SaleableInterface|\PHPUnit_Framework_MockObject_MockObject
11+
* @var \Magento\Framework\Pricing\SaleableInterface|\PHPUnit_Framework_MockObject_MockObject
1812
*/
1913
private $saleableItem;
2014

2115
/**
22-
* @var CalculatorInterface|\PHPUnit_Framework_MockObject_MockObject
16+
* @var \Magento\Framework\Pricing\Adjustment\CalculatorInterface|\PHPUnit_Framework_MockObject_MockObject
2317
*/
2418
private $calculator;
2519

2620
/**
27-
* @var PriceCurrencyInterface|\PHPUnit_Framework_MockObject_MockObject
21+
* @var \Magento\Framework\Pricing\PriceCurrencyInterface|\PHPUnit_Framework_MockObject_MockObject
2822
*/
2923
private $priceCurrency;
3024

3125
/**
32-
* @var ConfigurableProduct
26+
* @var \Magento\Wishlist\Pricing\ConfiguredPrice\ConfigurableProduct
3327
*/
3428
private $model;
3529

3630
/**
37-
* @var PriceInfoInterface|\PHPUnit_Framework_MockObject_MockObject
31+
* @var \Magento\Framework\Pricing\PriceInfoInterface|\PHPUnit_Framework_MockObject_MockObject
3832
*/
3933
private $priceInfoMock;
4034

@@ -49,17 +43,14 @@ protected function setUp()
4943
'getCustomOption',
5044
])
5145
->getMockForAbstractClass();
52-
$this->saleableItem->expects($this->once())
53-
->method('getPriceInfo')
54-
->willReturn($this->priceInfoMock);
5546

5647
$this->calculator = $this->getMockBuilder('Magento\Framework\Pricing\Adjustment\CalculatorInterface')
5748
->getMockForAbstractClass();
5849

5950
$this->priceCurrency = $this->getMockBuilder('Magento\Framework\Pricing\PriceCurrencyInterface')
6051
->getMockForAbstractClass();
6152

62-
$this->model = new ConfigurableProduct(
53+
$this->model = new \Magento\Wishlist\Pricing\ConfiguredPrice\ConfigurableProduct(
6354
$this->saleableItem,
6455
null,
6556
$this->calculator,
@@ -82,7 +73,7 @@ public function testGetValue()
8273
->getMock();
8374
$this->priceInfoMock->expects($this->once())
8475
->method('getPrice')
85-
->with(ConfigurableProduct::PRICE_CODE)
76+
->with(\Magento\Wishlist\Pricing\ConfiguredPrice\ConfigurableProduct::PRICE_CODE)
8677
->willReturn($priceMock);
8778

8879
$productMock = $this->getMockBuilder('Magento\Catalog\Model\Product')
@@ -109,11 +100,28 @@ public function testGetValue()
109100

110101
public function testGetValueWithNoCustomOption()
111102
{
103+
$priceValue = 100;
104+
105+
$priceMock = $this->getMockBuilder(\Magento\Framework\Pricing\Price\PriceInterface::class)
106+
->getMockForAbstractClass();
107+
$priceMock->expects($this->once())
108+
->method('getValue')
109+
->willReturn($priceValue);
110+
112111
$this->saleableItem->expects($this->once())
113112
->method('getCustomOption')
114113
->with('simple_product')
115114
->willReturn(null);
116115

117-
$this->assertEquals(0, $this->model->getValue());
116+
$this->saleableItem->expects($this->once())
117+
->method('getPriceInfo')
118+
->willReturn($this->priceInfoMock);
119+
120+
$this->priceInfoMock->expects($this->once())
121+
->method('getPrice')
122+
->with(\Magento\Wishlist\Pricing\ConfiguredPrice\ConfigurableProduct::PRICE_CODE)
123+
->willReturn($priceMock);
124+
125+
$this->assertEquals(100, $this->model->getValue());
118126
}
119127
}

0 commit comments

Comments
 (0)