serialize() public method

Walk into an array to get not serializable objects and replace it by a serializable one.
public serialize ( array $attributes ) : string
$attributes array ActiveRecord attributes to be serialized.
return string
 public function testSerializeShouldCallConvertAndReturnStringSuccessfully()
 {
     $converter = m::mock(Converter::class);
     $serializer = new Serializer($converter);
     $attributes = ['some', 'attributes'];
     $replaced = ['awsome', 'attrs'];
     $converter->shouldReceive('toDomainTypes')->with($attributes)->once()->andReturn($replaced);
     $this->assertEquals(serialize($replaced), $serializer->serialize($attributes));
 }