Skip to content

Commit 7f59f8a

Browse files
author
Sergii Kovalenko
committed
Merge remote-tracking branch 'origin/MAGETWO-87551' into MAGETWO-87551
2 parents ab38103 + ab23a55 commit 7f59f8a

File tree

10 files changed

+16
-17
lines changed

10 files changed

+16
-17
lines changed

app/code/Magento/Tax/Setup/Patch/Data/AddTacAttributeAndTaxClasses.php renamed to app/code/Magento/Tax/Setup/Patch/Data/AddTaxAttributeAndTaxClasses.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
* Class AddTacAttributeAndTaxClasses
1818
* @package Magento\Tax\Setup\Patch
1919
*/
20-
class AddTacAttributeAndTaxClasses implements DataPatchInterface, PatchVersionInterface
20+
class AddTaxAttributeAndTaxClasses implements DataPatchInterface, PatchVersionInterface
2121
{
2222
/**
2323
* @param TaxSetupFactory $taxSetupFactory

app/code/Magento/Tax/Setup/Patch/Data/UpdateTaxClassAttributeVisibility.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public function apply()
6767
public static function getDependencies()
6868
{
6969
return [
70-
AddTacAttributeAndTaxClasses::class
70+
AddTaxAttributeAndTaxClasses::class
7171
];
7272
}
7373

lib/internal/Magento/Framework/Module/DbVersionInfo.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,6 @@ private function getDataInfo($moduleName)
130130
* @param string $moduleName
131131
* @param string|bool $version
132132
* @return bool
133-
* @throws \UnexpectedValueException
134133
*/
135134
private function isModuleVersionEqual($moduleName, $version)
136135
{

setup/src/Magento/Setup/Model/Patch/PatchApplier.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ public function applyDataPatch($moduleName = null)
164164
}
165165
if ($dataPatch instanceof NonTransactionableInterface) {
166166
$dataPatch->apply();
167-
$this->patchHistory->fixPatch($dataPatch);
167+
$this->patchHistory->fixPatch(get_class($dataPatch));
168168
} else {
169169
try {
170170
$this->moduleDataSetup->getConnection()->beginTransaction();

setup/src/Magento/Setup/Test/Unit/Model/Patch/PatchApplierTest.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
/**
2424
* Class PatchApplierTest
2525
* @package Magento\Setup\Test\Unit\Model\Patch
26+
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
2627
*/
2728
class PatchApplierTest extends \PHPUnit\Framework\TestCase
2829
{
@@ -117,8 +118,8 @@ protected function setUp()
117118
'moduleDataSetup' => $this->moduleDataSetupMock,
118119
]
119120
);
120-
require_once '../_files/data_patch_classes.php';
121-
require_once '../_files/schema_patch_classes.php';
121+
require_once __DIR__ . '/../_files/data_patch_classes.php';
122+
require_once __DIR__ . '/../_files/schema_patch_classes.php';
122123
}
123124

124125
/**
@@ -365,7 +366,7 @@ public function testNonTransactionablePatch()
365366
$this->connectionMock->expects($this->never())->method('beginTransaction');
366367
$this->connectionMock->expects($this->never())->method('commit');
367368
$this->connectionMock->expects($this->never())->method('rollback');
368-
$this->patchHistoryMock->expects($this->once())->method('fixPatch')->with($patch1);
369+
$this->patchHistoryMock->expects($this->once())->method('fixPatch')->with(get_class($patch1));
369370
$this->objectManagerMock->expects($this->any())->method('create')->willReturnMap(
370371
[
371372
[
@@ -543,4 +544,4 @@ private function createAggregateIteratorMock($className, array $items = [], arra
543544

544545
return $mockIteratorAggregate;
545546
}
546-
}
547+
}

setup/src/Magento/Setup/Test/Unit/Model/Patch/PatchFactoryTest.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@ protected function setUp()
3434
{
3535
$objectManager = new ObjectManager($this);
3636
$this->objectManagerMock = $this->createMock(ObjectManagerInterface::class);
37-
38-
3937
$this->patchFactory = $objectManager->getObject(
4038
PatchFactory::class,
4139
[

setup/src/Magento/Setup/Test/Unit/Model/Patch/PatchHistoryTest.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@ protected function setUp()
3232
{
3333
$objectManager = new ObjectManager($this);
3434
$this->resourceConnectionMock = $this->createMock(ResourceConnection::class);
35-
36-
3735
$this->patchHistory = $objectManager->getObject(
3836
PatchHistory::class,
3937
[
@@ -61,7 +59,7 @@ public function testFixPatch()
6159
->willReturn(PatchHistory::TABLE_NAME);
6260
$adapterMock->expects($this->once())->method('insert')
6361
->with(PatchHistory::TABLE_NAME, [PatchHistory::CLASS_NAME => get_class($patch1)]);
64-
$this->patchHistory->fixPatch($patch1);
62+
$this->patchHistory->fixPatch(get_class($patch1));
6563
}
6664

6765
/**
@@ -83,7 +81,6 @@ public function testFixAppliedPatch()
8381
->method('getTableName')
8482
->willReturn(PatchHistory::TABLE_NAME);
8583
$adapterMock->expects($this->never())->method('insert');
86-
$this->patchHistory->fixPatch($patch1);
84+
$this->patchHistory->fixPatch(get_class($patch1));
8785
}
88-
8986
}

setup/src/Magento/Setup/Test/Unit/Model/Patch/PatchRegirtryTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,4 +97,4 @@ public function testGetIterator()
9797
'Failed to assert that actual non-apllied patches sequence is valid.'
9898
);
9999
}
100-
}
100+
}

setup/src/Magento/Setup/Test/Unit/Model/_files/data_patch_classes.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
* See COPYING.txt for license details.
55
*/
66

7+
// @codingStandardsIgnoreFile - as of namespace absence
8+
79
class OtherDataPatch implements \Magento\Setup\Model\Patch\DataPatchInterface
810
{
911
/**
@@ -131,4 +133,4 @@ public function apply()
131133
public function revert()
132134
{
133135
}
134-
}
136+
}

setup/src/Magento/Setup/Test/Unit/Model/_files/schema_patch_classes.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
* See COPYING.txt for license details.
55
*/
66

7+
// @codingStandardsIgnoreFile - as of namespace absence
8+
79
class OtherSchemaPatch implements \Magento\Setup\Model\Patch\SchemaPatchInterface
810
{
911
/**

0 commit comments

Comments
 (0)