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 @@ -30,6 +30,27 @@ public function testCreateDatabase()
3030 $ this ->assertTrue ($ database_created );
3131 }
3232
33+ public function testCreateDatabaseIfNotExists ()
34+ {
35+ $ dbName = 'test_forge_database_exist ' ;
36+
37+ $ databaseCreateIfNotExists = $ this ->forge ->createDatabase ($ dbName , true );
38+ $ this ->forge ->dropDatabase ($ dbName );
39+
40+ $ this ->assertTrue ($ databaseCreateIfNotExists );
41+ }
42+
43+ public function testCreateDatabaseIfNotExistsWithDb ()
44+ {
45+ $ dbName = 'test_forge_database_exist ' ;
46+
47+ $ this ->forge ->createDatabase ($ dbName );
48+ $ databaseExists = $ this ->forge ->createDatabase ($ dbName , true );
49+ $ this ->forge ->dropDatabase ($ dbName );
50+
51+ $ this ->assertTrue ($ databaseExists );
52+ }
53+
3354 public function testDropDatabase ()
3455 {
3556 if ($ this ->db ->DBDriver === 'SQLite3 ' )
You can’t perform that action at this time.
0 commit comments