ver. 0.320: API słowniki — ensure_producer; ProductRepository — producer_name w odpowiedzi
- DictionariesApiController: nowy endpoint POST ensure_producer (znajdź lub utwórz producenta) - ProducerRepository: metoda ensureProducerForApi() - ProductRepository: pole producer_name w odpowiedzi GET product - ApiRouter: wstrzyknięto ProducerRepository do DictionariesApiController - Zaktualizowano docs/API.md Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -4,6 +4,7 @@ namespace Tests\Unit\api\Controllers;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use api\Controllers\DictionariesApiController;
|
||||
use Domain\Attribute\AttributeRepository;
|
||||
use Domain\Producer\ProducerRepository;
|
||||
use Domain\ShopStatus\ShopStatusRepository;
|
||||
use Domain\Transport\TransportRepository;
|
||||
use Domain\PaymentMethod\PaymentMethodRepository;
|
||||
@@ -14,6 +15,7 @@ class DictionariesApiControllerTest extends TestCase
|
||||
private $mockTransportRepo;
|
||||
private $mockPaymentRepo;
|
||||
private $mockAttrRepo;
|
||||
private $mockProducerRepo;
|
||||
private $controller;
|
||||
|
||||
protected function setUp(): void
|
||||
@@ -22,12 +24,14 @@ class DictionariesApiControllerTest extends TestCase
|
||||
$this->mockTransportRepo = $this->createMock(TransportRepository::class);
|
||||
$this->mockPaymentRepo = $this->createMock(PaymentMethodRepository::class);
|
||||
$this->mockAttrRepo = $this->createMock(AttributeRepository::class);
|
||||
$this->mockProducerRepo = $this->createMock(ProducerRepository::class);
|
||||
|
||||
$this->controller = new DictionariesApiController(
|
||||
$this->mockStatusRepo,
|
||||
$this->mockTransportRepo,
|
||||
$this->mockPaymentRepo,
|
||||
$this->mockAttrRepo
|
||||
$this->mockAttrRepo,
|
||||
$this->mockProducerRepo
|
||||
);
|
||||
|
||||
$_SERVER['REQUEST_METHOD'] = 'GET';
|
||||
|
||||
Reference in New Issue
Block a user