From 65b08d173519bb3b21a0e8b2907c415cbe502441 Mon Sep 17 00:00:00 2001 From: "J. King" Date: Sun, 31 Dec 2017 17:30:30 -0500 Subject: [PATCH] Tweak --- .../cases/REST/NextCloudNews/PDO/TestV1_2.php | 14 +---------- tests/cases/REST/TinyTinyRSS/PDO/TestAPI.php | 14 +---------- tests/lib/PDOTest.php | 23 +++++++++++++++++++ 3 files changed, 25 insertions(+), 26 deletions(-) create mode 100644 tests/lib/PDOTest.php diff --git a/tests/cases/REST/NextCloudNews/PDO/TestV1_2.php b/tests/cases/REST/NextCloudNews/PDO/TestV1_2.php index ecf4fb7..c6a3ef7 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 7586eee..9c9e36f 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 0000000..3013734 --- /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