mirror of
https://github.com/phpbb/phpbb.git
synced 2025-05-06 15:45:34 +02:00
[ticket/12413] Fix coding style
PHPBB3-12413
This commit is contained in:
parent
7d8d8394fc
commit
80b4a7f337
@ -60,6 +60,7 @@ abstract class attachments_base extends \phpbb\feed\base
|
|||||||
}
|
}
|
||||||
$this->db->sql_freeresult($result);
|
$this->db->sql_freeresult($result);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
|
@ -37,6 +37,8 @@ class forum extends \phpbb\feed\post_base
|
|||||||
|
|
||||||
function open()
|
function open()
|
||||||
{
|
{
|
||||||
|
parent::open();
|
||||||
|
|
||||||
// Check if forum exists
|
// Check if forum exists
|
||||||
$sql = 'SELECT forum_id, forum_name, forum_password, forum_type, forum_options
|
$sql = 'SELECT forum_id, forum_name, forum_password, forum_type, forum_options
|
||||||
FROM ' . FORUMS_TABLE . '
|
FROM ' . FORUMS_TABLE . '
|
||||||
@ -80,8 +82,6 @@ class forum extends \phpbb\feed\post_base
|
|||||||
|
|
||||||
unset($forum_ids_passworded);
|
unset($forum_ids_passworded);
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->fetch_attachments();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function get_sql()
|
function get_sql()
|
||||||
|
@ -37,6 +37,8 @@ class topic extends \phpbb\feed\post_base
|
|||||||
|
|
||||||
function open()
|
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
|
$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
|
FROM ' . TOPICS_TABLE . ' t
|
||||||
LEFT JOIN ' . FORUMS_TABLE . ' f
|
LEFT JOIN ' . FORUMS_TABLE . ' f
|
||||||
@ -83,8 +85,6 @@ class topic extends \phpbb\feed\post_base
|
|||||||
|
|
||||||
unset($forum_ids_passworded);
|
unset($forum_ids_passworded);
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->fetch_attachments();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function get_sql()
|
function get_sql()
|
||||||
|
@ -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->login();
|
||||||
$this->load_ids(array(
|
$this->load_ids(array(
|
||||||
'forums' => array(
|
'forums' => array(
|
||||||
@ -1218,6 +1218,7 @@ class phpbb_functional_feed_test extends phpbb_functional_test_case
|
|||||||
|
|
||||||
public function test_feeds_missing_attachment_admin()
|
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(
|
$this->load_ids(array(
|
||||||
'forums' => array(
|
'forums' => array(
|
||||||
'Feeds #1',
|
'Feeds #1',
|
||||||
@ -1294,7 +1295,7 @@ class phpbb_functional_feed_test extends phpbb_functional_test_case
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
), 'admin');
|
), 'admin');
|
||||||
}*/
|
}
|
||||||
|
|
||||||
protected function assert_feeds($data, $username = false)
|
protected function assert_feeds($data, $username = false)
|
||||||
{
|
{
|
||||||
@ -1338,7 +1339,7 @@ class phpbb_functional_feed_test extends phpbb_functional_test_case
|
|||||||
case 'news':
|
case 'news':
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
$this->fail('Unsupported feed.');
|
$this->fail('Unsupported feed mode: ' . $mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
$params = "?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);
|
$crawler = self::request('GET', 'feed.php' . $params, array(), false);
|
||||||
|
|
||||||
if (!(isset($data['invalid']) && $data['invalid']))
|
if (empty($data['invalid']))
|
||||||
{
|
{
|
||||||
self::assert_response_xml();
|
self::assert_response_xml();
|
||||||
$this->assertEquals($data['nb_entries'], $crawler->filter('entry')->count(), "Tested feed : 'feed.php{$params}'");
|
$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)
|
foreach($data['xpath'] as $xpath => $count_expected)
|
||||||
{
|
{
|
||||||
$this->assertCount($count_expected, $crawler->filterXPath($xpath), "Tested feed : 'feed.php{$params}', Search for {$xpath}");
|
$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)
|
foreach($data['contents'] as $entry_id => $string)
|
||||||
{
|
{
|
||||||
$content = $crawler->filterXPath("//entry[{$entry_id}]/content")->text();
|
$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)
|
foreach($data['contents_lang'] as $entry_id => $string)
|
||||||
{
|
{
|
||||||
$content = $crawler->filterXPath("//entry[{$entry_id}]/content")->text();
|
$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($data['attachments'] as $entry_id => $attachments)
|
||||||
{
|
{
|
||||||
foreach ($attachments as $i => $attachment)
|
foreach ($attachments as $i => $attachment)
|
||||||
@ -1408,10 +1414,11 @@ class phpbb_functional_feed_test extends phpbb_functional_test_case
|
|||||||
{
|
{
|
||||||
self::assert_response_html();
|
self::assert_response_html();
|
||||||
|
|
||||||
if (sizeof($data['contents_lang'])) {
|
if (!empty($data['contents_lang']))
|
||||||
|
{
|
||||||
foreach($data['contents_lang'] as $string)
|
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}'");
|
$this->assertContainsLang($string, $content, "Tested feed : 'feed.php{$params}'");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user