1
0
mirror of https://github.com/RSS-Bridge/rss-bridge.git synced 2025-08-06 16:46:30 +02:00

Formats: Remove display & related method (#2776)

Format should not be responsible for sending HTTP response.
This commit is contained in:
Jan Tojnar
2022-06-07 18:05:33 +02:00
committed by GitHub
parent e85932b1a5
commit fb501652d5
13 changed files with 11 additions and 178 deletions

View File

@@ -14,21 +14,6 @@ class AtomFormatTest extends TestCase {
private $format;
private $data;
/**
* @dataProvider sampleProvider
* @runInSeparateProcess
* @requires function xdebug_get_headers
*/
public function testHeaders($path) {
$this->setSample($path);
$this->initFormat();
$this->assertContains(
'Content-Type: application/atom+xml; charset=' . $this->format->getCharset(),
xdebug_get_headers()
);
}
/**
* @dataProvider sampleProvider
* @runInSeparateProcess
@@ -81,9 +66,7 @@ class AtomFormatTest extends TestCase {
$this->format->setExtraInfos($this->sample->meta);
$this->format->setLastModified(strtotime('2000-01-01 12:00:00 UTC'));
$_ = $this->format->display();
$this->data = $this->getActualOutput();
$this->data = $this->format->stringify();
$this->assertNotFalse(simplexml_load_string($this->data));
ob_clean();
}
}

View File

@@ -15,21 +15,6 @@ class JsonFormatTest extends TestCase {
private $format;
private $data;
/**
* @dataProvider sampleProvider
* @runInSeparateProcess
* @requires function xdebug_get_headers
*/
public function testHeaders($path) {
$this->setSample($path);
$this->initFormat();
$this->assertContains(
'Content-Type: application/json; charset=' . $this->format->getCharset(),
xdebug_get_headers()
);
}
/**
* @dataProvider sampleProvider
* @runInSeparateProcess
@@ -82,9 +67,7 @@ class JsonFormatTest extends TestCase {
$this->format->setExtraInfos($this->sample->meta);
$this->format->setLastModified(strtotime('2000-01-01 12:00:00 UTC'));
$_ = $this->format->display();
$this->data = $this->getActualOutput();
$this->data = $this->format->stringify();
$this->assertNotNull(json_decode($this->data), 'invalid JSON output: ' . json_last_error_msg());
ob_clean();
}
}

View File

@@ -15,21 +15,6 @@ class MrssFormatTest extends TestCase {
private $format;
private $data;
/**
* @dataProvider sampleProvider
* @runInSeparateProcess
* @requires function xdebug_get_headers
*/
public function testHeaders($path) {
$this->setSample($path);
$this->initFormat();
$this->assertContains(
'Content-Type: application/rss+xml; charset=' . $this->format->getCharset(),
xdebug_get_headers()
);
}
/**
* @dataProvider sampleProvider
* @runInSeparateProcess
@@ -82,9 +67,7 @@ class MrssFormatTest extends TestCase {
$this->format->setExtraInfos($this->sample->meta);
$this->format->setLastModified(strtotime('2000-01-01 12:00:00 UTC'));
$_ = $this->format->display();
$this->data = $this->getActualOutput();
$this->data = $this->format->stringify();
$this->assertNotFalse(simplexml_load_string($this->data));
ob_clean();
}
}