ver. 0.290: ShopCoupon + ShopOrder frontend migration to Domain + Controllers

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-17 19:54:21 +01:00
parent c06f055cf5
commit 46ff934d42
29 changed files with 936 additions and 419 deletions

View File

@@ -0,0 +1,43 @@
<?php
namespace Tests\Unit\front\Controllers;
use PHPUnit\Framework\TestCase;
use front\Controllers\ShopOrderController;
use Domain\Order\OrderRepository;
class ShopOrderControllerTest extends TestCase
{
private $repository;
private $controller;
protected function setUp(): void
{
$this->repository = $this->createMock(OrderRepository::class);
$this->controller = new ShopOrderController($this->repository);
}
public function testConstructorAcceptsRepository(): void
{
$controller = new ShopOrderController($this->repository);
$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(1, $params);
$this->assertEquals('Domain\Order\OrderRepository', $params[0]->getType()->getName());
}
}