Skip to content

Commit

Permalink
Merge pull request #1448 from magento-engcom/develop-prs
Browse files Browse the repository at this point in the history
[EngCom] Public Pull Requests
 - MAGETWO-72192 Added ability to set 'rows' property for wysiwyg elements. #10732
 - MAGETWO-71697 Fix possible bug when saving address with empty street line #10582
 - MAGETWO-71647 Modified Bundle.js because of breaking Encoding in Production Mode. #10563
 - MAGETWO-72126 Disabling of randomly failing and timing out Functional Tests
  • Loading branch information
ishakhsuvarov authored Sep 1, 2017
2 parents 2808f2d + 26369d8 commit 6f25236
Show file tree
Hide file tree
Showing 11 changed files with 67 additions and 144 deletions.
7 changes: 2 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ env:
- TEST_SUITE=integration INTEGRATION_INDEX=1
- TEST_SUITE=integration INTEGRATION_INDEX=2
- TEST_SUITE=integration INTEGRATION_INDEX=3
- TEST_SUITE=functional ACCEPTANCE_INDEX=1
- TEST_SUITE=functional ACCEPTANCE_INDEX=2
- TEST_SUITE=functional
matrix:
exclude:
- php: 7.0
Expand All @@ -40,9 +39,7 @@ matrix:
- php: 7.0
env: TEST_SUITE=js GRUNT_COMMAND=static
- php: 7.0
env: TEST_SUITE=functional ACCEPTANCE_INDEX=1
- php: 7.0
env: TEST_SUITE=functional ACCEPTANCE_INDEX=2
env: TEST_SUITE=functional
cache:
apt: true
directories:
Expand Down
8 changes: 6 additions & 2 deletions app/code/Magento/Customer/Model/Address/AbstractAddress.php
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ public function setData($key, $value = null)
{
if (is_array($key)) {
$key = $this->_implodeArrayField($key);
} elseif (is_array($value) && !empty($value) && $this->isAddressMultilineAttribute($key)) {
} elseif (is_array($value) && $this->isAddressMultilineAttribute($key)) {
$value = $this->_implodeArrayValues($value);
}
return parent::setData($key, $value);
Expand Down Expand Up @@ -309,7 +309,11 @@ protected function _implodeArrayField(array $data)
*/
protected function _implodeArrayValues($value)
{
if (is_array($value) && count($value)) {
if (is_array($value)) {
if (!count($value)) {
return '';
}

$isScalar = false;
foreach ($value as $val) {
if (is_scalar($val)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,15 @@ public function testGetStreetFullAlwaysReturnsString($expectedResult, $street)
$this->assertEquals($expectedResult, $this->model->getStreetFull());
}

/**
* @dataProvider getStreetFullDataProvider
*/
public function testSetDataStreetAlwaysConvertedToString($expectedResult, $street)
{
$this->model->setData('street', $street);
$this->assertEquals($expectedResult, $this->model->getData('street'));
}

/**
* @return array
*/
Expand Down
9 changes: 6 additions & 3 deletions app/code/Magento/Deploy/Package/Bundle/RequireJs.php
Original file line number Diff line number Diff line change
Expand Up @@ -240,9 +240,12 @@ private function endBundleFile(WriteInterface $bundleFile, array $contents)
private function getFileContent($sourcePath)
{
if (!isset($this->fileContent[$sourcePath])) {
$this->fileContent[$sourcePath] = utf8_encode(
$this->staticDir->readFile($this->minification->addMinifiedSign($sourcePath))
);
$content = $this->staticDir->readFile($this->minification->addMinifiedSign($sourcePath));
if (mb_detect_encoding($content) !== "UTF-8") {
$content = mb_convert_encoding($content, "UTF-8");
}

$this->fileContent[$sourcePath] = $content;
}
return $this->fileContent[$sourcePath];
}
Expand Down
10 changes: 10 additions & 0 deletions app/code/Magento/Quote/Test/Unit/Model/Quote/AddressTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
* Test class for sales quote address model
*
* @see \Magento\Quote\Model\Quote\Address
* @SuppressWarnings(PHPMD.TooManyFields)
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
*/
class AddressTest extends \PHPUnit\Framework\TestCase
Expand All @@ -47,6 +48,11 @@ class AddressTest extends \PHPUnit\Framework\TestCase
*/
private $quote;

/**
* @var \Magento\Quote\Model\Quote\Address\CustomAttributeListInterface | \PHPUnit_Framework_MockObject_MockObject
*/
private $attributeList;

/**
* @var \Magento\Framework\App\Config | \PHPUnit_Framework_MockObject_MockObject
*/
Expand Down Expand Up @@ -165,9 +171,13 @@ protected function setUp()
->disableOriginalConstructor()
->getMock();

$this->attributeList = $this->createMock(\Magento\Quote\Model\Quote\Address\CustomAttributeListInterface::class);
$this->attributeList->method('getAttributes')->willReturn([]);

$this->address = $objectManager->getObject(
\Magento\Quote\Model\Quote\Address::class,
[
'attributeList' => $this->attributeList,
'scopeConfig' => $this->scopeConfig,
'serializer' => $this->serializer,
'storeManager' => $this->storeManager,
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/Ui/Component/Form/Element/Wysiwyg.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public function __construct(
\Magento\Framework\Data\Form\Element\Editor::class,
[
'force_load' => true,
'rows' => 20,
'rows' => isset($config['rows']) ? $config['rows'] : 20,
'name' => $data['name'],
'config' => $wysiwygConfig->getConfig($wysiwygConfigData),
'wysiwyg' => isset($config['wysiwyg']) ? $config['wysiwyg'] : null,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?xml version="1.0"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../../../../vendor/magento/mtf/Magento/Mtf/TestRunner/etc/testRunner.xsd">
<rule scope="testcase">
<allow>
<tag group="test_type" value="acceptance_test" />
</allow>
<deny>
<tag group="stable" value="no" />
</deny>
</rule>
<rule scope="variation">
<allow>
<tag group="test_type" value="acceptance_test" />
<tag group="severity" value="S0, S1" />
</allow>
<deny>
<tag group="stable" value="no" />
</deny>
</rule>
</config>

This file was deleted.

This file was deleted.

2 changes: 1 addition & 1 deletion dev/travis/before_script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ case $TEST_SUITE in

cp ./phpunit.xml.dist ./phpunit.xml
sed -e "s?127.0.0.1?${MAGENTO_HOST_NAME}?g" --in-place ./phpunit.xml
sed -e "s?basic?travis_acceptance_${ACCEPTANCE_INDEX}?g" --in-place ./phpunit.xml
sed -e "s?basic?travis_acceptance?g" --in-place ./phpunit.xml
cp ./.htaccess.sample ./.htaccess
cd ./utils
php -f mtf troubleshooting:check-all
Expand Down
6 changes: 5 additions & 1 deletion lib/internal/Magento/Framework/View/Asset/Bundle.php
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,11 @@ protected function getAssetContent(LocalInterface $asset)
$assetContentType = $asset->getContentType();
$assetKey = $this->getAssetKey($asset);
if (!isset($this->assetsContent[$assetContextCode][$assetContentType][$assetKey])) {
$this->assetsContent[$assetContextCode][$assetContentType][$assetKey] = utf8_encode($asset->getContent());
$content = $asset->getContent();
if (mb_detect_encoding($content) !== "UTF-8") {
$content = mb_convert_encoding($content, "UTF-8");
}
$this->assetsContent[$assetContextCode][$assetContentType][$assetKey] = $content;
}

return $this->assetsContent[$assetContextCode][$assetContentType][$assetKey];
Expand Down

0 comments on commit 6f25236

Please sign in to comment.