TraceableNormalizer example

->with('data', 'format', $this->isType('array'))
            ->willReturn('normalized');

        $denormalizer = $this->createMock(DenormalizerInterface::class);
        $denormalizer->method('getSupportedTypes')->willReturn(['*' => false]);
        $denormalizer
            ->expects($this->once())
            ->method('denormalize')
            ->with('data', 'type', 'format', $this->isType('array'))
            ->willReturn('denormalized');

        $this->assertSame('normalized', (new TraceableNormalizer($normalizernew SerializerDataCollector()))->normalize('data', 'format'));
        $this->assertSame('denormalized', (new TraceableNormalizer($denormalizernew SerializerDataCollector()))->denormalize('data', 'type', 'format'));
    }

    public function testCollectNormalizationData()
    {
        $normalizer = $this->createMock(NormalizerInterface::class);
        $normalizer->method('getSupportedTypes')->willReturn(['*' => false]);
        $denormalizer = $this->createMock(DenormalizerInterface::class);
        $denormalizer->method('getSupportedTypes')->willReturn(['*' => false]);

        $dataCollector = $this->createMock(SerializerDataCollector::class);
        
Home | Imprint | This part of the site doesn't use cookies.