aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorGravatar Jan Tojnar <jtojnar@gmail.com> 2022-06-07 18:05:33 +0200
committerGravatar GitHub <noreply@github.com> 2022-06-07 18:05:33 +0200
commitfb501652d5ef8519470fa1faa585b3668ebd2a34 (patch)
treea9603f0c09d6f4b710fbde1c10297330bac87ad1 /tests
parente85932b1a524f88db6af66d4c3aac3a7983c169b (diff)
downloadrss-bridge-fb501652d5ef8519470fa1faa585b3668ebd2a34.tar.gz
rss-bridge-fb501652d5ef8519470fa1faa585b3668ebd2a34.tar.zst
rss-bridge-fb501652d5ef8519470fa1faa585b3668ebd2a34.zip
Formats: Remove display & related method (#2776)
Format should not be responsible for sending HTTP response.
Diffstat (limited to 'tests')
-rw-r--r--tests/AtomFormatTest.php19
-rw-r--r--tests/JsonFormatTest.php19
-rw-r--r--tests/MrssFormatTest.php19
3 files changed, 3 insertions, 54 deletions
diff --git a/tests/AtomFormatTest.php b/tests/AtomFormatTest.php
index 91d6c1d8..1d692c40 100644
--- a/tests/AtomFormatTest.php
+++ b/tests/AtomFormatTest.php
@@ -17,21 +17,6 @@ class AtomFormatTest extends TestCase {
/**
* @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
*/
public function testOutput($path) {
$this->setSample($path);
@@ -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();
}
}
diff --git a/tests/JsonFormatTest.php b/tests/JsonFormatTest.php
index 9e19fe8f..9b536c18 100644
--- a/tests/JsonFormatTest.php
+++ b/tests/JsonFormatTest.php
@@ -18,21 +18,6 @@ class JsonFormatTest extends TestCase {
/**
* @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
*/
public function testOutput($path) {
$this->setSample($path);
@@ -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();
}
}
diff --git a/tests/MrssFormatTest.php b/tests/MrssFormatTest.php
index 5ece3904..ed7dc3a3 100644
--- a/tests/MrssFormatTest.php
+++ b/tests/MrssFormatTest.php
@@ -18,21 +18,6 @@ class MrssFormatTest extends TestCase {
/**
* @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
*/
public function testOutput($path) {
$this->setSample($path);
@@ -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();
}
}