From 7a23cadd415c34e7fef5e9f00cf6f51084178953 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maur=C3=ADcio=20Meneghini=20Fauth?= Date: Tue, 1 Apr 2025 14:22:51 -0300 Subject: [PATCH] Ignore E2E test data for Git export MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Fixes https://github.com/phpmyadmin/sql-parser/issues/621 Signed-off-by: MaurĂ­cio Meneghini Fauth --- .gitattributes | 1 + tests/TestCase.php | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/.gitattributes b/.gitattributes index 71c67f909..0c5a7de80 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 766a90a4e..04844bdd9 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);