77use InvalidArgumentException ;
88use Phauthentic \CognitiveCodeAnalysis \Business \Churn \Report \ChurnReportFactory ;
99use Phauthentic \CognitiveCodeAnalysis \Business \Churn \Report \ReportGeneratorInterface ;
10+ use Phauthentic \CognitiveCodeAnalysis \CognitiveAnalysisException ;
1011use Phauthentic \CognitiveCodeAnalysis \Config \ConfigService ;
1112use PHPUnit \Framework \Attributes \Test ;
13+ use PHPUnit \Framework \MockObject \Exception ;
1214use PHPUnit \Framework \TestCase ;
1315use PHPUnit \Framework \MockObject \MockObject ;
1416use Phauthentic \CognitiveCodeAnalysis \Tests \Unit \Business \Churn \Exporter \TestCognitiveConfig ;
1820 */
1921class ChurnExporterFactoryCustomTest extends TestCase
2022{
23+ /**
24+ * @throws Exception
25+ */
2126 private function createMockConfigService (array $ customExporters = []): ConfigService &MockObject
2227 {
2328 // Create TestCognitiveConfig with the custom exporters
@@ -28,6 +33,7 @@ private function createMockConfigService(array $customExporters = []): ConfigSer
2833
2934 return $ configService ;
3035 }
36+
3137 #[Test]
3238 public function testCreateBuiltInExporter (): void
3339 {
@@ -197,7 +203,7 @@ public function export(array $classes, string $filename): void {
197203
198204 $ factory = new ChurnReportFactory ($ this ->createMockConfigService ($ customExporters ));
199205
200- $ this ->expectException (\ Phauthentic \ CognitiveCodeAnalysis \ CognitiveAnalysisException::class);
206+ $ this ->expectException (CognitiveAnalysisException::class);
201207 $ this ->expectExceptionMessage ('Exporter must implement Phauthentic\CognitiveCodeAnalysis\Business\Churn\Report\ReportGeneratorInterface ' );
202208
203209 $ factory ->create ('invalid ' );
@@ -218,7 +224,7 @@ public function testCustomExporterWithNonExistentFile(): void
218224
219225 $ factory = new ChurnReportFactory ($ this ->createMockConfigService ($ customExporters ));
220226
221- $ this ->expectException (\ Phauthentic \ CognitiveCodeAnalysis \ CognitiveAnalysisException::class);
227+ $ this ->expectException (CognitiveAnalysisException::class);
222228 $ this ->expectExceptionMessage ('Exporter file not found: /non/existent/file.php ' );
223229
224230 $ factory ->create ('missing ' );
0 commit comments