aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--composer.json5
-rw-r--r--tests/Actions/ActionImplementationTest.php (renamed from tests/ActionImplementationTest.php)6
-rw-r--r--tests/Actions/ListActionTest.php (renamed from tests/ListActionTest.php)4
-rw-r--r--tests/Bridges/BridgeImplementationTest.php (renamed from tests/BridgeImplementationTest.php)8
-rw-r--r--tests/Caches/CacheImplementationTest.php (renamed from tests/CacheImplementationTest.php)5
-rw-r--r--tests/Formats/AtomFormatTest.php (renamed from tests/AtomFormatTest.php)3
-rw-r--r--tests/Formats/FormatImplementationTest.php (renamed from tests/FormatImplementationTest.php)0
-rw-r--r--tests/Formats/JsonFormatTest.php (renamed from tests/JsonFormatTest.php)4
-rw-r--r--tests/Formats/MrssFormatTest.php (renamed from tests/MrssFormatTest.php)3
-rw-r--r--tests/Formats/samples/expectedAtomFormat/feed.common.xml (renamed from tests/samples/expectedAtomFormat/feed.common.xml)0
-rw-r--r--tests/Formats/samples/expectedAtomFormat/feed.empty.xml (renamed from tests/samples/expectedAtomFormat/feed.empty.xml)0
-rw-r--r--tests/Formats/samples/expectedAtomFormat/feed.emptyItems.xml (renamed from tests/samples/expectedAtomFormat/feed.emptyItems.xml)0
-rw-r--r--tests/Formats/samples/expectedAtomFormat/feed.microblog.xml (renamed from tests/samples/expectedAtomFormat/feed.microblog.xml)0
-rw-r--r--tests/Formats/samples/expectedJsonFormat/feed.common.json (renamed from tests/samples/expectedJsonFormat/feed.common.json)0
-rw-r--r--tests/Formats/samples/expectedJsonFormat/feed.empty.json (renamed from tests/samples/expectedJsonFormat/feed.empty.json)0
-rw-r--r--tests/Formats/samples/expectedJsonFormat/feed.emptyItems.json (renamed from tests/samples/expectedJsonFormat/feed.emptyItems.json)0
-rw-r--r--tests/Formats/samples/expectedJsonFormat/feed.microblog.json (renamed from tests/samples/expectedJsonFormat/feed.microblog.json)0
-rw-r--r--tests/Formats/samples/expectedMrssFormat/feed.common.xml (renamed from tests/samples/expectedMrssFormat/feed.common.xml)0
-rw-r--r--tests/Formats/samples/expectedMrssFormat/feed.empty.xml (renamed from tests/samples/expectedMrssFormat/feed.empty.xml)0
-rw-r--r--tests/Formats/samples/expectedMrssFormat/feed.emptyItems.xml (renamed from tests/samples/expectedMrssFormat/feed.emptyItems.xml)0
-rw-r--r--tests/Formats/samples/expectedMrssFormat/feed.microblog.xml (renamed from tests/samples/expectedMrssFormat/feed.microblog.xml)0
-rw-r--r--tests/Formats/samples/feed.common.json (renamed from tests/samples/feed.common.json)0
-rw-r--r--tests/Formats/samples/feed.empty.json (renamed from tests/samples/feed.empty.json)0
-rw-r--r--tests/Formats/samples/feed.emptyItems.json (renamed from tests/samples/feed.emptyItems.json)0
-rw-r--r--tests/Formats/samples/feed.microblog.json (renamed from tests/samples/feed.microblog.json)0
25 files changed, 34 insertions, 4 deletions
diff --git a/composer.json b/composer.json
index 5243f583..c6b1b378 100644
--- a/composer.json
+++ b/composer.json
@@ -39,6 +39,11 @@
"ext-sqlite3": "Allows to use an SQLite database for caching",
"ext-dom": "Allows to use some bridges based on XPath expressions"
},
+ "autoload-dev": {
+ "psr-4": {
+ "RssBridge\\Tests\\": "tests"
+ }
+ },
"scripts": {
"test": "./vendor/bin/phpunit",
"lint": "./vendor/bin/phpcs --standard=phpcs.xml --warning-severity=0 --extensions=php -p ./",
diff --git a/tests/ActionImplementationTest.php b/tests/Actions/ActionImplementationTest.php
index 7a3c33f5..b10d44e5 100644
--- a/tests/ActionImplementationTest.php
+++ b/tests/Actions/ActionImplementationTest.php
@@ -1,5 +1,9 @@
<?php
+namespace RssBridge\Tests\Actions;
+
+use ActionAbstract;
+use ActionInterface;
use PHPUnit\Framework\TestCase;
class ActionImplementationTest extends TestCase {
@@ -48,7 +52,7 @@ class ActionImplementationTest extends TestCase {
}
private function setAction($path) {
- $this->class = basename($path, '.php');
+ $this->class = '\\' . basename($path, '.php');
$this->assertTrue(class_exists($this->class), 'class ' . $this->class . ' doesn\'t exist');
$this->obj = new $this->class();
}
diff --git a/tests/ListActionTest.php b/tests/Actions/ListActionTest.php
index e914b7d3..e5ef9570 100644
--- a/tests/ListActionTest.php
+++ b/tests/Actions/ListActionTest.php
@@ -1,5 +1,9 @@
<?php
+namespace RssBridge\Tests\Actions;
+
+use ActionFactory;
+use BridgeFactory;
use PHPUnit\Framework\TestCase;
class ListActionTest extends TestCase {
diff --git a/tests/BridgeImplementationTest.php b/tests/Bridges/BridgeImplementationTest.php
index ed512720..14fd3b33 100644
--- a/tests/BridgeImplementationTest.php
+++ b/tests/Bridges/BridgeImplementationTest.php
@@ -1,5 +1,11 @@
<?php
+namespace RssBridge\Tests\Bridges;
+
+use BridgeAbstract;
+use BridgeInterface;
+use FeedExpander;
+use PixivBridge;
use PHPUnit\Framework\TestCase;
class BridgeImplementationTest extends TestCase {
@@ -216,7 +222,7 @@ class BridgeImplementationTest extends TestCase {
}
private function setBridge($path) {
- $this->class = basename($path, '.php');
+ $this->class = '\\' . basename($path, '.php');
$this->assertTrue(class_exists($this->class), 'class ' . $this->class . ' doesn\'t exist');
$this->obj = new $this->class();
}
diff --git a/tests/CacheImplementationTest.php b/tests/Caches/CacheImplementationTest.php
index 1e430998..12018685 100644
--- a/tests/CacheImplementationTest.php
+++ b/tests/Caches/CacheImplementationTest.php
@@ -1,5 +1,8 @@
<?php
+namespace RssBridge\Tests\Caches;
+
+use CacheInterface;
use PHPUnit\Framework\TestCase;
class CacheImplementationTest extends TestCase {
@@ -34,7 +37,7 @@ class CacheImplementationTest extends TestCase {
}
private function setCache($path) {
- $this->class = basename($path, '.php');
+ $this->class = '\\' . basename($path, '.php');
$this->assertTrue(class_exists($this->class), 'class ' . $this->class . ' doesn\'t exist');
}
}
diff --git a/tests/AtomFormatTest.php b/tests/Formats/AtomFormatTest.php
index 1d692c40..73268cb7 100644
--- a/tests/AtomFormatTest.php
+++ b/tests/Formats/AtomFormatTest.php
@@ -4,6 +4,9 @@
* https://tools.ietf.org/html/rfc4287
*/
+namespace RssBridge\Tests\Formats;
+
+use FormatFactory;
use PHPUnit\Framework\TestCase;
class AtomFormatTest extends TestCase {
diff --git a/tests/FormatImplementationTest.php b/tests/Formats/FormatImplementationTest.php
index e4501d68..e4501d68 100644
--- a/tests/FormatImplementationTest.php
+++ b/tests/Formats/FormatImplementationTest.php
diff --git a/tests/JsonFormatTest.php b/tests/Formats/JsonFormatTest.php
index 9b536c18..d99c55b3 100644
--- a/tests/JsonFormatTest.php
+++ b/tests/Formats/JsonFormatTest.php
@@ -3,8 +3,10 @@
* JsonFormat - JSON Feed Version 1
* https://jsonfeed.org/version/1
*/
-require_once __DIR__ . '/../lib/rssbridge.php';
+namespace RssBridge\Tests\Formats;
+
+use FormatFactory;
use PHPUnit\Framework\TestCase;
class JsonFormatTest extends TestCase {
diff --git a/tests/MrssFormatTest.php b/tests/Formats/MrssFormatTest.php
index ed7dc3a3..3becd8eb 100644
--- a/tests/MrssFormatTest.php
+++ b/tests/Formats/MrssFormatTest.php
@@ -5,6 +5,9 @@
* http://www.rssboard.org/media-rss
*/
+namespace RssBridge\Tests\Formats;
+
+use FormatFactory;
use PHPUnit\Framework\TestCase;
class MrssFormatTest extends TestCase {
diff --git a/tests/samples/expectedAtomFormat/feed.common.xml b/tests/Formats/samples/expectedAtomFormat/feed.common.xml
index aa6d0687..aa6d0687 100644
--- a/tests/samples/expectedAtomFormat/feed.common.xml
+++ b/tests/Formats/samples/expectedAtomFormat/feed.common.xml
diff --git a/tests/samples/expectedAtomFormat/feed.empty.xml b/tests/Formats/samples/expectedAtomFormat/feed.empty.xml
index fc04304d..fc04304d 100644
--- a/tests/samples/expectedAtomFormat/feed.empty.xml
+++ b/tests/Formats/samples/expectedAtomFormat/feed.empty.xml
diff --git a/tests/samples/expectedAtomFormat/feed.emptyItems.xml b/tests/Formats/samples/expectedAtomFormat/feed.emptyItems.xml
index 18572fac..18572fac 100644
--- a/tests/samples/expectedAtomFormat/feed.emptyItems.xml
+++ b/tests/Formats/samples/expectedAtomFormat/feed.emptyItems.xml
diff --git a/tests/samples/expectedAtomFormat/feed.microblog.xml b/tests/Formats/samples/expectedAtomFormat/feed.microblog.xml
index 32bc0273..32bc0273 100644
--- a/tests/samples/expectedAtomFormat/feed.microblog.xml
+++ b/tests/Formats/samples/expectedAtomFormat/feed.microblog.xml
diff --git a/tests/samples/expectedJsonFormat/feed.common.json b/tests/Formats/samples/expectedJsonFormat/feed.common.json
index 0b3e97b0..0b3e97b0 100644
--- a/tests/samples/expectedJsonFormat/feed.common.json
+++ b/tests/Formats/samples/expectedJsonFormat/feed.common.json
diff --git a/tests/samples/expectedJsonFormat/feed.empty.json b/tests/Formats/samples/expectedJsonFormat/feed.empty.json
index 6ce49c94..6ce49c94 100644
--- a/tests/samples/expectedJsonFormat/feed.empty.json
+++ b/tests/Formats/samples/expectedJsonFormat/feed.empty.json
diff --git a/tests/samples/expectedJsonFormat/feed.emptyItems.json b/tests/Formats/samples/expectedJsonFormat/feed.emptyItems.json
index 10cc02ae..10cc02ae 100644
--- a/tests/samples/expectedJsonFormat/feed.emptyItems.json
+++ b/tests/Formats/samples/expectedJsonFormat/feed.emptyItems.json
diff --git a/tests/samples/expectedJsonFormat/feed.microblog.json b/tests/Formats/samples/expectedJsonFormat/feed.microblog.json
index 290a16de..290a16de 100644
--- a/tests/samples/expectedJsonFormat/feed.microblog.json
+++ b/tests/Formats/samples/expectedJsonFormat/feed.microblog.json
diff --git a/tests/samples/expectedMrssFormat/feed.common.xml b/tests/Formats/samples/expectedMrssFormat/feed.common.xml
index 38a16f88..38a16f88 100644
--- a/tests/samples/expectedMrssFormat/feed.common.xml
+++ b/tests/Formats/samples/expectedMrssFormat/feed.common.xml
diff --git a/tests/samples/expectedMrssFormat/feed.empty.xml b/tests/Formats/samples/expectedMrssFormat/feed.empty.xml
index 888c42b6..888c42b6 100644
--- a/tests/samples/expectedMrssFormat/feed.empty.xml
+++ b/tests/Formats/samples/expectedMrssFormat/feed.empty.xml
diff --git a/tests/samples/expectedMrssFormat/feed.emptyItems.xml b/tests/Formats/samples/expectedMrssFormat/feed.emptyItems.xml
index 9e712ddd..9e712ddd 100644
--- a/tests/samples/expectedMrssFormat/feed.emptyItems.xml
+++ b/tests/Formats/samples/expectedMrssFormat/feed.emptyItems.xml
diff --git a/tests/samples/expectedMrssFormat/feed.microblog.xml b/tests/Formats/samples/expectedMrssFormat/feed.microblog.xml
index 81dac87a..81dac87a 100644
--- a/tests/samples/expectedMrssFormat/feed.microblog.xml
+++ b/tests/Formats/samples/expectedMrssFormat/feed.microblog.xml
diff --git a/tests/samples/feed.common.json b/tests/Formats/samples/feed.common.json
index 080ba01a..080ba01a 100644
--- a/tests/samples/feed.common.json
+++ b/tests/Formats/samples/feed.common.json
diff --git a/tests/samples/feed.empty.json b/tests/Formats/samples/feed.empty.json
index aac09f64..aac09f64 100644
--- a/tests/samples/feed.empty.json
+++ b/tests/Formats/samples/feed.empty.json
diff --git a/tests/samples/feed.emptyItems.json b/tests/Formats/samples/feed.emptyItems.json
index 0287d428..0287d428 100644
--- a/tests/samples/feed.emptyItems.json
+++ b/tests/Formats/samples/feed.emptyItems.json
diff --git a/tests/samples/feed.microblog.json b/tests/Formats/samples/feed.microblog.json
index 721763cd..721763cd 100644
--- a/tests/samples/feed.microblog.json
+++ b/tests/Formats/samples/feed.microblog.json