-
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 branch '2.4-develop' into refactor/mftf-customer
- Loading branch information
Showing
320 changed files
with
9,250 additions
and
1,599 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
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
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
53 changes: 53 additions & 0 deletions
53
app/code/Magento/Captcha/Test/Unit/Observer/ResetAttemptForBackendObserverTest.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,53 @@ | ||
<?php | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Magento\Captcha\Test\Unit\Observer; | ||
|
||
use Magento\Captcha\Model\ResourceModel\Log; | ||
use Magento\Captcha\Model\ResourceModel\LogFactory; | ||
use Magento\Captcha\Observer\ResetAttemptForBackendObserver; | ||
use Magento\Framework\Event; | ||
use Magento\Framework\Event\Observer; | ||
use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper; | ||
use PHPUnit\Framework\MockObject\MockObject; | ||
use PHPUnit\Framework\TestCase; | ||
|
||
/** | ||
* Unit test for \Magento\Captcha\Observer\ResetAttemptForBackendObserver | ||
*/ | ||
class ResetAttemptForBackendObserverTest extends TestCase | ||
{ | ||
/** | ||
* Test that the method resets attempts for Backend | ||
*/ | ||
public function testExecuteExpectsDeleteUserAttemptsCalled() | ||
{ | ||
$logMock = $this->createMock(Log::class); | ||
$logMock->expects($this->once())->method('deleteUserAttempts')->willReturnSelf(); | ||
|
||
$resLogFactoryMock = $this->createMock(LogFactory::class); | ||
$resLogFactoryMock->expects($this->once()) | ||
->method('create') | ||
->willReturn($logMock); | ||
|
||
/** @var MockObject|Observer $eventObserverMock */ | ||
$eventObserverMock = $this->createPartialMock(Observer::class, ['getUser']); | ||
$eventMock = $this->createMock(Event::class); | ||
$eventObserverMock->expects($this->once()) | ||
->method('getUser') | ||
->willReturn($eventMock); | ||
|
||
$objectManager = new ObjectManagerHelper($this); | ||
/** @var ResetAttemptForBackendObserver $observer */ | ||
$observer = $objectManager->getObject( | ||
ResetAttemptForBackendObserver::class, | ||
['resLogFactory' => $resLogFactoryMock] | ||
); | ||
$this->assertInstanceOf(Log::class, $observer->execute($eventObserverMock)); | ||
} | ||
} |
52 changes: 52 additions & 0 deletions
52
app/code/Magento/Captcha/Test/Unit/Observer/ResetAttemptForFrontendObserverTest.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,52 @@ | ||
<?php | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Magento\Captcha\Test\Unit\Observer; | ||
|
||
use Magento\Captcha\Model\ResourceModel\Log; | ||
use Magento\Captcha\Model\ResourceModel\LogFactory; | ||
use Magento\Captcha\Observer\ResetAttemptForFrontendObserver; | ||
use Magento\Customer\Model\Customer; | ||
use Magento\Framework\Event\Observer; | ||
use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper; | ||
use PHPUnit\Framework\MockObject\MockObject; | ||
use PHPUnit\Framework\TestCase; | ||
|
||
/** | ||
* Unit test for \Magento\Captcha\Observer\ResetAttemptForFrontendObserver | ||
*/ | ||
class ResetAttemptForFrontendObserverTest extends TestCase | ||
{ | ||
/** | ||
* Test that the method resets attempts for Frontend | ||
*/ | ||
public function testExecuteExpectsDeleteUserAttemptsCalled() | ||
{ | ||
$logMock = $this->createMock(Log::class); | ||
$logMock->expects($this->once())->method('deleteUserAttempts')->willReturnSelf(); | ||
|
||
$resLogFactoryMock = $this->createMock(LogFactory::class); | ||
$resLogFactoryMock->expects($this->once()) | ||
->method('create') | ||
->willReturn($logMock); | ||
|
||
/** @var MockObject|Observer $eventObserverMock */ | ||
$eventObserverMock = $this->createPartialMock(Observer::class, ['getModel']); | ||
$eventObserverMock->expects($this->once()) | ||
->method('getModel') | ||
->willReturn($this->createMock(Customer::class)); | ||
|
||
$objectManager = new ObjectManagerHelper($this); | ||
/** @var ResetAttemptForFrontendObserver $observer */ | ||
$observer = $objectManager->getObject( | ||
ResetAttemptForFrontendObserver::class, | ||
['resLogFactory' => $resLogFactoryMock] | ||
); | ||
$this->assertInstanceOf(Log::class, $observer->execute($eventObserverMock)); | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
app/code/Magento/Catalog/Api/CategoryListDeleteBySkuInterface.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,27 @@ | ||
<?php | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
|
||
namespace Magento\Catalog\Api; | ||
|
||
/** | ||
* @api | ||
* @since 100.0.2 | ||
*/ | ||
interface CategoryListDeleteBySkuInterface | ||
{ | ||
/** | ||
* Delete by skus list | ||
* | ||
* @param int $categoryId | ||
* @param string[] $productSkuList | ||
* @return bool | ||
* | ||
* @throws \Magento\Framework\Exception\CouldNotSaveException | ||
* @throws \Magento\Framework\Exception\NoSuchEntityException | ||
* @throws \Magento\Framework\Exception\InputException | ||
*/ | ||
public function deleteBySkus(int $categoryId, array $productSkuList): bool; | ||
} |
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
Oops, something went wrong.