-
Notifications
You must be signed in to change notification settings - Fork 9.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🔃 [Magento Community Engineering] Community Contributions - 2.3-develop
Accepted Community Pull Requests: - #25720: [Customer] Cover Customer Navigation Block by Unit Test (by @edenduong) - #25533: Telephone Widget > Template > Removing this and helper (by @rafaelstz) - #25611: Added keyboard navigation for Adobe Stock image previews (by @drpayyne) - #25671: Added 'clearEvent' to eventBus to prevent multiple attach event on wysiwyg editor (by @Nazar65) - #25648: Resolve Wrong Css at "Minimum Qty Allowed in Shopping Cart" on Google Chrome issue25647 (by @edenduong) - #25328: Correct spelling (by @ravi-chandra3197) Fixed GitHub Issues: - #691: Readonly inputs and after element html in the backend (reported by @tzyganu) has been fixed in #25611 by @drpayyne in 2.3-develop branch Related commits: 1. 0e30366 2. 1298766 3. 41c95a2 - #25647: Wrong Css at "Minimum Qty Allowed in Shopping Cart" on Google Chrome (reported by @edenduong) has been fixed in #25648 by @edenduong in 2.3-develop branch Related commits: 1. 34998b6 2. 20fd591 3. 0a4393c
- Loading branch information
Showing
10 changed files
with
207 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
106 changes: 106 additions & 0 deletions
106
app/code/Magento/Customer/Test/Unit/Block/Account/NavigationTest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
<?php | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
declare(strict_types=1); | ||
|
||
namespace Magento\Customer\Test\Unit\Block\Account; | ||
|
||
use PHPUnit\Framework\TestCase; | ||
use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper; | ||
use Magento\Customer\Block\Account\Navigation; | ||
use Magento\Framework\View\Element\Template\Context; | ||
use Magento\Framework\View\LayoutInterface; | ||
use Magento\Wishlist\Block\Link as WishListLink; | ||
use Magento\Customer\Block\Account\Link as CustomerAccountLink; | ||
|
||
class NavigationTest extends TestCase | ||
{ | ||
/** | ||
* @var ObjectManagerHelper | ||
*/ | ||
private $objectManagerHelper; | ||
|
||
/** | ||
* @var Navigation | ||
*/ | ||
private $navigation; | ||
|
||
/** | ||
* @var Context|\PHPUnit_Framework_MockObject_MockObject | ||
*/ | ||
private $contextMock; | ||
|
||
/** | ||
* @var LayoutInterface|\PHPUnit_Framework_MockObject_MockObject | ||
*/ | ||
private $layoutMock; | ||
|
||
/** | ||
* Setup environment for test | ||
*/ | ||
protected function setUp() | ||
{ | ||
$this->contextMock = $this->createMock(Context::class); | ||
$this->layoutMock = $this->createMock(LayoutInterface::class); | ||
$this->contextMock->expects($this->any()) | ||
->method('getLayout') | ||
->willReturn($this->layoutMock); | ||
$this->objectManagerHelper = new ObjectManagerHelper($this); | ||
$this->navigation = $this->objectManagerHelper->getObject( | ||
Navigation::class, | ||
[ | ||
'context' => $this->contextMock | ||
] | ||
); | ||
} | ||
|
||
/** | ||
* Test get links with block customer account link and wish list link | ||
* | ||
* @return void | ||
*/ | ||
public function testGetLinksWithCustomerAndWishList() | ||
{ | ||
$wishListLinkMock = $this->getMockBuilder(WishListLink::class) | ||
->disableOriginalConstructor() | ||
->setMethods(['getSortOrder']) | ||
->getMock(); | ||
|
||
$customerAccountLinkMock = $this->getMockBuilder(CustomerAccountLink::class) | ||
->disableOriginalConstructor() | ||
->setMethods(['getSortOrder']) | ||
->getMock(); | ||
|
||
$wishListLinkMock->expects($this->any()) | ||
->method('getSortOrder') | ||
->willReturn(100); | ||
|
||
$customerAccountLinkMock->expects($this->any()) | ||
->method('getSortOrder') | ||
->willReturn(20); | ||
|
||
$nameInLayout = 'top.links'; | ||
|
||
$blockChildren = [ | ||
'wishListLink' => $wishListLinkMock, | ||
'customerAccountLink' => $customerAccountLinkMock | ||
]; | ||
|
||
$this->navigation->setNameInLayout($nameInLayout); | ||
$this->layoutMock->expects($this->any()) | ||
->method('getChildBlocks') | ||
->with($nameInLayout) | ||
->willReturn($blockChildren); | ||
|
||
/* Assertion */ | ||
$this->assertEquals( | ||
[ | ||
0 => $wishListLinkMock, | ||
1 => $customerAccountLinkMock | ||
], | ||
$this->navigation->getLinks() | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 3 additions & 2 deletions
5
app/code/Magento/Sales/Model/ResourceModel/Status/Collection.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
dev/tests/js/jasmine/tests/lib/mage/tinymce4Adapter.test.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
|
||
define([ | ||
'wysiwygAdapter', | ||
'underscore' | ||
], function (wysiwygAdapter, _) { | ||
'use strict'; | ||
|
||
var obj; | ||
|
||
beforeEach(function () { | ||
|
||
/** | ||
* Dummy constructor to use for instantiation | ||
* @constructor | ||
*/ | ||
var Constr = function () {}; | ||
|
||
Constr.prototype = wysiwygAdapter; | ||
|
||
obj = new Constr(); | ||
obj.eventBus = new window.varienEvents(); | ||
obj.initialize(1, { | ||
'store_id': 0, | ||
'tinymce4': { | ||
'content_css': '' | ||
}, | ||
'files_browser_window_url': 'url' | ||
}); | ||
obj.setup(); | ||
}); | ||
|
||
describe('"openFileBrowser" method', function () { | ||
it('Opens file browser to given instance', function () { | ||
expect(_.size(obj.eventBus.arrEvents['open_browser_callback'])).toBe(1); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters