File tree Expand file tree Collapse file tree 3 files changed +30
-0
lines changed Expand file tree Collapse file tree 3 files changed +30
-0
lines changed Original file line number Diff line number Diff line change 1414
1515class SqlQueryInterceptModuleTest extends TestCase
1616{
17+ /** @var ExtendedPdo */
18+ private $ pdo ;
19+
1720 /** @var FakeRo */
1821 private $ fakeRo ;
1922
@@ -45,11 +48,19 @@ protected function configure()
4548 $ this ->bind (FakeBar::class);
4649 }
4750 };
51+ $ this ->pdo = $ pdo ;
4852 $ injector = new Injector ($ module , __DIR__ . '/tmp ' );
4953 $ this ->fakeRo = $ injector ->getInstance (FakeRo::class);
5054 $ this ->fakeBar = $ injector ->getInstance (FakeBar::class);
5155 }
5256
57+ protected function tearDown (): void
58+ {
59+ unset($ this ->pdo ); // This effectively closes the SQLite connection
60+
61+ parent ::tearDown ();
62+ }
63+
5364 public function testResourceObject200 (): void
5465 {
5566 $ response = $ this ->fakeRo ->onGet ('1 ' );
Original file line number Diff line number Diff line change 1919
2020class SqlQueryModuleTest extends TestCase
2121{
22+ /** @var ExtendedPdo */
23+ private $ pdo ;
24+
2225 /** @var AbstractModule */
2326 private $ module ;
27+
2428 protected function setUp (): void
2529 {
2630 $ pdo = new ExtendedPdo ('sqlite::memory: ' );
@@ -45,6 +49,14 @@ protected function configure()
4549 $ this ->install (new SqlQueryModule (__DIR__ . '/Fake/sql ' ));
4650 }
4751 };
52+ $ this ->pdo = $ pdo ;
53+ }
54+
55+ protected function tearDown (): void
56+ {
57+ unset($ this ->pdo ); // This effectively closes the SQLite connection
58+
59+ parent ::tearDown ();
4860 }
4961
5062 public function testProviderInject (): void
Original file line number Diff line number Diff line change @@ -29,6 +29,13 @@ protected function setUp(): void
2929 $ this ->pdo = $ pdo ;
3030 }
3131
32+ protected function tearDown (): void
33+ {
34+ unset($ this ->pdo ); // This effectively closes the SQLite connection
35+
36+ parent ::tearDown ();
37+ }
38+
3239 public function testInvoke (): void
3340 {
3441 $ sql = (string ) file_get_contents (__DIR__ . '/Fake/sql/todo_item_by_id.sql ' );
You can’t perform that action at this time.
0 commit comments