repository = $this->createMock(OrderRepository::class); $this->adminService = $this->createMock(OrderAdminService::class); $this->controller = new ShopOrderController($this->repository, $this->adminService); } public function testConstructorAcceptsRepository(): void { $controller = new ShopOrderController($this->repository, $this->adminService); $this->assertInstanceOf(ShopOrderController::class, $controller); } public function testHasMainActionMethods(): void { $this->assertTrue(method_exists($this->controller, 'paymentConfirmation')); $this->assertTrue(method_exists($this->controller, 'paymentStatusTpay')); $this->assertTrue(method_exists($this->controller, 'paymentStatusPrzelewy24pl')); $this->assertTrue(method_exists($this->controller, 'paymentStatusHotpay')); $this->assertTrue(method_exists($this->controller, 'orderDetails')); } public function testConstructorRequiresOrderRepository(): void { $reflection = new \ReflectionClass(ShopOrderController::class); $constructor = $reflection->getConstructor(); $params = $constructor->getParameters(); $this->assertCount(2, $params); $this->assertEquals('Domain\Order\OrderRepository', $params[0]->getType()->getName()); $this->assertEquals('Domain\Order\OrderAdminService', $params[1]->getType()->getName()); } }