mirror of
https://github.com/PHPOffice/PhpSpreadsheet.git
synced 2026-09-14 20:16:34 +00:00
Use OLE stream lookup in root test
This commit is contained in:
@@ -202,7 +202,7 @@ class OLEPpsRootTest extends TestCase
|
||||
$ole->read($path);
|
||||
self::assertSame(2, $ole->ppsTotal());
|
||||
self::assertTrue($ole->isFile(1));
|
||||
self::assertSame($data, self::getDataByName($ole, 'BoundaryStream'));
|
||||
self::assertSame($data, $ole->getDataByName('BoundaryStream'));
|
||||
} finally {
|
||||
fclose($file);
|
||||
}
|
||||
@@ -217,15 +217,4 @@ class OLEPpsRootTest extends TestCase
|
||||
|
||||
return $value['value'];
|
||||
}
|
||||
|
||||
private static function getDataByName(OLE $ole, string $name): string
|
||||
{
|
||||
foreach ($ole->_list as $index => $pps) {
|
||||
if ($pps->Type === OLE::OLE_PPS_TYPE_FILE && $pps->Name === $name) {
|
||||
return $ole->getData($index, 0, $pps->Size);
|
||||
}
|
||||
}
|
||||
|
||||
self::fail("OLE stream '$name' was not found.");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user