Possibly Acceptable

This commit is contained in:
oleibman
2026-07-12 03:20:25 -07:00
parent 40bdbb3c90
commit dc455c45f9
@@ -2,6 +2,7 @@
namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\Web;
use Exception;
use PhpOffice\PhpSpreadsheet\Reader\Xlsx as XlsxReader;
use PhpOffice\PhpSpreadsheet\Spreadsheet;
use PHPUnit\Framework\TestCase;
@@ -33,14 +34,22 @@ class ServerTest extends TestCase
self::$httpServer->stop();
}
public function testServer(): void
public function xtestServer(): void
{
var_dump(ini_get('allow_url_fopen'));
self::assertSame(self::NEWVALUE, file_get_contents(self::DIRECT));
self::assertSame(self::NEWVALUE, file_get_contents(self::REDIRECT));
try {
self::assertSame(self::NEWVALUE, file_get_contents(self::DIRECT));
self::assertSame(self::NEWVALUE, file_get_contents(self::REDIRECT));
} catch (Exception $e) {
$message = $e->getMessage();
if (str_contains($message, 'Connection refused')) {
self::markTestSkipped('Unable to use web server');
}
throw $e;
}
}
public function testReadFile(): void
public function xtestReadFile(): void
{
$reader = new XlsxReader();
$spreadsheet = $reader->load(__DIR__ . '/redirect.xlsx');
@@ -52,7 +61,7 @@ class ServerTest extends TestCase
self::assertSame(self::OLDVALUE, $sheet->getCell('A2')->getCalculatedValue(), 'redirect so use old computed');
}
public static function testNew(): void
public function xtestNew(): void
{
$spreadsheet = new Spreadsheet();
$spreadsheet->setDomainWhiteList(['localhost']);
@@ -67,4 +76,11 @@ class ServerTest extends TestCase
'redirect so not computed'
);
}
public function testAll(): void
{
$this->xtestServer();
$this->xtestReadFile();
$this->xtestNew();
}
}