diff options
author | Joas Schilling <nickvergessen@gmx.de> | 2013-07-23 00:58:03 +0200 |
---|---|---|
committer | Joas Schilling <nickvergessen@gmx.de> | 2013-07-23 00:58:03 +0200 |
commit | 8dc8ee205a30e4f1813f2b85e0176cc47100f47b (patch) | |
tree | 1aec684e66272ca674eb677e90116d2a7c97489f /tests | |
parent | 127ee62eddf07d705c9b243169db338ee4cbfaef (diff) | |
download | forums-8dc8ee205a30e4f1813f2b85e0176cc47100f47b.tar forums-8dc8ee205a30e4f1813f2b85e0176cc47100f47b.tar.gz forums-8dc8ee205a30e4f1813f2b85e0176cc47100f47b.tar.bz2 forums-8dc8ee205a30e4f1813f2b85e0176cc47100f47b.tar.xz forums-8dc8ee205a30e4f1813f2b85e0176cc47100f47b.zip |
[ticket/11733] Add browse test for feed.php
PHPBB3-11733
Diffstat (limited to 'tests')
-rw-r--r-- | tests/functional/browse_test.php | 7 | ||||
-rw-r--r-- | tests/test_framework/phpbb_functional_test_case.php | 21 |
2 files changed, 28 insertions, 0 deletions
diff --git a/tests/functional/browse_test.php b/tests/functional/browse_test.php index 18a2ad9464..c3be301762 100644 --- a/tests/functional/browse_test.php +++ b/tests/functional/browse_test.php @@ -29,4 +29,11 @@ class phpbb_functional_browse_test extends phpbb_functional_test_case $crawler = self::request('GET', 'viewtopic.php?t=1'); $this->assertGreaterThan(0, $crawler->filter('.postbody')->count()); } + + public function test_feed() + { + $crawler = self::request('GET', 'feed.php', array(), false); + self::assert_response_xml(); + $this->assertGreaterThan(0, $crawler->filter('entry')->count()); + } } diff --git a/tests/test_framework/phpbb_functional_test_case.php b/tests/test_framework/phpbb_functional_test_case.php index ed307c3ce2..de3611c4cc 100644 --- a/tests/test_framework/phpbb_functional_test_case.php +++ b/tests/test_framework/phpbb_functional_test_case.php @@ -747,6 +747,27 @@ class phpbb_functional_test_case extends phpbb_test_case self::assertStringStartsWith('<!DOCTYPE', trim($content), 'Output found before DOCTYPE specification.'); } + /* + * Perform some basic assertions for an xml page + * + * Checks for debug/error output before the actual page content and the status code + * + * @param mixed $status_code Expected status code, false to disable check + * @return null + */ + static public function assert_response_xml($status_code = 200) + { + if ($status_code !== false) + { + self::assert_response_status_code($status_code); + } + + // Any output before the xml opening means there was an error + $content = self::$client->getResponse()->getContent(); + self::assertNotContains('[phpBB Debug]', $content); + self::assertStringStartsWith('<?xml', trim($content), 'Output found before XML specification.'); + } + /** * Heuristic function to check that the response is success. * |