99use SimpleSAML \Error ;
1010use SimpleSAML \HTTP \RunnableResponse ;
1111use SimpleSAML \Module \core \Controller ;
12+ use SimpleSAML \Session ;
1213use SimpleSAML \XHTML \Template ;
1314use Symfony \Component \HttpFoundation \Request ;
1415
@@ -23,6 +24,9 @@ class ErrorReportTest extends TestCase
2324 /** @var \SimpleSAML\Configuration */
2425 protected Configuration $ config ;
2526
27+ /** @var \SimpleSAML\Session */
28+ protected Session $ session ;
29+
2630
2731 /**
2832 * Set up for each test.
@@ -41,6 +45,8 @@ protected function setUp(): void
4145 );
4246
4347 Configuration::setPreLoadedConfig ($ this ->config , 'config.php ' );
48+
49+ $ this ->session = Session::getSessionFromRequest ();
4450 }
4551
4652
@@ -54,7 +60,7 @@ public function testErrorReportSent(): void
5460 'GET ' ,
5561 );
5662
57- $ c = new Controller \ErrorReport ($ this ->config );
63+ $ c = new Controller \ErrorReport ($ this ->config , $ this -> session );
5864
5965 $ response = $ c ->main ($ request );
6066
@@ -74,7 +80,7 @@ public function testErrorReportIncorrectReportID(): void
7480 ['reportId ' => 'abc123 ' ],
7581 );
7682
77- $ c = new Controller \ErrorReport ($ this ->config );
83+ $ c = new Controller \ErrorReport ($ this ->config , $ this -> session );
7884
7985 $ this ->expectException (Error \Exception::class);
8086 $ this ->expectExceptionMessage ('Invalid reportID ' );
@@ -98,7 +104,7 @@ public function testErrorReport(): void
98104 ],
99105 );
100106
101- $ c = new Controller \ErrorReport ($ this ->config );
107+ $ c = new Controller \ErrorReport ($ this ->config , $ this -> session );
102108
103109 $ response = $ c ->main ($ request );
104110
0 commit comments