From: James Valleroy <jvalleroy@mailbox.org>
Date: Sat, 8 Jul 2023 13:05:36 -0400
Subject: Rename AbstractTest to AbstractTestCase for phpunit 10

---
 tests/AbstractTest.php          | 96 -----------------------------------------
 tests/AbstractTestCase.php      | 96 +++++++++++++++++++++++++++++++++++++++++
 tests/AssetsTest.php            |  2 +-
 tests/LocalesTest.php           |  2 +-
 tests/MergeEntriesTest.php      |  2 +-
 tests/MergeHeadersTest.php      |  2 +-
 tests/MergeTranslationsTest.php |  2 +-
 tests/StringsTest.php           |  2 +-
 tests/TranslationTest.php       |  2 +-
 tests/TranslationsTest.php      |  2 +-
 tests/TranslatorTest.php        |  2 +-
 11 files changed, 105 insertions(+), 105 deletions(-)
 delete mode 100644 tests/AbstractTest.php
 create mode 100644 tests/AbstractTestCase.php

diff --git a/tests/AbstractTest.php b/tests/AbstractTest.php
deleted file mode 100644
index 0134a83..0000000
--- a/tests/AbstractTest.php
+++ /dev/null
@@ -1,96 +0,0 @@
-<?php
-
-namespace Gettext\Tests;
-
-use Gettext\Translations;
-use PHPUnit\Framework\TestCase;
-
-abstract class AbstractTest extends TestCase
-{
-    protected static $ext = [
-        'Blade' => 'php',
-        'Csv' => 'csv',
-        'CsvDictionary' => 'csv',
-        'Jed' => 'json',
-        'JsCode' => 'js',
-        'JsonDictionary' => 'json',
-        'Json' => 'json',
-        'Mo' => 'mo',
-        'PhpArray' => 'php',
-        'PhpCode' => 'php',
-        'Po' => 'po',
-        'Xliff' => 'xlf',
-        'Yaml' => 'yml',
-        'YamlDictionary' => 'yml',
-        'VueJs' => 'vue',
-    ];
-
-    protected static function asset($file)
-    {
-        return './tests/assets/'.$file;
-    }
-
-    /**
-     * @param string $file
-     * @param string|null $format
-     * @param array $options
-     * @return Translations
-     */
-    protected static function get($file, $format = null, array $options = [])
-    {
-        if ($format === null) {
-            $format = basename($file);
-        }
-
-        $method = "from{$format}File";
-        $file = static::asset($file.'.'.static::$ext[$format]);
-
-        return Translations::$method($file, $options);
-    }
-
-    protected function assertContent(Translations $translations, $file, $format = null)
-    {
-        if ($format === null) {
-            $format = basename($file);
-        }
-
-        $method = "to{$format}String";
-        $content = file_get_contents(static::asset($file.'.'.static::$ext[$format]));
-
-        // Po reference files are LittleEndian
-        if ($format !== 'Mo' || self::isLittleEndian()) {
-            $this->assertSame($content, $translations->$method(), $file);
-        }
-    }
-
-    protected static function saveContent(Translations $translations, $file, $format = null)
-    {
-        if ($format === null) {
-            $format = basename($file);
-        }
-
-        $method = "to{$format}String";
-        $file = static::asset($file.'.'.static::$ext[$format]);
-
-        file_put_contents($file, $translations->$method());
-    }
-
-    protected function runTestFormat($file, $countTranslations, $countTranslated = 0, $countHeaders = 8)
-    {
-        $format = basename($file);
-        $method = "from{$format}File";
-
-        /** @var Translations $translations */
-        $translations = Translations::$method(static::asset($file.'.'.static::$ext[$format]));
-
-        $this->assertCount($countTranslations, $translations);
-        $this->assertCount($countHeaders, $translations->getHeaders(), json_encode($translations->getHeaders(), JSON_PRETTY_PRINT));
-        $this->assertSame($countTranslated, $translations->countTranslated());
-        $this->assertContent($translations, $file);
-    }
-
-    protected function isLittleEndian()
-    {
-        return pack("s", 0x3031) === "10";
-    }
-}
diff --git a/tests/AbstractTestCase.php b/tests/AbstractTestCase.php
new file mode 100644
index 0000000..cf42ca3
--- /dev/null
+++ b/tests/AbstractTestCase.php
@@ -0,0 +1,96 @@
+<?php
+
+namespace Gettext\Tests;
+
+use Gettext\Translations;
+use PHPUnit\Framework\TestCase;
+
+abstract class AbstractTestCase extends TestCase
+{
+    protected static $ext = [
+        'Blade' => 'php',
+        'Csv' => 'csv',
+        'CsvDictionary' => 'csv',
+        'Jed' => 'json',
+        'JsCode' => 'js',
+        'JsonDictionary' => 'json',
+        'Json' => 'json',
+        'Mo' => 'mo',
+        'PhpArray' => 'php',
+        'PhpCode' => 'php',
+        'Po' => 'po',
+        'Xliff' => 'xlf',
+        'Yaml' => 'yml',
+        'YamlDictionary' => 'yml',
+        'VueJs' => 'vue',
+    ];
+
+    protected static function asset($file)
+    {
+        return './tests/assets/'.$file;
+    }
+
+    /**
+     * @param string $file
+     * @param string|null $format
+     * @param array $options
+     * @return Translations
+     */
+    protected static function get($file, $format = null, array $options = [])
+    {
+        if ($format === null) {
+            $format = basename($file);
+        }
+
+        $method = "from{$format}File";
+        $file = static::asset($file.'.'.static::$ext[$format]);
+
+        return Translations::$method($file, $options);
+    }
+
+    protected function assertContent(Translations $translations, $file, $format = null)
+    {
+        if ($format === null) {
+            $format = basename($file);
+        }
+
+        $method = "to{$format}String";
+        $content = file_get_contents(static::asset($file.'.'.static::$ext[$format]));
+
+        // Po reference files are LittleEndian
+        if ($format !== 'Mo' || self::isLittleEndian()) {
+            $this->assertSame($content, $translations->$method(), $file);
+        }
+    }
+
+    protected static function saveContent(Translations $translations, $file, $format = null)
+    {
+        if ($format === null) {
+            $format = basename($file);
+        }
+
+        $method = "to{$format}String";
+        $file = static::asset($file.'.'.static::$ext[$format]);
+
+        file_put_contents($file, $translations->$method());
+    }
+
+    protected function runTestFormat($file, $countTranslations, $countTranslated = 0, $countHeaders = 8)
+    {
+        $format = basename($file);
+        $method = "from{$format}File";
+
+        /** @var Translations $translations */
+        $translations = Translations::$method(static::asset($file.'.'.static::$ext[$format]));
+
+        $this->assertCount($countTranslations, $translations);
+        $this->assertCount($countHeaders, $translations->getHeaders(), json_encode($translations->getHeaders(), JSON_PRETTY_PRINT));
+        $this->assertSame($countTranslated, $translations->countTranslated());
+        $this->assertContent($translations, $file);
+    }
+
+    protected function isLittleEndian()
+    {
+        return pack("s", 0x3031) === "10";
+    }
+}
diff --git a/tests/AssetsTest.php b/tests/AssetsTest.php
index c836051..e36c079 100644
--- a/tests/AssetsTest.php
+++ b/tests/AssetsTest.php
@@ -6,7 +6,7 @@ use Gettext\Extractors\PhpCode;
 use Gettext\Extractors\VueJs;
 use Gettext\Translations;
 
-class AssetsTest extends AbstractTest
+class AssetsTest extends AbstractTestCase
 {
     public function testPo()
     {
diff --git a/tests/LocalesTest.php b/tests/LocalesTest.php
index 8b4191a..f2c23f2 100644
--- a/tests/LocalesTest.php
+++ b/tests/LocalesTest.php
@@ -4,7 +4,7 @@ namespace Gettext\Tests;
 
 use Gettext\Translations;
 
-class LocalesTest extends AbstractTest
+class LocalesTest extends AbstractTestCase
 {
     public function testPlurals()
     {
diff --git a/tests/MergeEntriesTest.php b/tests/MergeEntriesTest.php
index 5f5c381..081ad23 100644
--- a/tests/MergeEntriesTest.php
+++ b/tests/MergeEntriesTest.php
@@ -5,7 +5,7 @@ namespace Gettext\Tests;
 use Gettext\Translations;
 use Gettext\Merge;
 
-class MergeEntriesTest extends AbstractTest
+class MergeEntriesTest extends AbstractTestCase
 {
     protected $t1;
     protected $t2;
diff --git a/tests/MergeHeadersTest.php b/tests/MergeHeadersTest.php
index 1f02c95..6d3317e 100644
--- a/tests/MergeHeadersTest.php
+++ b/tests/MergeHeadersTest.php
@@ -5,7 +5,7 @@ namespace Gettext\Tests;
 use Gettext\Translations;
 use Gettext\Merge;
 
-class MergeHeadersTest extends AbstractTest
+class MergeHeadersTest extends AbstractTestCase
 {
     protected $t1;
     protected $t2;
diff --git a/tests/MergeTranslationsTest.php b/tests/MergeTranslationsTest.php
index 1726f61..210f327 100644
--- a/tests/MergeTranslationsTest.php
+++ b/tests/MergeTranslationsTest.php
@@ -5,7 +5,7 @@ namespace Gettext\Tests;
 use Gettext\Translation;
 use Gettext\Merge;
 
-class MergeTranslationsTest extends AbstractTest
+class MergeTranslationsTest extends AbstractTestCase
 {
     protected $t1;
     protected $t2;
diff --git a/tests/StringsTest.php b/tests/StringsTest.php
index 9fe0bd2..bc60b05 100644
--- a/tests/StringsTest.php
+++ b/tests/StringsTest.php
@@ -5,7 +5,7 @@ namespace Gettext\Tests;
 use Gettext\Extractors;
 use Gettext\Generators;
 
-class StringsTest extends AbstractTest
+class StringsTest extends AbstractTestCase
 {
     public function stringFromPhpProvider()
     {
diff --git a/tests/TranslationTest.php b/tests/TranslationTest.php
index 63e84d4..4f484d0 100644
--- a/tests/TranslationTest.php
+++ b/tests/TranslationTest.php
@@ -5,7 +5,7 @@ namespace Gettext\Tests;
 use Gettext\Translation;
 use Gettext\Translations;
 
-class TranslationTest extends AbstractTest
+class TranslationTest extends AbstractTestCase
 {
     public function testReferences()
     {
diff --git a/tests/TranslationsTest.php b/tests/TranslationsTest.php
index 8421c7e..cb6bd90 100644
--- a/tests/TranslationsTest.php
+++ b/tests/TranslationsTest.php
@@ -5,7 +5,7 @@ namespace Gettext\Tests;
 use Gettext\Translation;
 use Gettext\Translations;
 
-class TranslationsTest extends AbstractTest
+class TranslationsTest extends AbstractTestCase
 {
     public function testClone()
     {
diff --git a/tests/TranslatorTest.php b/tests/TranslatorTest.php
index 6867ec0..68a7d49 100755
--- a/tests/TranslatorTest.php
+++ b/tests/TranslatorTest.php
@@ -7,7 +7,7 @@ use Gettext\Translations;
 use Gettext\Translation;
 use Gettext\Translator;
 
-class TranslatorTest extends AbstractTest
+class TranslatorTest extends AbstractTestCase
 {
     public function testNoop()
     {
