Skip to content

Commit 95a3467

Browse files
committed
Merge branch '2.2-develop' of https://github.com/magento/magento2ce into MAGETWO-92144
2 parents 04898cd + 4f5bcca commit 95a3467

File tree

8 files changed

+105
-16
lines changed

8 files changed

+105
-16
lines changed

app/code/Magento/Cms/Model/Wysiwyg/Images/Storage.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -566,10 +566,10 @@ public function getThumbnailUrl($filePath, $checkFile = false)
566566
* Create thumbnail for image and save it to thumbnails directory
567567
*
568568
* @param string $source Image path to be resized
569-
* @param bool $keepRation Keep aspect ratio or not
569+
* @param bool $keepRatio Keep aspect ratio or not
570570
* @return bool|string Resized filepath or false if errors were occurred
571571
*/
572-
public function resizeFile($source, $keepRation = true)
572+
public function resizeFile($source, $keepRatio = true)
573573
{
574574
$realPath = $this->_directory->getRelativePath($source);
575575
if (!$this->_directory->isFile($realPath) || !$this->_directory->isExist($realPath)) {
@@ -586,7 +586,7 @@ public function resizeFile($source, $keepRation = true)
586586
}
587587
$image = $this->_imageFactory->create();
588588
$image->open($source);
589-
$image->keepAspectRatio($keepRation);
589+
$image->keepAspectRatio($keepRatio);
590590
$image->resize($this->_resizeParameters['width'], $this->_resizeParameters['height']);
591591
$dest = $targetDir . '/' . pathinfo($source, PATHINFO_BASENAME);
592592
$image->save($dest);

app/code/Magento/Sales/i18n/en_US.csv

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -686,17 +686,9 @@ General,General
686686
"Allow Reorder","Allow Reorder"
687687
"Invoice and Packing Slip Design","Invoice and Packing Slip Design"
688688
"Logo for PDF Print-outs (200x50)","Logo for PDF Print-outs (200x50)"
689-
"
690-
Your default logo will be used in PDF and HTML documents.<br />(jpeg, tiff, png) If your pdf image is distorted, try to use larger file-size image.
691-
","
692-
Your default logo will be used in PDF and HTML documents.<br />(jpeg, tiff, png) If your pdf image is distorted, try to use larger file-size image.
693-
"
689+
"Your default logo will be used in PDF and HTML documents.<br />(jpeg, tiff, png) If your pdf image is distorted, try to use larger file-size image.","Your default logo will be used in PDF and HTML documents.<br />(jpeg, tiff, png) If your pdf image is distorted, try to use larger file-size image."
694690
"Logo for HTML Print View","Logo for HTML Print View"
695-
"
696-
Logo for HTML documents only. If empty, default will be used.<br />(jpeg, gif, png)
697-
","
698-
Logo for HTML documents only. If empty, default will be used.<br />(jpeg, gif, png)
699-
"
691+
"Logo for HTML documents only. If empty, default will be used.<br />(jpeg, gif, png)","Logo for HTML documents only. If empty, default will be used.<br />(jpeg, gif, png)"
700692
Address,Address
701693
"Minimum Order Amount","Minimum Order Amount"
702694
Enable,Enable
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
namespace Magento\Search\Test\Unit\Model;
7+
8+
use Magento\Framework\TestFramework\Unit\Helper\ObjectManager;
9+
10+
/**
11+
* Class SynonymAnalyzerTest
12+
*/
13+
class SynonymAnalyzerTest extends \PHPUnit\Framework\TestCase
14+
{
15+
/**
16+
* @var \Magento\Search\Model\SynonymAnalyzer
17+
*/
18+
private $synonymAnalyzer;
19+
20+
/**
21+
* @var \Magento\Search\Model\SynonymReader |\PHPUnit_Framework_MockObject_MockObject
22+
*/
23+
private $synReaderModel;
24+
25+
/**
26+
* Test set up
27+
*/
28+
protected function setUp()
29+
{
30+
$helper = new ObjectManager($this);
31+
32+
$this->synReaderModel = $this->getMockBuilder(\Magento\Search\Model\SynonymReader::class)
33+
->disableOriginalConstructor()
34+
->getMock();
35+
36+
$this->synonymAnalyzer = $helper->getObject(
37+
\Magento\Search\Model\SynonymAnalyzer::class,
38+
[
39+
'synReader' => $this->synReaderModel,
40+
]
41+
);
42+
}
43+
44+
/**
45+
* @test
46+
*/
47+
public function testGetSynonymsForPhrase()
48+
{
49+
$phrase = 'Elizabeth is the british queen';
50+
$expected = [
51+
0 => [ 0 => "Elizabeth" ],
52+
1 => [ 0 => "is" ],
53+
2 => [ 0 => "the" ],
54+
3 => [ 0 => "british", 1 => "english" ],
55+
4 => [ 0 => "queen", 1 => "monarch" ],
56+
];
57+
$this->synReaderModel->expects($this->once())
58+
->method('loadByPhrase')
59+
->with($phrase)
60+
->willReturnSelf()
61+
;
62+
$this->synReaderModel->expects($this->once())
63+
->method('getData')
64+
->willReturn([
65+
['synonyms' => 'british,english'],
66+
['synonyms' => 'queen,monarch'],
67+
])
68+
;
69+
70+
$actual = $this->synonymAnalyzer->getSynonymsForPhrase($phrase);
71+
$this->assertEquals($expected, $actual);
72+
}
73+
74+
/**
75+
* @test
76+
*
77+
* Empty phrase scenario
78+
*/
79+
public function testGetSynonymsForPhraseEmptyPhrase()
80+
{
81+
$phrase = '';
82+
$expected = [];
83+
$actual = $this->synonymAnalyzer->getSynonymsForPhrase($phrase);
84+
$this->assertEquals($expected, $actual);
85+
}
86+
}

app/code/Magento/Swagger/view/frontend/layout/swagger_index_index.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
<link src='Magento_Swagger::swagger-ui/js/lang/translator.js' type='text/javascript' defer="defer"/>
1616
<link src='Magento_Swagger::swagger-ui/js/lang/ru.js' type='text/javascript' defer="defer"/>
1717
<link src='Magento_Swagger::swagger-ui/js/lang/en.js' type='text/javascript' defer="defer"/>
18-
<link src='Magento_Swagger::swagger-ui/js/swagger-ui-bundle.js' type='text/javascript' defer="defer"/>
19-
<link src='Magento_Swagger::swagger-ui/js/swagger-ui-standalone-preset.js' type='text/javascript' defer="defer"/>
18+
<link src='Magento_Swagger::swagger-ui/js/swagger-ui-bundle.min.js' type='text/javascript' defer="defer"/>
19+
<link src='Magento_Swagger::swagger-ui/js/swagger-ui-standalone-preset.min.js' type='text/javascript' defer="defer"/>
2020
<link src='Magento_Swagger::swagger-ui/js/magento-swagger.js' type='text/javascript' defer="defer"/>
2121

2222
<!--Remove require-js assets-->

lib/internal/Magento/Framework/EntityManager/Operation/Delete.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ public function execute($entity, $arguments = [])
118118
$entity = $this->deleteMain->execute($entity, $arguments);
119119
$this->eventManager->dispatchEntityEvent($entityType, 'delete_after', ['entity' => $entity]);
120120
$this->eventManager->dispatch(
121-
'entity_manager_delete_before',
121+
'entity_manager_delete_after',
122122
[
123123
'entity_type' => $entityType,
124124
'entity' => $entity

lib/internal/Magento/Framework/Image/Adapter/Gd2.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
67
namespace Magento\Framework\Image\Adapter;
78

89
/**
@@ -66,6 +67,16 @@ public function open($filename)
6667
}
6768
$this->imageDestroy();
6869
$this->_imageHandler = call_user_func($this->_getCallback('create'), $this->_fileName);
70+
$fileType = $this->getImageType();
71+
if (in_array($fileType, [IMAGETYPE_PNG, IMAGETYPE_GIF])) {
72+
$this->_keepTransparency = true;
73+
if ($this->_imageHandler) {
74+
$isAlpha = $this->checkAlpha($this->_fileName);
75+
if ($isAlpha) {
76+
$this->_fillBackgroundColor($this->_imageHandler);
77+
}
78+
}
79+
}
6980
}
7081

7182
/**

0 commit comments

Comments
 (0)