OLEReadTest.php 803 B

12345678910111213141516171819202122232425262728
  1. <?php
  2. namespace PhpOffice\PhpSpreadsheetTests\Shared;
  3. use PhpOffice\PhpSpreadsheet\Shared\OLERead;
  4. use PHPUnit\Framework\TestCase;
  5. class OLEReadTest extends TestCase
  6. {
  7. public function testReadOleStreams(): void
  8. {
  9. $dataDir = 'tests/data/Shared/OLERead/';
  10. $ole = new OLERead();
  11. $ole->read('tests/data/Reader/XLS/sample.xls');
  12. self::assertEquals(
  13. file_get_contents($dataDir . 'wrkbook'),
  14. $ole->getStream($ole->wrkbook)
  15. );
  16. self::assertEquals(
  17. file_get_contents($dataDir . 'summary'),
  18. $ole->getStream($ole->summaryInformation)
  19. );
  20. self::assertEquals(
  21. file_get_contents($dataDir . 'document'),
  22. $ole->getStream($ole->documentSummaryInformation)
  23. );
  24. }
  25. }