diff --git a/tests/cases/REST/NextCloudNews/PDO/TestV1_2.php b/tests/cases/REST/NextCloudNews/PDO/TestV1_2.php index ecf4fb74..c6a3ef77 100644 --- a/tests/cases/REST/NextCloudNews/PDO/TestV1_2.php +++ b/tests/cases/REST/NextCloudNews/PDO/TestV1_2.php @@ -8,17 +8,5 @@ namespace JKingWeb\Arsse\TestCase\REST\NextCloudNews\PDO; /** @covers \JKingWeb\Arsse\REST\NextCloudNews\V1_2 */ class TestV1_2 extends \JKingWeb\Arsse\TestCase\REST\NextCloudNews\TestV1_2 { - protected function v($value) { - if (!is_array($value)) { - return $value; - } - foreach($value as $k => $v) { - if (is_array($v)) { - $value[$k] = $this->v($v); - } elseif (is_int($v) || is_float($v)) { - $value[$k] = (string) $v; - } - } - return $value; - } + use \JKingWeb\Arsse\Test\PDOTest; } diff --git a/tests/cases/REST/TinyTinyRSS/PDO/TestAPI.php b/tests/cases/REST/TinyTinyRSS/PDO/TestAPI.php index 7586eee1..9c9e36f1 100644 --- a/tests/cases/REST/TinyTinyRSS/PDO/TestAPI.php +++ b/tests/cases/REST/TinyTinyRSS/PDO/TestAPI.php @@ -9,17 +9,5 @@ namespace JKingWeb\Arsse\TestCase\REST\TinyTinyRSS\PDO; /** @covers \JKingWeb\Arsse\REST\TinyTinyRSS\API * @covers \JKingWeb\Arsse\REST\TinyTinyRSS\Exception */ class TestAPI extends \JKingWeb\Arsse\TestCase\REST\TinyTinyRSS\TestAPI { - protected function v($value) { - if (!is_array($value)) { - return $value; - } - foreach($value as $k => $v) { - if (is_array($v)) { - $value[$k] = $this->v($v); - } elseif (is_int($v) || is_float($v)) { - $value[$k] = (string) $v; - } - } - return $value; - } + use \JKingWeb\Arsse\Test\PDOTest; } \ No newline at end of file diff --git a/tests/lib/PDOTest.php b/tests/lib/PDOTest.php new file mode 100644 index 00000000..3013734f --- /dev/null +++ b/tests/lib/PDOTest.php @@ -0,0 +1,23 @@ + $v) { + if (is_array($v)) { + $value[$k] = $this->v($v); + } elseif (is_int($v) || is_float($v)) { + $value[$k] = (string) $v; + } + } + return $value; + } +} \ No newline at end of file