File tree Expand file tree Collapse file tree
tests/system/Database/Live Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -88,6 +88,12 @@ public function testCreateDatabase(): void
8888 $ this ->markTestSkipped ('OCI8 does not support create database. ' );
8989 }
9090
91+ try {
92+ $ this ->forge ->dropDatabase ('test_forge_database ' );
93+ } catch (DatabaseException $ e ) {
94+ // Ignore if doesn't exist
95+ }
96+
9197 $ databaseCreated = $ this ->forge ->createDatabase ('test_forge_database ' );
9298
9399 $ this ->assertTrue ($ databaseCreated );
@@ -101,6 +107,12 @@ public function testCreateDatabaseWithDots(): void
101107
102108 $ dbName = 'test_com.sitedb.web ' ;
103109
110+ try {
111+ $ this ->forge ->dropDatabase ($ dbName );
112+ } catch (DatabaseException $ e ) {
113+ // Ignore if doesn't exist
114+ }
115+
104116 $ databaseCreated = $ this ->forge ->createDatabase ($ dbName );
105117
106118 $ this ->assertTrue ($ databaseCreated );
@@ -184,6 +196,12 @@ public function testDropDatabase(): void
184196 $ this ->markTestSkipped ('SQLite3 requires file path to drop database ' );
185197 }
186198
199+ try {
200+ $ this ->forge ->createDatabase ('test_forge_database ' );
201+ } catch (DatabaseException $ e ) {
202+ // Ignore if exists
203+ }
204+
187205 $ databaseDropped = $ this ->forge ->dropDatabase ('test_forge_database ' );
188206
189207 $ this ->assertTrue ($ databaseDropped );
Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ public function testShowErrorMessageWhenSettingInvalidCharset(): void
4747 $ group = $ config ->tests ;
4848 // Sets invalid charset.
4949 $ group ['charset ' ] = 'utf8mb4 ' ;
50- $ db = Database ::connect ($ group );
50+ $ db = Database ::connect ($ group, false );
5151
5252 // Actually connect to DB.
5353 $ db ->initialize ();
You can’t perform that action at this time.
0 commit comments