Skip to content

Commit

Permalink
Test for PEAR bug #21243, PR#10
Browse files Browse the repository at this point in the history
  • Loading branch information
sanmai committed Oct 29, 2018
1 parent b499b83 commit 369d3ee
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/OLE_Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,16 @@ public function testWrite()

$this->assertStringEqualsFile(__DIR__.'/data/Example.bin', $data);
}

public function testReadMsg()
{
$ole = new OLE();
$ole->read(__DIR__.'/data/Test_message.msg');

$el = $ole->_list[8];
$this->assertSame('__substg1.0_0037001F', $el->Name); // MAPI attribute PidTagSubject (ie message subject)
$dlen = $ole->getDataLength($el->No);
$data = $ole->getData($el->No, 0, $dlen);
$this->assertSame($data, hex2bin('540065007300740020006d00650073007300610067006500')); // UTF16-LE string "Test Message"
}
}
Binary file added tests/data/Test_message.msg
Binary file not shown.

0 comments on commit 369d3ee

Please sign in to comment.