Skip to content

Commit 93a3e28

Browse files
committed
ACP2E-3631: Adobe Commerce 2.4.7-p3 unit tests are failing
1 parent f43fe34 commit 93a3e28

File tree

11 files changed

+329
-191
lines changed

11 files changed

+329
-191
lines changed

app/code/Magento/Config/Test/Unit/Model/Config/XsdTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public function testSchemaCorrectlyIdentifiesInvalidXml($xmlString, $expectedErr
5252
$this->assertMatchesRegularExpression($error, $actualError);
5353
$matched = true;
5454
break;
55-
} catch (AssertionFailedError $e) {
55+
} catch (AssertionFailedError) {
5656
}
5757
}
5858
$this->assertTrue($matched, "None of the errors matched: $error");

app/code/Magento/Email/Test/Unit/Model/Template/Config/XsdTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ protected function _testXmlAgainstXsd($fixtureXml, $schemaFile, array $expectedE
224224
$this->assertMatchesRegularExpression($error, $actualError);
225225
$matched = true;
226226
break;
227-
} catch (AssertionFailedError $e) {
227+
} catch (AssertionFailedError) {
228228
}
229229
}
230230
$this->assertTrue($matched, "None of the errors matched: $error");

app/code/Magento/ImportExport/Test/Unit/Model/Export/Config/XsdTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public function testSchemaCorrectlyIdentifiesInvalidProductOptionsXml($xmlString
6666
$this->assertMatchesRegularExpression($error, $actualError);
6767
$matched = true;
6868
break;
69-
} catch (AssertionFailedError $e) {
69+
} catch (AssertionFailedError) {
7070
}
7171
}
7272
$this->assertTrue($matched, "None of the errors matched: $error");

app/code/Magento/ImportExport/Test/Unit/Model/Import/Config/XsdMergedTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public function testSchemaCorrectlyIdentifiesInvalidXml($xmlString, $expectedErr
5252
$this->assertMatchesRegularExpression($error, $actualError);
5353
$matched = true;
5454
break;
55-
} catch (AssertionFailedError $e) {
55+
} catch (AssertionFailedError) {
5656
}
5757
}
5858
$this->assertTrue($matched, "None of the errors matched: $error");

app/code/Magento/ImportExport/Test/Unit/Model/Import/Config/XsdTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public function testSchemaCorrectlyIdentifiesInvalidXml($xmlString, $expectedErr
5252
$this->assertMatchesRegularExpression($error, $actualError);
5353
$matched = true;
5454
break;
55-
} catch (AssertionFailedError $e) {
55+
} catch (AssertionFailedError) {
5656
}
5757
}
5858
$this->assertTrue($matched, "None of the errors matched: $error");

app/code/Magento/Integration/Test/Unit/Model/Config/XsdTest.php

Lines changed: 166 additions & 109 deletions
Large diffs are not rendered by default.

app/code/Magento/MessageQueue/Test/Unit/Console/PoisonPillApplyDuringSetupUpgradeTest.php

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
11
<?php
22
/**
3-
* Copyright © Magento, Inc. All rights reserved.
4-
* See COPYING.txt for license details.
3+
* Copyright 2021 Adobe
4+
* All Rights Reserved.
55
*/
66
declare(strict_types=1);
77

88
namespace Magento\MessageQueue\Test\Unit\Console;
99

1010
use Magento\Framework\App\DeploymentConfig;
11+
use Magento\Framework\App\ObjectManager as AppObjectManager;
1112
use Magento\Framework\DB\Adapter\AdapterInterface;
1213
use Magento\Framework\MessageQueue\PoisonPill\PoisonPillPutInterface;
1314
use Magento\Framework\Module\ModuleListInterface;
1415
use Magento\Framework\Mview\TriggerCleaner;
16+
use Magento\Framework\ObjectManagerInterface;
1517
use Magento\Framework\Registry;
1618
use Magento\Framework\Setup\ModuleContextInterface;
1719
use Magento\Framework\Setup\Patch\PatchApplier;
@@ -166,6 +168,18 @@ protected function setUp(): void
166168
});
167169
$this->setupFactory = $this->createMock(SetupFactory::class);
168170
$this->setupFactory->method('create')->willReturn($this->schemaSetupInterface);
171+
172+
try {
173+
AppObjectManager::getInstance();
174+
} catch (\RuntimeException) {
175+
// Installer class creates instance of DeploymentConfig in the constructor
176+
// so the object manager should be defined.
177+
$objectManagerMock = $this->createMock(ObjectManagerInterface::class);
178+
$objectManagerMock->method('get')
179+
->willReturnCallback(fn ($type) => $this->createMock($type));
180+
AppObjectManager::setInstance($objectManagerMock);
181+
}
182+
169183
$this->installer = $objectManager->getObject(
170184
Installer::class,
171185
[

app/code/Magento/Sales/Test/Unit/Model/Order/Pdf/Config/XsdTest.php

Lines changed: 138 additions & 71 deletions
Large diffs are not rendered by default.

lib/internal/Magento/Framework/Indexer/Test/Unit/XsdTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public function testSchemaCorrectlyIdentifiesInvalidXml($xmlString, $expectedErr
6060
$this->assertMatchesRegularExpression($error, $actualError);
6161
$matched = true;
6262
break;
63-
} catch (AssertionFailedError $e) {
63+
} catch (AssertionFailedError) {
6464
}
6565
}
6666
$this->assertTrue($matched, "None of the errors matched: $error");

lib/internal/Magento/Framework/ObjectManager/Test/Unit/Config/XsdTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public function testSchemaCorrectlyIdentifiesInvalidXml($xmlString, $expectedErr
5757
$this->assertMatchesRegularExpression($error, $actualError);
5858
$matched = true;
5959
break;
60-
} catch (AssertionFailedError $e) {
60+
} catch (AssertionFailedError) {
6161
}
6262
}
6363
$this->assertTrue($matched, "None of the errors matched: $error");

0 commit comments

Comments
 (0)