Skip to content

Commit 8e1ef75

Browse files
committed
test: refactor test code
1 parent 1a9dfab commit 8e1ef75

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

‎tests/system/Database/Live/ForgeTest.php‎

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ public function testCreateDatabase(): void
5454
if ($this->db->DBDriver === 'OCI8') {
5555
$this->markTestSkipped('OCI8 does not support create database.');
5656
}
57+
5758
$databaseCreated = $this->forge->createDatabase('test_forge_database');
5859

5960
$this->assertTrue($databaseCreated);
@@ -64,30 +65,34 @@ public function testCreateDatabaseIfNotExists(): void
6465
if ($this->db->DBDriver === 'OCI8') {
6566
$this->markTestSkipped('OCI8 does not support create database.');
6667
}
68+
6769
$dbName = 'test_forge_database_exist';
6870

6971
$databaseCreateIfNotExists = $this->forge->createDatabase($dbName, true);
72+
73+
$this->assertTrue($databaseCreateIfNotExists);
74+
7075
if ($this->db->DBDriver !== 'SQLite3') {
7176
$this->forge->dropDatabase($dbName);
7277
}
73-
74-
$this->assertTrue($databaseCreateIfNotExists);
7578
}
7679

7780
public function testCreateDatabaseIfNotExistsWithDb(): void
7881
{
7982
if ($this->db->DBDriver === 'OCI8') {
8083
$this->markTestSkipped('OCI8 does not support create database.');
8184
}
85+
8286
$dbName = 'test_forge_database_exist';
8387

8488
$this->forge->createDatabase($dbName);
8589
$databaseExists = $this->forge->createDatabase($dbName, true);
90+
91+
$this->assertTrue($databaseExists);
92+
8693
if ($this->db->DBDriver !== 'SQLite3') {
8794
$this->forge->dropDatabase($dbName);
8895
}
89-
90-
$this->assertTrue($databaseExists);
9196
}
9297

9398
public function testDropDatabase(): void

0 commit comments

Comments
 (0)