mockSettingsRepository = $this->createMock(SettingsRepository::class); $this->mockLanguagesRepository = $this->createMock(LanguagesRepository::class); $this->controller = new SettingsController($this->mockSettingsRepository, $this->mockLanguagesRepository); } public function testConstructorAcceptsRepository(): void { $controller = new SettingsController($this->mockSettingsRepository, $this->mockLanguagesRepository); $this->assertInstanceOf(SettingsController::class, $controller); } public function testHasClearCacheMethod(): void { $this->assertTrue(method_exists($this->controller, 'clearCache')); } public function testHasClearCacheAjaxMethod(): void { $this->assertTrue(method_exists($this->controller, 'clearCacheAjax')); } public function testHasSaveMethod(): void { $this->assertTrue(method_exists($this->controller, 'save')); } public function testHasViewMethod(): void { $this->assertTrue(method_exists($this->controller, 'view')); } public function testIsNotAbstract(): void { $reflection = new \ReflectionClass($this->controller); $this->assertFalse($reflection->isAbstract()); } public function testActionMethodReturnTypes(): void { $reflection = new \ReflectionClass($this->controller); $this->assertEquals('void', (string)$reflection->getMethod('clearCache')->getReturnType()); $this->assertEquals('void', (string)$reflection->getMethod('clearCacheAjax')->getReturnType()); $this->assertEquals('void', (string)$reflection->getMethod('save')->getReturnType()); $this->assertEquals('string', (string)$reflection->getMethod('view')->getReturnType()); } }