mirror of
https://github.com/PHPOffice/PhpSpreadsheet.git
synced 2026-09-04 14:38:16 +00:00
Fix SettingsTest
SettingsTest was changing the global LibXMLLoaderOptions without restoring the original. This caused problems for one of my new tests.
This commit is contained in:
@@ -41,6 +41,7 @@ class SettingsTest extends TestCase
|
||||
|
||||
public function testSetXMLSettings(): void
|
||||
{
|
||||
$original = Settings::getLibXmlLoaderOptions();
|
||||
Settings::setLibXmlLoaderOptions(LIBXML_DTDLOAD | LIBXML_DTDATTR | LIBXML_DTDVALID);
|
||||
$result = Settings::getLibXmlLoaderOptions();
|
||||
self::assertTrue((bool) ((LIBXML_DTDLOAD | LIBXML_DTDATTR | LIBXML_DTDVALID) & $result));
|
||||
@@ -48,5 +49,6 @@ class SettingsTest extends TestCase
|
||||
if (\PHP_VERSION_ID < 80000) {
|
||||
self::assertFalse(libxml_disable_entity_loader());
|
||||
}
|
||||
Settings::setLibXmlLoaderOptions($original);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,18 +9,6 @@ use PhpOffice\PhpSpreadsheetTests\Functional\AbstractFunctional;
|
||||
class PasswordReloadTest extends AbstractFunctional
|
||||
{
|
||||
/**
|
||||
* I don't know why separate process is needed for this test.
|
||||
* I get a weird error without it, and I would rather just scrap the test
|
||||
* than spend any more time debugging it.
|
||||
* The test works fine without separate process (on Windows) with:
|
||||
* php vendor\phpunit\phpunit\phpunit tests\PhpSpreadsheetTests\Shared\
|
||||
* But it fails with:
|
||||
* php vendor\phpunit\phpunit\phpunit tests\PhpSpreadsheetTests\
|
||||
* The error is a mysterious:
|
||||
* simplexml_load_string(): validity error : Validation failed: no DTD found !
|
||||
*
|
||||
* @runInSeparateProcess
|
||||
* @preserveGlobalState disabled
|
||||
* @dataProvider providerPasswords
|
||||
*/
|
||||
public function testPasswordReload(string $format, string $algorithm, bool $supported = true): void
|
||||
|
||||
Reference in New Issue
Block a user