mirror of
https://code.mensbeam.com/MensBeam/Arsse.git
synced 2025-01-09 01:12:41 +00:00
CS fixes and version bump
This commit is contained in:
parent
34b508171b
commit
cbc9491f75
11 changed files with 26 additions and 28 deletions
|
@ -7,7 +7,7 @@ declare(strict_types=1);
|
||||||
namespace JKingWeb\Arsse;
|
namespace JKingWeb\Arsse;
|
||||||
|
|
||||||
class Arsse {
|
class Arsse {
|
||||||
const VERSION = "0.2.1";
|
const VERSION = "0.3.0";
|
||||||
|
|
||||||
/** @var Lang */
|
/** @var Lang */
|
||||||
public static $lang;
|
public static $lang;
|
||||||
|
|
|
@ -6,7 +6,6 @@
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
namespace JKingWeb\Arsse;
|
namespace JKingWeb\Arsse;
|
||||||
|
|
||||||
|
|
||||||
use JKingWeb\Arsse\Arsse;
|
use JKingWeb\Arsse\Arsse;
|
||||||
use Psr\Http\Message\RequestInterface;
|
use Psr\Http\Message\RequestInterface;
|
||||||
use Psr\Http\Message\ServerRequestInterface;
|
use Psr\Http\Message\ServerRequestInterface;
|
||||||
|
|
|
@ -9,7 +9,6 @@ namespace JKingWeb\Arsse\TestCase\Lang;
|
||||||
use JKingWeb\Arsse\Lang as TestClass;
|
use JKingWeb\Arsse\Lang as TestClass;
|
||||||
use org\bovigo\vfs\vfsStream;
|
use org\bovigo\vfs\vfsStream;
|
||||||
|
|
||||||
|
|
||||||
/** @covers \JKingWeb\Arsse\Lang */
|
/** @covers \JKingWeb\Arsse\Lang */
|
||||||
class TestBasic extends \JKingWeb\Arsse\Test\AbstractTest {
|
class TestBasic extends \JKingWeb\Arsse\Test\AbstractTest {
|
||||||
use \JKingWeb\Arsse\Test\Lang\Setup;
|
use \JKingWeb\Arsse\Test\Lang\Setup;
|
||||||
|
|
|
@ -14,7 +14,7 @@ class TestDate extends \JKingWeb\Arsse\Test\AbstractTest {
|
||||||
$this->clearData();
|
$this->clearData();
|
||||||
}
|
}
|
||||||
|
|
||||||
function testNormalizeADate() {
|
public function testNormalizeADate() {
|
||||||
$exp = new \DateTimeImmutable("2018-01-01T00:00:00Z");
|
$exp = new \DateTimeImmutable("2018-01-01T00:00:00Z");
|
||||||
$this->assertEquals($exp, Date::normalize(1514764800));
|
$this->assertEquals($exp, Date::normalize(1514764800));
|
||||||
$this->assertEquals($exp, Date::normalize("2018-01-01T00:00:00"));
|
$this->assertEquals($exp, Date::normalize("2018-01-01T00:00:00"));
|
||||||
|
@ -26,7 +26,7 @@ class TestDate extends \JKingWeb\Arsse\Test\AbstractTest {
|
||||||
$this->assertNull(Date::normalize("2018-01-01T00:00:00Z", "http"));
|
$this->assertNull(Date::normalize("2018-01-01T00:00:00Z", "http"));
|
||||||
}
|
}
|
||||||
|
|
||||||
function testFormatADate() {
|
public function testFormatADate() {
|
||||||
$test = new \DateTimeImmutable("2018-01-01T00:00:00Z");
|
$test = new \DateTimeImmutable("2018-01-01T00:00:00Z");
|
||||||
$this->assertNull(Date::transform(null, "http"));
|
$this->assertNull(Date::transform(null, "http"));
|
||||||
$this->assertNull(Date::transform("ook", "http"));
|
$this->assertNull(Date::transform("ook", "http"));
|
||||||
|
@ -40,7 +40,7 @@ class TestDate extends \JKingWeb\Arsse\Test\AbstractTest {
|
||||||
$this->assertSame(1514764800.265579, Date::transform("2018-01-01T00:00:00.265579Z", "float", "iso8601m"));
|
$this->assertSame(1514764800.265579, Date::transform("2018-01-01T00:00:00.265579Z", "float", "iso8601m"));
|
||||||
}
|
}
|
||||||
|
|
||||||
function testMoveDateForward() {
|
public function testMoveDateForward() {
|
||||||
$test = new \DateTimeImmutable("2018-01-01T00:00:00Z");
|
$test = new \DateTimeImmutable("2018-01-01T00:00:00Z");
|
||||||
$this->assertNull(Date::add("P1D", null));
|
$this->assertNull(Date::add("P1D", null));
|
||||||
$this->assertNull(Date::add("P1D", "ook"));
|
$this->assertNull(Date::add("P1D", "ook"));
|
||||||
|
@ -49,7 +49,7 @@ class TestDate extends \JKingWeb\Arsse\Test\AbstractTest {
|
||||||
$this->assertNull(Date::add("ook", $test));
|
$this->assertNull(Date::add("ook", $test));
|
||||||
}
|
}
|
||||||
|
|
||||||
function testMoveDateBack() {
|
public function testMoveDateBack() {
|
||||||
$test = new \DateTimeImmutable("2018-01-01T00:00:00Z");
|
$test = new \DateTimeImmutable("2018-01-01T00:00:00Z");
|
||||||
$this->assertNull(Date::sub("P1D", null));
|
$this->assertNull(Date::sub("P1D", null));
|
||||||
$this->assertNull(Date::sub("P1D", "ook"));
|
$this->assertNull(Date::sub("P1D", "ook"));
|
||||||
|
|
|
@ -322,11 +322,11 @@ class TestREST extends \JKingWeb\Arsse\Test\AbstractTest {
|
||||||
|
|
||||||
public function provideMockRequests() {
|
public function provideMockRequests() {
|
||||||
return [
|
return [
|
||||||
[new ServerRequest([], [], "/index.php/apps/news/api/v1-2/feeds", "GET"), "GET", true, NCN::Class, "/feeds"],
|
[new ServerRequest([], [], "/index.php/apps/news/api/v1-2/feeds", "GET"), "GET", true, NCN::class, "/feeds"],
|
||||||
[new ServerRequest([], [], "/index.php/apps/news/api/v1-2/feeds", "HEAD"), "GET", true, NCN::Class, "/feeds"],
|
[new ServerRequest([], [], "/index.php/apps/news/api/v1-2/feeds", "HEAD"), "GET", true, NCN::class, "/feeds"],
|
||||||
[new ServerRequest([], [], "/index.php/apps/news/api/v1-2/feeds", "get"), "GET", true, NCN::Class, "/feeds"],
|
[new ServerRequest([], [], "/index.php/apps/news/api/v1-2/feeds", "get"), "GET", true, NCN::class, "/feeds"],
|
||||||
[new ServerRequest([], [], "/index.php/apps/news/api/v1-2/feeds", "head"), "GET", true, NCN::Class, "/feeds"],
|
[new ServerRequest([], [], "/index.php/apps/news/api/v1-2/feeds", "head"), "GET", true, NCN::class, "/feeds"],
|
||||||
[new ServerRequest([], [], "/tt-rss/api/", "POST"), "POST", true, TTRSS::Class, "/"],
|
[new ServerRequest([], [], "/tt-rss/api/", "POST"), "POST", true, TTRSS::class, "/"],
|
||||||
[new ServerRequest([], [], "/no/such/api/", "HEAD"), "GET", false],
|
[new ServerRequest([], [], "/no/such/api/", "HEAD"), "GET", false],
|
||||||
[new ServerRequest([], [], "/no/such/api/", "GET"), "GET", false],
|
[new ServerRequest([], [], "/no/such/api/", "GET"), "GET", false],
|
||||||
];
|
];
|
||||||
|
|
Loading…
Reference in a new issue