-
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.
Merge remote-tracking branch 'origin/2.3-develop' into 2.3-develop-co…
…m-pr7
- Loading branch information
Showing
11 changed files
with
210 additions
and
26 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
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