From cc80d278a6dae5648a602590d8add4df7d2a072c Mon Sep 17 00:00:00 2001 From: Damien Lagae Date: Sat, 27 Jan 2024 20:08:08 +0100 Subject: [PATCH] :bug: Fix test --- tests/Unit/XliffConverterTest.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/Unit/XliffConverterTest.php b/tests/Unit/XliffConverterTest.php index c7ffb66..b43d84b 100644 --- a/tests/Unit/XliffConverterTest.php +++ b/tests/Unit/XliffConverterTest.php @@ -36,6 +36,11 @@ public function testCatalogueToContent() $catalogue->add(['foobar' => 'bar']); $content = XliffConverter::catalogueToContent($catalogue, 'messages'); - $this->assertMatchesRegularExpression('/foobar/', $content); + // If PHPUnit 9.0 or higher is used, use assertMatchesRegularExpression() instead + if (method_exists($this, 'assertMatchesRegularExpression')) { + $this->assertMatchesRegularExpression('/foobar/', $content); + } else { + $this->assertRegExp('|foobar|', $content); + } } }