mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-20 17:15:51 +02:00
Rewrote PartNormalizer so that it does not use ObjectNormalizer directly
This commit is contained in:
parent
e53da5ad06
commit
7a90d3f281
2 changed files with 28 additions and 18 deletions
|
@ -28,17 +28,24 @@ use App\Entity\PriceInformations\Orderdetail;
|
|||
use App\Entity\PriceInformations\Pricedetail;
|
||||
use App\Serializer\PartNormalizer;
|
||||
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
|
||||
use Symfony\Component\Serializer\Normalizer\DenormalizerInterface;
|
||||
use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
|
||||
|
||||
class PartNormalizerTest extends WebTestCase
|
||||
{
|
||||
/** @var PartNormalizer */
|
||||
protected $service;
|
||||
protected DenormalizerInterface&NormalizerInterface $service;
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
//Get a service instance.
|
||||
self::bootKernel();
|
||||
$this->service = self::getContainer()->get(PartNormalizer::class);
|
||||
|
||||
//We need to inject the serializer into the normalizer, as we use it directly
|
||||
$serializer = self::getContainer()->get('serializer');
|
||||
$this->service->setNormalizer($serializer);
|
||||
$this->service->setDenormalizer($serializer);
|
||||
}
|
||||
|
||||
public function testSupportsNormalization(): void
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue