Skip to content

Commit b43c4aa

Browse files
committed
B2B-1671: Detect Missing Primary Key in Table Schema Test
1 parent 17ba28a commit b43c4aa

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

dev/tests/static/testsuite/Magento/Test/Integrity/DBSchema/PrimaryKeyTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ private function hasPrimaryKey(array $tableSchemaDeclaration): bool
7171
}
7272

7373
/**
74-
* Get database schema declaration from file.
74+
* Get database schema declarations from file.
7575
*
7676
* @param string $filePath
7777
* @return array
@@ -84,7 +84,7 @@ private function getDbSchemaDeclarationByFile(string $filePath): array
8484
}
8585

8686
/**
87-
* Get database schema declaration for whole application
87+
* Get database schema declarations for whole application
8888
*
8989
* @return array
9090
* @throws LocalizedException
@@ -94,8 +94,8 @@ private function getDbSchemaDeclarations(): array
9494
$declarations = [];
9595
foreach (Files::init()->getDbSchemaFiles() as $filePath) {
9696
$filePath = reset($filePath);
97-
preg_match('#app/code/(\w+/\w+)#', $filePath, $result);
98-
$moduleName = str_replace('/', '\\', $result[1]);
97+
preg_match('#/(\w+/\w+)/etc/db_schema.xml#', $filePath, $result);
98+
$moduleName = str_replace('/', '_', $result[1]);
9999
$moduleDeclaration = $this->getDbSchemaDeclarationByFile($filePath);
100100

101101
foreach ($moduleDeclaration['table'] as $tableName => $tableDeclaration) {

0 commit comments

Comments
 (0)