public function createEncoder()
{
$parser = $this->getMock(ParserInterface::class);
$parser->expects($this->any())->method('encode')->will($this->returnCallback(function ($mixed) {
return $this->encode($mixed);
}));
$parser->expects($this->any())->method('decode')->will($this->returnCallback(function ($str) {
return $this->decode($str);
}));
return new Encoder($parser);
}