1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-05-06 07:35:29 +02:00

[ticket/12413] Fix coding style

PHPBB3-12413
This commit is contained in:
Nicofuma 2014-04-29 23:27:43 +02:00
parent 7d8d8394fc
commit 80b4a7f337
4 changed files with 23 additions and 15 deletions

View File

@ -60,6 +60,7 @@ abstract class attachments_base extends \phpbb\feed\base
}
$this->db->sql_freeresult($result);
}
/**
* {@inheritDoc}
*/

View File

@ -37,6 +37,8 @@ class forum extends \phpbb\feed\post_base
function open()
{
parent::open();
// Check if forum exists
$sql = 'SELECT forum_id, forum_name, forum_password, forum_type, forum_options
FROM ' . FORUMS_TABLE . '
@ -80,8 +82,6 @@ class forum extends \phpbb\feed\post_base
unset($forum_ids_passworded);
}
$this->fetch_attachments();
}
function get_sql()

View File

@ -37,6 +37,8 @@ class topic extends \phpbb\feed\post_base
function open()
{
parent::open();
$sql = 'SELECT f.forum_options, f.forum_password, t.topic_id, t.forum_id, t.topic_visibility, t.topic_title, t.topic_time, t.topic_views, t.topic_posts_approved, t.topic_type
FROM ' . TOPICS_TABLE . ' t
LEFT JOIN ' . FORUMS_TABLE . ' f
@ -83,8 +85,6 @@ class topic extends \phpbb\feed\post_base
unset($forum_ids_passworded);
}
$this->fetch_attachments();
}
function get_sql()

View File

@ -1195,9 +1195,9 @@ class phpbb_functional_feed_test extends phpbb_functional_test_case
));
}
// Disabled until PHPBB3-12418 is fixed and merged
/*public function test_create_missing_attachment_post()
public function test_create_missing_attachment_post()
{
$this->markIncomplete('Missing attachments in posts/topics are not marked in feeds yet, see PHPBB3-12418');
$this->login();
$this->load_ids(array(
'forums' => array(
@ -1218,6 +1218,7 @@ class phpbb_functional_feed_test extends phpbb_functional_test_case
public function test_feeds_missing_attachment_admin()
{
$this->markIncomplete('Missing attachments in posts/topics are not marked in feeds yet, see PHPBB3-12418');
$this->load_ids(array(
'forums' => array(
'Feeds #1',
@ -1294,7 +1295,7 @@ class phpbb_functional_feed_test extends phpbb_functional_test_case
),
),
), 'admin');
}*/
}
protected function assert_feeds($data, $username = false)
{
@ -1338,7 +1339,7 @@ class phpbb_functional_feed_test extends phpbb_functional_test_case
case 'news':
break;
default:
$this->fail('Unsupported feed.');
$this->fail('Unsupported feed mode: ' . $mode);
}
$params = "?mode={$mode}";
@ -1352,19 +1353,22 @@ class phpbb_functional_feed_test extends phpbb_functional_test_case
{
$crawler = self::request('GET', 'feed.php' . $params, array(), false);
if (!(isset($data['invalid']) && $data['invalid']))
if (empty($data['invalid']))
{
self::assert_response_xml();
$this->assertEquals($data['nb_entries'], $crawler->filter('entry')->count(), "Tested feed : 'feed.php{$params}'");
if (sizeof($data['xpath'])) {
if (!empty($data['xpath']))
{
foreach($data['xpath'] as $xpath => $count_expected)
{
$this->assertCount($count_expected, $crawler->filterXPath($xpath), "Tested feed : 'feed.php{$params}', Search for {$xpath}");
}
}
if (sizeof($data['contents'])) {
if (!empty($data['contents']))
{
foreach($data['contents'] as $entry_id => $string)
{
$content = $crawler->filterXPath("//entry[{$entry_id}]/content")->text();
@ -1372,7 +1376,8 @@ class phpbb_functional_feed_test extends phpbb_functional_test_case
}
}
if (sizeof($data['contents_lang'])) {
if (!empty($data['contents_lang']))
{
foreach($data['contents_lang'] as $entry_id => $string)
{
$content = $crawler->filterXPath("//entry[{$entry_id}]/content")->text();
@ -1380,7 +1385,8 @@ class phpbb_functional_feed_test extends phpbb_functional_test_case
}
}
if (sizeof($data['attachments'])) {
if (!empty($data['attachments']))
{
foreach($data['attachments'] as $entry_id => $attachments)
{
foreach ($attachments as $i => $attachment)
@ -1408,10 +1414,11 @@ class phpbb_functional_feed_test extends phpbb_functional_test_case
{
self::assert_response_html();
if (sizeof($data['contents_lang'])) {
if (!empty($data['contents_lang']))
{
foreach($data['contents_lang'] as $string)
{
$content = $crawler->filter("html")->text();
$content = $crawler->filter('html')->text();
$this->assertContainsLang($string, $content, "Tested feed : 'feed.php{$params}'");
}
}