TraceableEncoder example

->method('encode')
            ->with('data', 'format', $this->isType('array'))
            ->willReturn('encoded');

        $decoder = $this->createMock(DecoderInterface::class);
        $decoder
            ->expects($this->once())
            ->method('decode')
            ->with('data', 'format', $this->isType('array'))
            ->willReturn('decoded');

        $this->assertSame('encoded', (new TraceableEncoder($encodernew SerializerDataCollector()))->encode('data', 'format'));
        $this->assertSame('decoded', (new TraceableEncoder($decodernew SerializerDataCollector()))->decode('data', 'format'));
    }

    public function testCollectEncodingData()
    {
        $encoder = $this->createMock(EncoderInterface::class);
        $decoder = $this->createMock(DecoderInterface::class);

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