Skip to content

Commit c3a9acd

Browse files
authored
Merge branch '2.4-develop' into api-functional-graphql-removeItemFromCart
2 parents d64082f + 15269d9 commit c3a9acd

File tree

752 files changed

+21736
-4921
lines changed

Some content is hidden

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

752 files changed

+21736
-4921
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/AdvancedPricingImportExport/etc/module.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,5 @@
66
*/
77
-->
88
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
9-
<module name="Magento_AdvancedPricingImportExport" >
10-
</module>
9+
<module name="Magento_AdvancedPricingImportExport"/>
1110
</config>

app/code/Magento/Analytics/Model/Connector.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public function __construct(
5353
public function execute($commandName)
5454
{
5555
if (!array_key_exists($commandName, $this->commands)) {
56-
throw new NotFoundException(__('Command was not found.'));
56+
throw new NotFoundException(__('Command "%1" was not found.', $commandName));
5757
}
5858

5959
/** @var \Magento\Analytics\Model\Connector\CommandInterface $command */

app/code/Magento/Analytics/Test/Unit/Model/ConnectorTest.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,13 @@ public function testExecute()
5757
}
5858

5959
/**
60+
* Executing non-existing command
61+
*
6062
* @expectedException \Magento\Framework\Exception\NotFoundException
63+
* @expectedExceptionMessage Command "register" was not found.
64+
* @return void
6165
*/
62-
public function testExecuteCommandNotFound()
66+
public function testExecuteCommandNotFound(): void
6367
{
6468
$commandName = 'register';
6569
$this->connector->execute($commandName);

0 commit comments

Comments
 (0)