repository = $this->createMock(ProducerRepository::class); $this->controller = new ShopProducerController($this->repository); } public function testConstructorAcceptsRepository(): void { $controller = new ShopProducerController($this->repository); $this->assertInstanceOf(ShopProducerController::class, $controller); } public function testHasMainActionMethods(): void { $this->assertTrue(method_exists($this->controller, 'products')); $this->assertTrue(method_exists($this->controller, 'list')); } public function testConstructorRequiresProducerRepository(): void { $reflection = new \ReflectionClass(ShopProducerController::class); $constructor = $reflection->getConstructor(); $params = $constructor->getParameters(); $this->assertCount(1, $params); $this->assertEquals('Domain\Producer\ProducerRepository', $params[0]->getType()->getName()); } }