Skip to content

Commit 1631b80

Browse files
committed
Move dropping database into separate method
1 parent 5de3a98 commit 1631b80

File tree

1 file changed

+17
-12
lines changed

1 file changed

+17
-12
lines changed

tests/system/Commands/CreateDatabaseTest.php

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,24 @@ protected function setUp(): void
3838
$this->connection = Database::connect();
3939

4040
parent::setUp();
41+
$this->dropDatabase();
42+
}
43+
44+
protected function tearDown(): void
45+
{
46+
stream_filter_remove($this->streamFilter);
47+
48+
parent::tearDown();
49+
$this->dropDatabase();
50+
}
51+
52+
protected function getBuffer()
53+
{
54+
return CITestStreamFilter::$buffer;
55+
}
4156

57+
private function dropDatabase(): void
58+
{
4259
if ($this->connection instanceof SQLite3Connection) {
4360
$file = WRITEPATH . 'foobar.db';
4461
if (is_file($file)) {
@@ -53,18 +70,6 @@ protected function setUp(): void
5370
}
5471
}
5572

56-
protected function tearDown(): void
57-
{
58-
stream_filter_remove($this->streamFilter);
59-
60-
parent::tearDown();
61-
}
62-
63-
protected function getBuffer()
64-
{
65-
return CITestStreamFilter::$buffer;
66-
}
67-
6873
public function testCreateDatabase()
6974
{
7075
if ($this->connection instanceof OCI8Connection) {

0 commit comments

Comments
 (0)