18 private $serializeMock;
28 private $salesOrderPaymentDataConverter;
33 $this->serializeMock = $this->createMock(Serialize::class);
34 $this->jsonMock = $this->createMock(Json::class);
36 SalesOrderPaymentDataConverter::class,
38 'serialize' => $this->serializeMock,
39 'json' => $this->jsonMock
46 $serializedData =
'serialized data';
50 'public_hash' =>
'someHash' 53 $convertedUnserializedData = [
55 'public_hash' =>
'someHash' 57 $jsonEncodedData =
'json encoded data';
59 $this->serializeMock->expects($this->once())
60 ->method(
'unserialize')
61 ->with($serializedData)
62 ->willReturn($unserializedData);
63 $this->jsonMock->expects($this->once())
65 ->with($convertedUnserializedData)
66 ->willReturn($jsonEncodedData);
68 $this->assertEquals($jsonEncodedData, $this->salesOrderPaymentDataConverter->convert($serializedData));