File tree 2 files changed +15
-1
lines changed
src/Symfony/Component/Mime
2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -78,7 +78,7 @@ final public function unserialize($serialized)
78
78
79
79
public function __serialize (): array
80
80
{
81
- return [$ this ->message ];
81
+ return [$ this ->toString () ];
82
82
}
83
83
84
84
public function __unserialize (array $ data ): void
Original file line number Diff line number Diff line change @@ -32,4 +32,18 @@ public function testToString()
32
32
$ this ->assertEquals ('some string ' , $ message ->toString ());
33
33
$ this ->assertEquals ('some string ' , implode ('' , iterator_to_array ($ message ->toIterable ())));
34
34
}
35
+
36
+ public function testSerialization ()
37
+ {
38
+ $ message = new RawMessage ('string ' );
39
+ $ this ->assertEquals ('string ' , unserialize (serialize ($ message ))->toString ());
40
+ // calling methods more than once work
41
+ $ this ->assertEquals ('string ' , unserialize (serialize ($ message ))->toString ());
42
+
43
+ $ message = new RawMessage (new \ArrayObject (['some ' , ' ' , 'string ' ]));
44
+ $ message = new RawMessage ($ message ->toIterable ());
45
+ $ this ->assertEquals ('some string ' , unserialize (serialize ($ message ))->toString ());
46
+ // calling methods more than once work
47
+ $ this ->assertEquals ('some string ' , unserialize (serialize ($ message ))->toString ());
48
+ }
35
49
}
You can’t perform that action at this time.
0 commit comments