Use OLE stream lookup in root test

This commit is contained in:
^^
2026-09-10 10:36:25 +08:00
parent 8048278aef
commit 6dbce4e451
@@ -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.");
}
}