mirror of
https://github.com/PHPOffice/PhpSpreadsheet.git
synced 2026-08-31 12:40:00 +00:00
Possibly Acceptable
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user