File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -31,14 +31,33 @@ final class CreateDatabaseTest extends CIUnitTestCase
3131
3232 protected function setUp (): void
3333 {
34+ parent ::setUp ();
35+
3436 CITestStreamFilter::$ buffer = '' ;
3537
3638 $ this ->streamFilter = stream_filter_append (STDOUT , 'CITestStreamFilter ' );
3739 $ this ->streamFilter = stream_filter_append (STDERR , 'CITestStreamFilter ' );
3840 $ this ->connection = Database::connect ();
3941
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+ }
4158
59+ private function dropDatabase (): void
60+ {
4261 if ($ this ->connection instanceof SQLite3Connection) {
4362 $ file = WRITEPATH . 'foobar.db ' ;
4463 if (is_file ($ file )) {
@@ -53,18 +72,6 @@ protected function setUp(): void
5372 }
5473 }
5574
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-
6875 public function testCreateDatabase ()
6976 {
7077 if ($ this ->connection instanceof OCI8Connection) {
You can’t perform that action at this time.
0 commit comments