@@ -71,122 +71,6 @@ public function testAlterTableColumnNotNull(callable $comparatorFactory): void
71
71
self ::assertTrue ($ columns ['bar ' ]->getNotnull ());
72
72
}
73
73
74
- public function testListTableDetailsWithDifferentIdentifierQuotingRequirements (): void
75
- {
76
- $ primaryTableName = '"Primary_Table" ' ;
77
- $ offlinePrimaryTable = new Table ($ primaryTableName );
78
- $ offlinePrimaryTable ->addColumn (
79
- '"Id" ' ,
80
- Types::INTEGER ,
81
- ['autoincrement ' => true , 'comment ' => 'Explicit casing. ' ],
82
- );
83
- $ offlinePrimaryTable ->addColumn ('select ' , Types::INTEGER , ['comment ' => 'Reserved keyword. ' ]);
84
- $ offlinePrimaryTable ->addColumn ('foo ' , Types::INTEGER , ['comment ' => 'Implicit uppercasing. ' ]);
85
- $ offlinePrimaryTable ->addColumn ('BAR ' , Types::INTEGER );
86
- $ offlinePrimaryTable ->addColumn ('"BAZ" ' , Types::INTEGER );
87
- $ offlinePrimaryTable ->addIndex (['select ' ], 'from ' );
88
- $ offlinePrimaryTable ->addIndex (['foo ' ], 'foo_index ' );
89
- $ offlinePrimaryTable ->addIndex (['BAR ' ], 'BAR_INDEX ' );
90
- $ offlinePrimaryTable ->addIndex (['"BAZ" ' ], 'BAZ_INDEX ' );
91
- $ offlinePrimaryTable ->setPrimaryKey (['"Id" ' ]);
92
-
93
- $ foreignTableName = 'foreign ' ;
94
- $ offlineForeignTable = new Table ($ foreignTableName );
95
- $ offlineForeignTable ->addColumn ('id ' , Types::INTEGER , ['autoincrement ' => true ]);
96
- $ offlineForeignTable ->addColumn ('"Fk" ' , Types::INTEGER );
97
- $ offlineForeignTable ->addIndex (['"Fk" ' ], '"Fk_index" ' );
98
- $ offlineForeignTable ->addForeignKeyConstraint (
99
- $ primaryTableName ,
100
- ['"Fk" ' ],
101
- ['"Id" ' ],
102
- [],
103
- '"Primary_Table_Fk" ' ,
104
- );
105
- $ offlineForeignTable ->setPrimaryKey (['id ' ]);
106
-
107
- $ this ->dropTableIfExists ($ foreignTableName );
108
- $ this ->dropTableIfExists ($ primaryTableName );
109
-
110
- $ this ->schemaManager ->createTable ($ offlinePrimaryTable );
111
- $ this ->schemaManager ->createTable ($ offlineForeignTable );
112
-
113
- $ onlinePrimaryTable = $ this ->schemaManager ->introspectTable ($ primaryTableName );
114
- $ onlineForeignTable = $ this ->schemaManager ->introspectTable ($ foreignTableName );
115
-
116
- $ platform = $ this ->connection ->getDatabasePlatform ();
117
-
118
- // Primary table assertions
119
- self ::assertSame ($ primaryTableName , $ onlinePrimaryTable ->getQuotedName ($ platform ));
120
-
121
- self ::assertTrue ($ onlinePrimaryTable ->hasColumn ('"Id" ' ));
122
- self ::assertSame ('"Id" ' , $ onlinePrimaryTable ->getColumn ('"Id" ' )->getQuotedName ($ platform ));
123
- self ::assertTrue ($ onlinePrimaryTable ->hasPrimaryKey ());
124
-
125
- $ primaryKey = $ onlinePrimaryTable ->getPrimaryKey ();
126
-
127
- self ::assertNotNull ($ primaryKey );
128
- self ::assertSame (['"Id" ' ], $ primaryKey ->getQuotedColumns ($ platform ));
129
-
130
- self ::assertTrue ($ onlinePrimaryTable ->hasColumn ('select ' ));
131
- self ::assertSame ('"select" ' , $ onlinePrimaryTable ->getColumn ('select ' )->getQuotedName ($ platform ));
132
-
133
- self ::assertTrue ($ onlinePrimaryTable ->hasColumn ('foo ' ));
134
- self ::assertSame ('FOO ' , $ onlinePrimaryTable ->getColumn ('foo ' )->getQuotedName ($ platform ));
135
-
136
- self ::assertTrue ($ onlinePrimaryTable ->hasColumn ('BAR ' ));
137
- self ::assertSame ('BAR ' , $ onlinePrimaryTable ->getColumn ('BAR ' )->getQuotedName ($ platform ));
138
-
139
- self ::assertTrue ($ onlinePrimaryTable ->hasColumn ('"BAZ" ' ));
140
- self ::assertSame ('BAZ ' , $ onlinePrimaryTable ->getColumn ('"BAZ" ' )->getQuotedName ($ platform ));
141
-
142
- self ::assertTrue ($ onlinePrimaryTable ->hasIndex ('from ' ));
143
- self ::assertTrue ($ onlinePrimaryTable ->getIndex ('from ' )->hasColumnAtPosition ('"select" ' ));
144
- self ::assertSame (['"select" ' ], $ onlinePrimaryTable ->getIndex ('from ' )->getQuotedColumns ($ platform ));
145
-
146
- self ::assertTrue ($ onlinePrimaryTable ->hasIndex ('foo_index ' ));
147
- self ::assertTrue ($ onlinePrimaryTable ->getIndex ('foo_index ' )->hasColumnAtPosition ('foo ' ));
148
- self ::assertSame (['FOO ' ], $ onlinePrimaryTable ->getIndex ('foo_index ' )->getQuotedColumns ($ platform ));
149
-
150
- self ::assertTrue ($ onlinePrimaryTable ->hasIndex ('BAR_INDEX ' ));
151
- self ::assertTrue ($ onlinePrimaryTable ->getIndex ('BAR_INDEX ' )->hasColumnAtPosition ('BAR ' ));
152
- self ::assertSame (['BAR ' ], $ onlinePrimaryTable ->getIndex ('BAR_INDEX ' )->getQuotedColumns ($ platform ));
153
-
154
- self ::assertTrue ($ onlinePrimaryTable ->hasIndex ('BAZ_INDEX ' ));
155
- self ::assertTrue ($ onlinePrimaryTable ->getIndex ('BAZ_INDEX ' )->hasColumnAtPosition ('"BAZ" ' ));
156
- self ::assertSame (['BAZ ' ], $ onlinePrimaryTable ->getIndex ('BAZ_INDEX ' )->getQuotedColumns ($ platform ));
157
-
158
- // Foreign table assertions
159
- self ::assertTrue ($ onlineForeignTable ->hasColumn ('id ' ));
160
- self ::assertSame ('ID ' , $ onlineForeignTable ->getColumn ('id ' )->getQuotedName ($ platform ));
161
- self ::assertTrue ($ onlineForeignTable ->hasPrimaryKey ());
162
-
163
- $ primaryKey = $ onlineForeignTable ->getPrimaryKey ();
164
-
165
- self ::assertNotNull ($ primaryKey );
166
- self ::assertSame (['ID ' ], $ primaryKey ->getQuotedColumns ($ platform ));
167
-
168
- self ::assertTrue ($ onlineForeignTable ->hasColumn ('"Fk" ' ));
169
- self ::assertSame ('"Fk" ' , $ onlineForeignTable ->getColumn ('"Fk" ' )->getQuotedName ($ platform ));
170
-
171
- self ::assertTrue ($ onlineForeignTable ->hasIndex ('"Fk_index" ' ));
172
- self ::assertTrue ($ onlineForeignTable ->getIndex ('"Fk_index" ' )->hasColumnAtPosition ('"Fk" ' ));
173
- self ::assertSame (['"Fk" ' ], $ onlineForeignTable ->getIndex ('"Fk_index" ' )->getQuotedColumns ($ platform ));
174
-
175
- self ::assertTrue ($ onlineForeignTable ->hasForeignKey ('"Primary_Table_Fk" ' ));
176
- self ::assertSame (
177
- $ primaryTableName ,
178
- $ onlineForeignTable ->getForeignKey ('"Primary_Table_Fk" ' )->getQuotedForeignTableName ($ platform ),
179
- );
180
- self ::assertSame (
181
- ['"Fk" ' ],
182
- $ onlineForeignTable ->getForeignKey ('"Primary_Table_Fk" ' )->getQuotedLocalColumns ($ platform ),
183
- );
184
- self ::assertSame (
185
- ['"Id" ' ],
186
- $ onlineForeignTable ->getForeignKey ('"Primary_Table_Fk" ' )->getQuotedForeignColumns ($ platform ),
187
- );
188
- }
189
-
190
74
public function testListTableColumnsSameTableNamesInDifferentSchemas (): void
191
75
{
192
76
$ table = $ this ->createListTableColumns ();
0 commit comments