File tree Expand file tree Collapse file tree 1 file changed +20
-13
lines changed Expand file tree Collapse file tree 1 file changed +20
-13
lines changed Original file line number Diff line number Diff line change @@ -31,14 +31,33 @@ final class CreateDatabaseTest extends CIUnitTestCase
31
31
32
32
protected function setUp (): void
33
33
{
34
+ parent ::setUp ();
35
+
34
36
CITestStreamFilter::$ buffer = '' ;
35
37
36
38
$ this ->streamFilter = stream_filter_append (STDOUT , 'CITestStreamFilter ' );
37
39
$ this ->streamFilter = stream_filter_append (STDERR , 'CITestStreamFilter ' );
38
40
$ this ->connection = Database::connect ();
39
41
40
- parent ::setUp ();
42
+ $ this ->dropDatabase ();
43
+ }
44
+
45
+ protected function tearDown (): void
46
+ {
47
+ parent ::tearDown ();
48
+
49
+ stream_filter_remove ($ this ->streamFilter );
50
+
51
+ $ this ->dropDatabase ();
52
+ }
53
+
54
+ protected function getBuffer ()
55
+ {
56
+ return CITestStreamFilter::$ buffer ;
57
+ }
41
58
59
+ private function dropDatabase (): void
60
+ {
42
61
if ($ this ->connection instanceof SQLite3Connection) {
43
62
$ file = WRITEPATH . 'foobar.db ' ;
44
63
if (is_file ($ file )) {
@@ -53,18 +72,6 @@ protected function setUp(): void
53
72
}
54
73
}
55
74
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
-
68
75
public function testCreateDatabase ()
69
76
{
70
77
if ($ this ->connection instanceof OCI8Connection) {
You can’t perform that action at this time.
0 commit comments