->
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($encoder,
new SerializerDataCollector()))->
encode('data', 'format'
));
$this->
assertSame('decoded',
(new TraceableEncoder($decoder,
new 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())