mockRepository = $this->createMock(ProductRepository::class); $this->controller = new ProductArchiveController($this->mockRepository); } public function testConstructorAcceptsRepository(): void { $controller = new ProductArchiveController($this->mockRepository); $this->assertInstanceOf(ProductArchiveController::class, $controller); } public function testHasListMethod(): void { $this->assertTrue(method_exists($this->controller, 'list')); } public function testHasUnarchiveMethod(): void { $this->assertTrue(method_exists($this->controller, 'unarchive')); } public function testListMethodReturnType(): void { $reflection = new \ReflectionClass($this->controller); $this->assertEquals('string', (string)$reflection->getMethod('list')->getReturnType()); } public function testUnarchiveMethodReturnType(): void { $reflection = new \ReflectionClass($this->controller); $this->assertEquals('void', (string)$reflection->getMethod('unarchive')->getReturnType()); } public function testConstructorRequiresProductRepository(): void { $reflection = new \ReflectionClass(ProductArchiveController::class); $constructor = $reflection->getConstructor(); $params = $constructor->getParameters(); $this->assertCount(1, $params); $this->assertEquals('Domain\Product\ProductRepository', $params[0]->getType()->getName()); } public function testHasBulkDeletePermanentMethod(): void { $this->assertTrue(method_exists($this->controller, 'bulk_delete_permanent')); } public function testBulkDeletePermanentMethodReturnType(): void { $reflection = new \ReflectionClass($this->controller); $this->assertEquals('void', (string)$reflection->getMethod('bulk_delete_permanent')->getReturnType()); } }