File tree Expand file tree Collapse file tree 2 files changed +44
-0
lines changed
dev/tests/setup-integration
_files/Magento/TestSetupDeclarationModule8/revisions/incosistence_reference_type_definition Expand file tree Collapse file tree 2 files changed +44
-0
lines changed Original file line number Diff line number Diff line change 1+ <?xml version =" 1.0" ?>
2+ <!--
3+ /**
4+ * Copyright © Magento, Inc. All rights reserved.
5+ * See COPYING.txt for license details.
6+ */
7+ -->
8+ <schema xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
9+ xsi : noNamespaceSchemaLocation =" urn:magento:framework:Setup/Declaration/Schema/etc/schema.xsd" >
10+ <table name =" test_table" resource =" default" comment =" Test Table" >
11+ <column xsi : type =" int" name =" page_id" nullable =" true" unsigned =" true" identity =" true" />
12+ <constraint xsi : type =" primary" referenceId =" PRIMARY" >
13+ <column name =" page_id" />
14+ </constraint >
15+ </table >
16+ <table name =" dependent" resource =" default" comment =" Lol" >
17+ <column xsi : type =" float" name =" page_id_on" nullable =" true" unsigned =" true" />
18+ <constraint xsi : type =" foreign" referenceId =" FOREIGN" table =" dependent" column =" page_id_on" referenceColumn =" page_id"
19+ referenceTable =" test_table" />
20+ </table >
21+ </schema >
Original file line number Diff line number Diff line change @@ -87,6 +87,29 @@ public function testFailOnIncosistentReferenceDefinition()
8787 $ this ->schemaConfig ->getDeclarationConfig ();
8888 }
8989
90+ /**
91+ * @moduleName Magento_TestSetupDeclarationModule8
92+ */
93+ public function testFailOnIncosistentReferenceTypeDefinition ()
94+ {
95+ $ this ->expectException (LocalizedException::class);
96+ $ this ->expectExceptionMessageMatches (
97+ '/Column definition "page_id_on" and reference column definition "page_id" '
98+ . ' are different in tables "dependent" and "test_table"/ '
99+ );
100+
101+ $ this ->cliCommad ->install (
102+ ['Magento_TestSetupDeclarationModule8 ' ]
103+ );
104+ $ this ->moduleManager ->updateRevision (
105+ 'Magento_TestSetupDeclarationModule8 ' ,
106+ 'incosistence_reference_type_definition ' ,
107+ 'db_schema.xml ' ,
108+ 'etc '
109+ );
110+ $ this ->schemaConfig ->getDeclarationConfig ();
111+ }
112+
90113 /**
91114 * @moduleName Magento_TestSetupDeclarationModule8
92115 */
You can’t perform that action at this time.
0 commit comments