refactor: ./tests (#2649)

* refactor: ./tests

* test: consolidate testsuites

* refactor: move config setup into rssbridge.php

Makes it easier to unit test.

* lint
This commit is contained in:
Dag 2022-04-13 21:04:10 +02:00 committed by GitHub
parent 183004f954
commit d62b977394
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 20 additions and 42 deletions

View file

@ -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();
}