mirror of
https://code.mensbeam.com/MensBeam/Arsse.git
synced 2024-12-22 21:22:40 +00:00
Tweak
This commit is contained in:
parent
77793f95cb
commit
65b08d1735
3 changed files with 25 additions and 26 deletions
|
@ -8,17 +8,5 @@ namespace JKingWeb\Arsse\TestCase\REST\NextCloudNews\PDO;
|
||||||
|
|
||||||
/** @covers \JKingWeb\Arsse\REST\NextCloudNews\V1_2<extended> */
|
/** @covers \JKingWeb\Arsse\REST\NextCloudNews\V1_2<extended> */
|
||||||
class TestV1_2 extends \JKingWeb\Arsse\TestCase\REST\NextCloudNews\TestV1_2 {
|
class TestV1_2 extends \JKingWeb\Arsse\TestCase\REST\NextCloudNews\TestV1_2 {
|
||||||
protected function v($value) {
|
use \JKingWeb\Arsse\Test\PDOTest;
|
||||||
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;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,17 +9,5 @@ namespace JKingWeb\Arsse\TestCase\REST\TinyTinyRSS\PDO;
|
||||||
/** @covers \JKingWeb\Arsse\REST\TinyTinyRSS\API<extended>
|
/** @covers \JKingWeb\Arsse\REST\TinyTinyRSS\API<extended>
|
||||||
* @covers \JKingWeb\Arsse\REST\TinyTinyRSS\Exception */
|
* @covers \JKingWeb\Arsse\REST\TinyTinyRSS\Exception */
|
||||||
class TestAPI extends \JKingWeb\Arsse\TestCase\REST\TinyTinyRSS\TestAPI {
|
class TestAPI extends \JKingWeb\Arsse\TestCase\REST\TinyTinyRSS\TestAPI {
|
||||||
protected function v($value) {
|
use \JKingWeb\Arsse\Test\PDOTest;
|
||||||
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;
|
|
||||||
}
|
|
||||||
}
|
}
|
23
tests/lib/PDOTest.php
Normal file
23
tests/lib/PDOTest.php
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
<?php
|
||||||
|
/** @license MIT
|
||||||
|
* Copyright 2017 J. King, Dustin Wilson et al.
|
||||||
|
* See LICENSE and AUTHORS files for details */
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
namespace JKingWeb\Arsse\Test;
|
||||||
|
|
||||||
|
trait PDOTest {
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue