Skip to content

Commit 727679d

Browse files
Merge branch '2.4-develop' into escapekey-issue-onprompt-close
2 parents 65b2afe + 7404d9d commit 727679d

File tree

255 files changed

+6718
-2221
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

255 files changed

+6718
-2221
lines changed

.github/CODEOWNERS

Lines changed: 0 additions & 206 deletions
This file was deleted.

.github/ISSUE_TEMPLATE/developer-experience-issue.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
name: Developer experience issue
33
about: Issues related to customization, extensibility, modularity
4+
labels: 'Triage: Dev.Experience'
45

56
---
67

.github/ISSUE_TEMPLATE/feature_request.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
name: Feature request
33
about: Please consider reporting directly to https://github.com/magento/community-features
4+
labels: 'feature request'
45

56
---
67

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@
1515
Letting us know what has changed and why it needed changing will help us validate this pull request.
1616
-->
1717

18+
### Related Pull Requests
19+
<!-- related pull request placeholder -->
20+
1821
### Fixed Issues (if relevant)
1922
<!---
2023
If relevant, please provide a list of fixed issues in the format magento/magento2#<issue_number>.
Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
namespace Magento\AdminNotification\Test\Unit\Observer;
7+
8+
use Magento\AdminNotification\Model\Feed;
9+
use Magento\AdminNotification\Model\FeedFactory;
10+
use Magento\AdminNotification\Observer\PredispatchAdminActionControllerObserver;
11+
use Magento\Backend\Model\Auth\Session;
12+
use Magento\Framework\Event\Observer;
13+
use Magento\Framework\TestFramework\Unit\Helper\ObjectManager;
14+
use PHPUnit\Framework\MockObject\MockObject;
15+
use PHPUnit\Framework\TestCase;
16+
17+
/**
18+
* Test class for \Magento\AdminNotification\Observer\PredispatchAdminActionControllerObserver
19+
*/
20+
class PredispatchAdminActionControllerObserverTest extends TestCase
21+
{
22+
private const STATUS_ADMIN_LOGGED_IN = true;
23+
private const STATUS_ADMIN_IS_NOT_LOGGED = false;
24+
25+
/**
26+
* @var Session|MockObject
27+
*/
28+
private $backendAuthSessionMock;
29+
30+
/**
31+
* @var Feed|MockObject
32+
*/
33+
private $feedMock;
34+
35+
/**
36+
* @var FeedFactory|MockObject
37+
*/
38+
private $feedFactoryMock;
39+
40+
/**
41+
* Object Manager Instance
42+
*
43+
* @var ObjectManager
44+
*/
45+
private $objectManager;
46+
47+
/**
48+
* Testable Object
49+
*
50+
* @var PredispatchAdminActionControllerObserver
51+
*/
52+
private $observer;
53+
54+
/**
55+
* @var Observer|MockObject
56+
*/
57+
private $observerMock;
58+
59+
/**
60+
* @inheritdoc
61+
*/
62+
protected function setUp() : void
63+
{
64+
$this->objectManager = new ObjectManager($this);
65+
$this->observerMock = $this->createMock(Observer::class);
66+
67+
$this->backendAuthSessionMock = $this->getMockBuilder(Session::class)
68+
->disableOriginalConstructor()
69+
->setMethods(['isLoggedIn'])
70+
->getMock();
71+
72+
$this->feedMock = $this->getMockBuilder(Feed::class)
73+
->disableOriginalConstructor()
74+
->setMethods(['checkUpdate'])
75+
->getMock();
76+
77+
$this->feedFactoryMock = $this->getMockBuilder(FeedFactory::class)
78+
->disableOriginalConstructor()
79+
->setMethods(['create'])
80+
->getMock();
81+
82+
$this->observer = $this->objectManager->getObject(
83+
PredispatchAdminActionControllerObserver::class,
84+
[
85+
'_feedFactory' => $this->feedFactoryMock,
86+
'_backendAuthSession' => $this->backendAuthSessionMock,
87+
]
88+
);
89+
}
90+
91+
/**
92+
* Test observer when admin user is logged in
93+
*/
94+
public function testPredispatchObserverWhenAdminLoggedIn()
95+
{
96+
$this->backendAuthSessionMock
97+
->expects($this->once())
98+
->method('isLoggedIn')
99+
->willReturn(self::STATUS_ADMIN_LOGGED_IN);
100+
101+
$this->feedFactoryMock
102+
->expects($this->once())
103+
->method('create')
104+
->willReturn($this->feedMock);
105+
106+
$this->feedMock
107+
->expects($this->once())
108+
->method('checkUpdate')
109+
->willReturn($this->feedMock);
110+
111+
$this->observer->execute($this->observerMock);
112+
}
113+
114+
/**
115+
* Test observer when admin user is not logged in
116+
*/
117+
public function testPredispatchObserverWhenAdminIsNotLoggedIn()
118+
{
119+
$this->backendAuthSessionMock
120+
->expects($this->once())
121+
->method('isLoggedIn')
122+
->willReturn(self::STATUS_ADMIN_IS_NOT_LOGGED);
123+
124+
$this->feedFactoryMock
125+
->expects($this->never())
126+
->method('create');
127+
128+
$this->feedMock
129+
->expects($this->never())
130+
->method('checkUpdate');
131+
132+
$this->observer->execute($this->observerMock);
133+
}
134+
}

app/code/Magento/Backend/Test/Mftf/Test/AdminLoginTest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,4 @@
2424
<seeInCurrentUrl url="{{AdminLoginPage.url}}" stepKey="seeAdminLoginUrl"/>
2525
<actionGroup ref="logout" stepKey="logoutFromAdmin"/>
2626
</test>
27-
</tests>
27+
</tests>

app/code/Magento/Backend/view/adminhtml/web/js/translate.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ define([
3535
* @return {String}
3636
*/
3737
this.translate = function (text) {
38-
return _data[text] ? _data[text] : text;
38+
return typeof _data[text] === 'string' ? _data[text] : text;
3939
};
4040

4141
return this;

app/code/Magento/Braintree/view/frontend/web/js/view/payment/method-renderer/paypal.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,7 @@ define([
269269
*/
270270
onError: function () {
271271
self.showError($t('Payment ' + self.getTitle() + ' can\'t be initialized'));
272+
self.reInitPayPal();
272273
}
273274
}, self.paypalButtonSelector);
274275
},

app/code/Magento/CardinalCommerce/Test/Mftf/Test/AdminCardinalCommerceSettingsHiddenTest.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
1010
<test name="AdminCardinalCommerceSettingsHiddenTest">
1111
<annotations>
12+
<stories value="Cardinal Commerce Settings"/>
1213
<features value="CardinalCommerce"/>
1314
<title value="CardinalCommerce settings hidden" />
1415
<description value="CardinalCommerce config shouldn't be visible if the 3D secure is disabled for Authorize.Net."/>

0 commit comments

Comments
 (0)