66
77use Doctrine \DBAL \ParameterType ;
88use Doctrine \DBAL \Schema \Column ;
9+ use Doctrine \DBAL \Schema \PrimaryKeyConstraint ;
910use Doctrine \DBAL \Schema \Table ;
1011use Doctrine \DBAL \Tests \FunctionalTestCase ;
1112use Doctrine \DBAL \Tests \TestUtil ;
@@ -26,23 +27,30 @@ protected function setUp(): void
2627 self ::markTestSkipped ("DBAL doesn't support storing LOBs represented as streams using PDO_OCI " );
2728 }
2829
29- $ table = new Table ('blob_table ' , [
30- Column::editor ()
31- ->setUnquotedName ('id ' )
32- ->setTypeName (Types::INTEGER )
33- ->create (),
34- Column::editor ()
35- ->setUnquotedName ('clobcolumn ' )
36- ->setTypeName (Types::TEXT )
37- ->setNotNull (false )
38- ->create (),
39- Column::editor ()
40- ->setUnquotedName ('blobcolumn ' )
41- ->setTypeName (Types::BLOB )
42- ->setNotNull (false )
43- ->create (),
44- ]);
45- $ table ->setPrimaryKey (['id ' ]);
30+ $ table = Table::editor ()
31+ ->setUnquotedName ('blob_table ' )
32+ ->setColumns (
33+ Column::editor ()
34+ ->setUnquotedName ('id ' )
35+ ->setTypeName (Types::INTEGER )
36+ ->create (),
37+ Column::editor ()
38+ ->setUnquotedName ('clobcolumn ' )
39+ ->setTypeName (Types::TEXT )
40+ ->setNotNull (false )
41+ ->create (),
42+ Column::editor ()
43+ ->setUnquotedName ('blobcolumn ' )
44+ ->setTypeName (Types::BLOB )
45+ ->setNotNull (false )
46+ ->create (),
47+ )
48+ ->setPrimaryKeyConstraint (
49+ PrimaryKeyConstraint::editor ()
50+ ->setUnquotedColumnNames ('id ' )
51+ ->create (),
52+ )
53+ ->create ();
4654
4755 $ this ->dropAndCreateTable ($ table );
4856 }
@@ -187,23 +195,31 @@ public function testBindParamProcessesStream(): void
187195
188196 public function testBlobBindingDoesNotOverwritePrevious (): void
189197 {
190- $ table = new Table ('blob_table ' , [
191- Column::editor ()
192- ->setUnquotedName ('id ' )
193- ->setTypeName (Types::INTEGER )
194- ->create (),
195- Column::editor ()
196- ->setUnquotedName ('blobcolumn1 ' )
197- ->setTypeName (Types::BLOB )
198- ->setNotNull (false )
199- ->create (),
200- Column::editor ()
201- ->setUnquotedName ('blobcolumn2 ' )
202- ->setTypeName (Types::BLOB )
203- ->setNotNull (false )
204- ->create (),
205- ]);
206- $ table ->setPrimaryKey (['id ' ]);
198+ $ table = Table::editor ()
199+ ->setUnquotedName ('blob_table ' )
200+ ->setColumns (
201+ Column::editor ()
202+ ->setUnquotedName ('id ' )
203+ ->setTypeName (Types::INTEGER )
204+ ->create (),
205+ Column::editor ()
206+ ->setUnquotedName ('blobcolumn1 ' )
207+ ->setTypeName (Types::BLOB )
208+ ->setNotNull (false )
209+ ->create (),
210+ Column::editor ()
211+ ->setUnquotedName ('blobcolumn2 ' )
212+ ->setTypeName (Types::BLOB )
213+ ->setNotNull (false )
214+ ->create (),
215+ )
216+ ->setPrimaryKeyConstraint (
217+ PrimaryKeyConstraint::editor ()
218+ ->setUnquotedColumnNames ('id ' )
219+ ->create (),
220+ )
221+ ->create ();
222+
207223 $ this ->dropAndCreateTable ($ table );
208224
209225 $ params = ['test1 ' , 'test2 ' ];
0 commit comments