aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Fischer <bantu@phpbb.com>2013-07-23 01:17:13 +0200
committerAndreas Fischer <bantu@phpbb.com>2013-07-23 01:17:13 +0200
commit017d809e7495f86005a826ad555cbdfdbb308776 (patch)
tree33846a7d1a43aa49202698f74f1a2bbc097f5231
parent7c8e71845f5bb018f3f26378c931290e0359c494 (diff)
parent10ba1e73da8be9920708593592ab47493de4b101 (diff)
downloadforums-017d809e7495f86005a826ad555cbdfdbb308776.tar
forums-017d809e7495f86005a826ad555cbdfdbb308776.tar.gz
forums-017d809e7495f86005a826ad555cbdfdbb308776.tar.bz2
forums-017d809e7495f86005a826ad555cbdfdbb308776.tar.xz
forums-017d809e7495f86005a826ad555cbdfdbb308776.zip
Merge remote-tracking branch 'nickvergessen/ticket/11733' into develop
* nickvergessen/ticket/11733: [ticket/11733] Fix "Illegal offset type" Warning caused by overall feed [ticket/11733] Add browse test for feed.php
-rw-r--r--phpBB/phpbb/feed/overall.php2
-rw-r--r--tests/functional/browse_test.php7
-rw-r--r--tests/test_framework/phpbb_functional_test_case.php21
3 files changed, 29 insertions, 1 deletions
diff --git a/phpBB/phpbb/feed/overall.php b/phpBB/phpbb/feed/overall.php
index 869df7cde0..224d97ec03 100644
--- a/phpBB/phpbb/feed/overall.php
+++ b/phpBB/phpbb/feed/overall.php
@@ -72,7 +72,7 @@ class phpbb_feed_overall extends phpbb_feed_post_base
),
),
'WHERE' => $this->db->sql_in_set('p.topic_id', $topic_ids) . '
- AND ' . $this->content_visibility->get_visibility_sql('post', array(), 'p.') . '
+ AND ' . $this->content_visibility->get_forums_visibility_sql('post', $forum_ids, 'p.') . '
AND p.post_time >= ' . $min_post_time . '
AND u.user_id = p.poster_id',
'ORDER_BY' => 'p.post_time DESC',
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.
*