Update objects to use __toString()

This commit is contained in:
Deon George
2020-06-24 22:37:14 +10:00
parent 358f28273c
commit 9936e839a4
15 changed files with 145 additions and 78 deletions

View File

@@ -3,12 +3,12 @@
use Leenooks\OpenPGP;
class Serialization extends PHPUnit\Framework\TestCase {
public function oneSerialization($path) {
$in = OpenPGP\Message::parse(file_get_contents(dirname(__FILE__) . '/data/' . $path));
$mid = $in->to_bytes();
$out = OpenPGP\Message::parse($mid);
$this->assertEquals($in, $out);
}
public function oneSerialization($path) {
$in = OpenPGP\Message::parse(file_get_contents(dirname(__FILE__) . '/data/' . $path));
$mid = (string)$in;
$out = OpenPGP\Message::parse($mid);
$this->assertEquals($in, $out);
}
public function test000001006public_key() {
$this->oneSerialization("000001-006.public_key");