33namespace Integration \Router ;
44
55use PHPUnit \Framework \Attributes \Test ;
6+ use Tempest \Container \GenericContainer ;
7+ use Tempest \Core \FrameworkKernel ;
8+ use Tempest \Core \Kernel ;
69use Tempest \Core \KernelEvent ;
10+ use Tempest \EventBus \EventBus ;
11+ use Tempest \Http \RequestFactory ;
12+ use Tempest \Router \ResponseSender ;
13+ use Tempest \Router \Router ;
714use Tempest \Router \WorkerModeApplication ;
815use Tests \Tempest \Integration \FrameworkIntegrationTestCase ;
916
@@ -14,7 +21,21 @@ public function test_shutdown_and_reset_are_called(): void
1421 {
1522 $ this ->eventBus ->preventEventHandling ();
1623
17- $ application = new WorkerModeApplication ($ this ->container );
24+ $ container = new GenericContainer ();
25+
26+ $ container ->singleton (EventBus::class, $ this ->container ->get (EventBus::class));
27+ $ container ->singleton (Router::class, $ this ->container ->get (Router::class));
28+ $ container ->singleton (RequestFactory::class, $ this ->container ->get (RequestFactory::class));
29+ $ container ->singleton (ResponseSender::class, $ this ->container ->get (ResponseSender::class));
30+
31+ $ container ->singleton (Kernel::class, new FrameworkKernel (
32+ root: $ this ->kernel ->root ,
33+ discoveryLocations: $ this ->discoveryLocations ,
34+ container: $ container ,
35+ longRunning: true ,
36+ ));
37+
38+ $ application = new WorkerModeApplication ($ container );
1839
1940 ob_start ();
2041 $ application ->run ();
0 commit comments