diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/ActionImplementationTest.php | 3 | ||||
-rw-r--r-- | tests/AtomFormatTest.php | 6 | ||||
-rw-r--r-- | tests/BridgeImplementationTest.php | 7 | ||||
-rw-r--r-- | tests/CacheImplementationTest.php | 1 | ||||
-rw-r--r-- | tests/FormatImplementationTest.php | 3 | ||||
-rw-r--r-- | tests/JsonFormatTest.php | 5 | ||||
-rw-r--r-- | tests/ListActionTest.php | 10 | ||||
-rw-r--r-- | tests/MrssFormatTest.php | 6 |
8 files changed, 12 insertions, 29 deletions
diff --git a/tests/ActionImplementationTest.php b/tests/ActionImplementationTest.php index 554432f3..6a36c2f1 100644 --- a/tests/ActionImplementationTest.php +++ b/tests/ActionImplementationTest.php @@ -1,5 +1,4 @@ <?php -require_once __DIR__ . '/../lib/rssbridge.php'; use PHPUnit\Framework\TestCase; @@ -40,8 +39,6 @@ class ActionImplementationTest extends TestCase { $this->assertEquals($allowedActionAbstract, $methods); } - //////////////////////////////////////////////////////////////////////////// - public function dataActionsProvider() { $actions = array(); foreach (glob(PATH_LIB_ACTIONS . '*.php') as $path) { diff --git a/tests/AtomFormatTest.php b/tests/AtomFormatTest.php index 818b82eb..91d6c1d8 100644 --- a/tests/AtomFormatTest.php +++ b/tests/AtomFormatTest.php @@ -3,7 +3,6 @@ * AtomFormat - RFC 4287: The Atom Syndication Format * https://tools.ietf.org/html/rfc4287 */ -require_once __DIR__ . '/../lib/rssbridge.php'; use PHPUnit\Framework\TestCase; @@ -41,8 +40,6 @@ class AtomFormatTest extends TestCase { $this->assertXmlStringEqualsXmlFile($this->sample->expected, $this->data); } - //////////////////////////////////////////////////////////////////////////// - public function sampleProvider() { $samples = array(); foreach (glob(self::PATH_SAMPLES . '*.json') as $path) { @@ -84,7 +81,8 @@ class AtomFormatTest extends TestCase { $this->format->setExtraInfos($this->sample->meta); $this->format->setLastModified(strtotime('2000-01-01 12:00:00 UTC')); - $this->data = $this->getActualOutput($this->format->display()); + $_ = $this->format->display(); + $this->data = $this->getActualOutput(); $this->assertNotFalse(simplexml_load_string($this->data)); ob_clean(); } diff --git a/tests/BridgeImplementationTest.php b/tests/BridgeImplementationTest.php index e634aacf..28d8ec1e 100644 --- a/tests/BridgeImplementationTest.php +++ b/tests/BridgeImplementationTest.php @@ -1,5 +1,4 @@ <?php -require_once __DIR__ . '/../lib/rssbridge.php'; use PHPUnit\Framework\TestCase; @@ -52,7 +51,9 @@ class BridgeImplementationTest extends TestCase { $this->setBridge($path); $multiMinimum = 2; - if (isset($this->obj::PARAMETERS['global'])) ++$multiMinimum; + if (isset($this->obj::PARAMETERS['global'])) { + ++$multiMinimum; + } $multiContexts = (count($this->obj::PARAMETERS) >= $multiMinimum); $paramsSeen = array(); @@ -202,8 +203,6 @@ class BridgeImplementationTest extends TestCase { $this->checkUrl($this->obj->getURI()); } - //////////////////////////////////////////////////////////////////////////// - public function dataBridgesProvider() { $bridges = array(); foreach (glob(PATH_LIB_BRIDGES . '*.php') as $path) { diff --git a/tests/CacheImplementationTest.php b/tests/CacheImplementationTest.php index 25189134..68741d8b 100644 --- a/tests/CacheImplementationTest.php +++ b/tests/CacheImplementationTest.php @@ -1,5 +1,4 @@ <?php -require_once __DIR__ . '/../lib/rssbridge.php'; use PHPUnit\Framework\TestCase; diff --git a/tests/FormatImplementationTest.php b/tests/FormatImplementationTest.php index f2df6350..d4d7249f 100644 --- a/tests/FormatImplementationTest.php +++ b/tests/FormatImplementationTest.php @@ -1,5 +1,4 @@ <?php -require_once __DIR__ . '/../lib/rssbridge.php'; use PHPUnit\Framework\TestCase; @@ -25,8 +24,6 @@ class FormatImplementationTest extends TestCase { $this->assertInstanceOf(FormatInterface::class, $this->obj); } - //////////////////////////////////////////////////////////////////////////// - public function dataFormatsProvider() { $formats = array(); foreach (glob(PATH_LIB_FORMATS . '*.php') as $path) { diff --git a/tests/JsonFormatTest.php b/tests/JsonFormatTest.php index a9417e25..9e19fe8f 100644 --- a/tests/JsonFormatTest.php +++ b/tests/JsonFormatTest.php @@ -41,8 +41,6 @@ class JsonFormatTest extends TestCase { $this->assertJsonStringEqualsJsonFile($this->sample->expected, $this->data); } - //////////////////////////////////////////////////////////////////////////// - public function sampleProvider() { $samples = array(); foreach (glob(self::PATH_SAMPLES . '*.json') as $path) { @@ -84,7 +82,8 @@ class JsonFormatTest extends TestCase { $this->format->setExtraInfos($this->sample->meta); $this->format->setLastModified(strtotime('2000-01-01 12:00:00 UTC')); - $this->data = $this->getActualOutput($this->format->display()); + $_ = $this->format->display(); + $this->data = $this->getActualOutput(); $this->assertNotNull(json_decode($this->data), 'invalid JSON output: ' . json_last_error_msg()); ob_clean(); } diff --git a/tests/ListActionTest.php b/tests/ListActionTest.php index 6d22b916..f15e1b73 100644 --- a/tests/ListActionTest.php +++ b/tests/ListActionTest.php @@ -1,11 +1,9 @@ <?php -require_once __DIR__ . '/../lib/rssbridge.php'; use PHPUnit\Framework\TestCase; class ListActionTest extends TestCase { - private $action; private $data; /** @@ -75,17 +73,15 @@ class ListActionTest extends TestCase { } } - //////////////////////////////////////////////////////////////////////////// - private function initAction() { $actionFac = new ActionFactory(); $actionFac->setWorkingDir(PATH_LIB_ACTIONS); - $this->action = $actionFac->create('list'); - $this->action->setUserData(array()); /* no user data required */ + $action = $actionFac->create('list'); + $action->setUserData(array()); /* no user data required */ ob_start(); - $this->action->execute(); + $action->execute(); $this->data = ob_get_contents(); ob_clean(); ob_end_flush(); diff --git a/tests/MrssFormatTest.php b/tests/MrssFormatTest.php index 0ddc33c4..5ece3904 100644 --- a/tests/MrssFormatTest.php +++ b/tests/MrssFormatTest.php @@ -4,7 +4,6 @@ * http://www.rssboard.org/rss-specification * http://www.rssboard.org/media-rss */ -require_once __DIR__ . '/../lib/rssbridge.php'; use PHPUnit\Framework\TestCase; @@ -42,8 +41,6 @@ class MrssFormatTest extends TestCase { $this->assertXmlStringEqualsXmlFile($this->sample->expected, $this->data); } - //////////////////////////////////////////////////////////////////////////// - public function sampleProvider() { $samples = array(); foreach (glob(self::PATH_SAMPLES . '*.json') as $path) { @@ -85,7 +82,8 @@ class MrssFormatTest extends TestCase { $this->format->setExtraInfos($this->sample->meta); $this->format->setLastModified(strtotime('2000-01-01 12:00:00 UTC')); - $this->data = $this->getActualOutput($this->format->display()); + $_ = $this->format->display(); + $this->data = $this->getActualOutput(); $this->assertNotFalse(simplexml_load_string($this->data)); ob_clean(); } |