Skip to content

Commit 31ecdb0

Browse files
committed
AC-16072: PHPUnit 12: Upgrade SalesRules & other related test cases
1 parent 98bd26f commit 31ecdb0

File tree

8 files changed

+12
-7
lines changed

8 files changed

+12
-7
lines changed

app/code/Magento/Multishipping/Test/Unit/Block/Checkout/SuccessTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
namespace Magento\Multishipping\Test\Unit\Block\Checkout;
99

10-
use Magento\Framework\Session\SessionManagerInterface;
10+
use Magento\Framework\Session\Generic;
1111
use Magento\Framework\TestFramework\Unit\Helper\MockCreationTrait;
1212
use Magento\Framework\TestFramework\Unit\Helper\ObjectManager;
1313
use Magento\Framework\View\Element\Template\Context;
@@ -42,7 +42,7 @@ class SuccessTest extends TestCase
4242
protected function setUp(): void
4343
{
4444
$this->sessionMock = $this->createPartialMockWithReflection(
45-
\Magento\Framework\Session\Generic::class,
45+
Generic::class,
4646
['getOrderIds']
4747
);
4848
$this->contextMock = $this->createMock(Context::class);

app/code/Magento/Multishipping/Test/Unit/Helper/DataTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,14 @@ class DataTest extends TestCase
3737
protected $scopeConfigMock;
3838

3939
/**
40-
* Quote mock
40+
* Mock object for quote model
4141
*
4242
* @var MockObject|\Magento\Quote\Model\Quote
4343
*/
4444
protected $quoteMock;
4545

4646
/**
47-
* Checkout session mock
47+
* Mock object for checkout session
4848
*
4949
* @var MockObject|Session
5050
*/

app/code/Magento/Multishipping/Test/Unit/Model/Payment/Method/Specification/EnabledTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class EnabledTest extends TestCase
2727
protected $objectManager;
2828

2929
/**
30-
* Payment config mock
30+
* Mock object for payment config
3131
*
3232
* @var MockObject|Config
3333
*/

app/code/Magento/SalesRule/Test/Unit/Model/Converter/ToModelTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@ protected function setUp(): void
5959
);
6060
}
6161

62+
/**
63+
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
64+
*/
6265
public function testDataModelToArray()
6366
{
6467
$array = [

app/code/Magento/SalesRule/Test/Unit/Model/Plugin/ResourceModel/RuleTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ protected function setUp(): void
4141
$objectManager = new ObjectManager($this);
4242
$this->ruleResource = $this->createMock(RuleResource::class);
4343
$this->genericClosure = function () {
44-
return;
4544
};
4645
$this->abstractModel = $this->createMock(AbstractModel::class);
4746

app/code/Magento/SalesRule/Test/Unit/Model/Rule/RuleQuoteRecollectTotalsOnDemandTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ protected function setUp(): void
4343
* Test that multiple updates query are executed on large result
4444
*
4545
* @return void
46+
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
47+
* @SuppressWarnings(PHPMD.NPathComplexity)
4648
*/
4749
public function testExecute(): void
4850
{

app/code/Magento/SalesRule/Test/Unit/Model/RulesApplierTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ class RulesApplierTest extends TestCase
7070
protected $childrenValidationLocator;
7171

7272
/**
73-
* RuleDiscountInterfaceFactory|MockObject
73+
* @var RuleDiscountInterfaceFactory|MockObject
7474
*/
7575
protected $ruleDiscountInterfaceFactoryMock;
7676

app/code/Magento/SalesSequence/Test/Unit/Model/Sequence/DeleteByStoreTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ protected function setUp(): void
9191
/**
9292
* @throws \Exception
9393
* @SuppressWarnings(PHPMD.UnusedLocalVariable)
94+
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
9495
*/
9596
public function testExecute()
9697
{

0 commit comments

Comments
 (0)