diff --git a/.gitattributes b/.gitattributes index 71c67f90..0c5a7de8 100644 --- a/.gitattributes +++ b/.gitattributes @@ -3,6 +3,7 @@ /tools export-ignore /tests/benchmarks export-ignore +/tests/data export-ignore .gitattributes export-ignore .gitignore export-ignore .editorconfig export-ignore diff --git a/tests/TestCase.php b/tests/TestCase.php index 766a90a4..04844bdd 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -15,6 +15,7 @@ use PhpMyAdmin\SqlParser\Translator; use PHPUnit\Framework\TestCase as BaseTestCase; +use function file_exists; use function file_get_contents; use function str_contains; use function strpos; @@ -93,6 +94,10 @@ public function getErrorsAsArray($obj): array */ public function getData(string $name): array { + if (! file_exists('tests/data/' . $name . '.out')) { + self::markTestSkipped('Test data not available.'); + } + $serializedData = file_get_contents('tests/data/' . $name . '.out'); $this->assertIsString($serializedData);