Skip to content

Commit 438c827

Browse files
committed
ACP2E-1709: error during declarative schema whitelsit generation
1 parent 13d1bd2 commit 438c827

File tree

2 files changed

+34
-4
lines changed

2 files changed

+34
-4
lines changed

app/code/Magento/Developer/Model/Setup/Declaration/Schema/WhitelistGenerator.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -212,10 +212,10 @@ private function getElementsWithAutogeneratedName(Schema $schema, string $tableN
212212
if (isset($tableElementData['type'], $tableElementData['column'])) {
213213
if ($tableElementData['type'] === 'foreign') {
214214
if (isset(
215-
$tableElementData['column'],
216-
$tableElementData['referenceTable'],
217-
$tableElementData['referenceColumn']
218-
)) {
215+
$tableElementData['column'],
216+
$tableElementData['referenceTable'],
217+
$tableElementData['referenceColumn']
218+
)) {
219219
$referenceTable = $schema->getTableByName($tableElementData['referenceTable']);
220220
$column = $table->getColumnByName($tableElementData['column']);
221221
$referenceColumn = $referenceTable->getColumnByName($tableElementData['referenceColumn']);
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
11+
<test name="WhitelistGeneratorTest">
12+
<annotations>
13+
<features value="Backend"/>
14+
<stories value="Whitelist generation using CLI should work without throwing any error."/>
15+
<title value="error during declarative schema whitelist generation"/>
16+
<description value="Whitelist generation using CLI should work without throwing any error."/>
17+
<severity value="AVERAGE"/>
18+
<testCaseId value="AC-8283"/>
19+
<useCaseId value="ACP2E-1709"/>
20+
<group value="CatalogStaging"/>
21+
</annotations>
22+
<magentoCLI command="setup:db-declaration:generate-whitelist --module-name=Magento_CatalogStaging" stepKey="generateWhitelist"/>
23+
24+
<!--Verify that CLI did not return any error/response-->
25+
<assertEquals after="generateWhitelist" stepKey="assertCLINotReturnOutput">
26+
<expectedResult type="string">CLI did not return output.</expectedResult>
27+
<actualResult type="variable">generateWhitelist</actualResult>
28+
</assertEquals>
29+
</test>
30+
</tests>

0 commit comments

Comments
 (0)