mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-30 21:40:43 +02:00
Merge branch '3.3.x'
This commit is contained in:
@@ -120,6 +120,11 @@ class phpbb_bbcode_parser_test extends \phpbb_test_case
|
||||
'[img]https://area51.phpbb.com/images/area51.png[/img]',
|
||||
'[img:]https://area51.phpbb.com/images/area51.png[/img:]',
|
||||
),
|
||||
array(
|
||||
'Test default bbcodes: img with unsupported protocol',
|
||||
'[img]foo://foo/bar[/img]',
|
||||
'[img]foo://foo/bar[/img]',
|
||||
),
|
||||
array(
|
||||
'Test default bbcodes: simple url',
|
||||
'[url]https://area51.phpbb.com/[/url]',
|
||||
|
47
tests/functional/smilies_test.php
Normal file
47
tests/functional/smilies_test.php
Normal file
@@ -0,0 +1,47 @@
|
||||
<?php
|
||||
/**
|
||||
*
|
||||
* This file is part of the phpBB Forum Software package.
|
||||
*
|
||||
* @copyright (c) phpBB Limited <https://www.phpbb.com>
|
||||
* @license GNU General Public License, version 2 (GPL-2.0)
|
||||
*
|
||||
* For full copyright and license information, please see
|
||||
* the docs/CREDITS.txt file.
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* @group functional
|
||||
*/
|
||||
class phpbb_functional_smilies_test extends phpbb_functional_test_case
|
||||
{
|
||||
public function test_smilies_mode()
|
||||
{
|
||||
$this->login();
|
||||
|
||||
// Get smilies data
|
||||
$db = $this->get_db();
|
||||
$sql_ary = [
|
||||
'SELECT' => 's.smiley_url, MIN(s.emotion) AS emotion, MIN(s.code) AS code, s.smiley_width, s.smiley_height, MIN(s.smiley_order) AS min_smiley_order',
|
||||
'FROM' => [
|
||||
SMILIES_TABLE => 's',
|
||||
],
|
||||
'GROUP_BY' => 's.smiley_url, s.smiley_width, s.smiley_height',
|
||||
'ORDER_BY' => 'min_smiley_order',
|
||||
];
|
||||
$sql = $db->sql_build_query('SELECT', $sql_ary);
|
||||
$result = $db->sql_query($sql);
|
||||
$smilies = $db->sql_fetchrowset($result);
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
// Visit smilies page
|
||||
$crawler = self::request('GET', 'posting.php?mode=smilies');
|
||||
foreach ($smilies as $index => $smiley)
|
||||
{
|
||||
$this->assertContains($smiley['smiley_url'],
|
||||
$crawler->filter('div[class="inner"] > a > img')->eq($index)->attr('src')
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
@@ -44,4 +44,23 @@ class phpbb_functional_ucp_profile_test extends phpbb_functional_test_case
|
||||
$this->assertEquals('phpbb_twitter', $form->get('pf_phpbb_twitter')->getValue());
|
||||
$this->assertEquals('phpbb.youtube', $form->get('pf_phpbb_youtube')->getValue());
|
||||
}
|
||||
|
||||
public function test_submitting_emoji()
|
||||
{
|
||||
$this->add_lang('ucp');
|
||||
$this->login();
|
||||
|
||||
$crawler = self::request('GET', 'ucp.php?i=ucp_profile&mode=profile_info');
|
||||
$this->assertContainsLang('UCP_PROFILE_PROFILE_INFO', $crawler->filter('#cp-main h2')->text());
|
||||
|
||||
$form = $crawler->selectButton('Submit')->form([
|
||||
'pf_phpbb_location' => '😁', // grinning face with smiling eyes Emoji
|
||||
]);
|
||||
$crawler = self::submit($form);
|
||||
$this->assertContainsLang('PROFILE_UPDATED', $crawler->filter('#message')->text());
|
||||
|
||||
$crawler = self::request('GET', 'ucp.php?i=ucp_profile&mode=profile_info');
|
||||
$form = $crawler->selectButton('Submit')->form();
|
||||
$this->assertEquals('😁', $form->get('pf_phpbb_location')->getValue());
|
||||
}
|
||||
}
|
||||
|
@@ -132,6 +132,10 @@ class phpbb_textformatter_s9e_default_formatting_test extends phpbb_test_case
|
||||
'[img]https://area51.phpbb.com/images/area51.png[/img]',
|
||||
'<img src="https://area51.phpbb.com/images/area51.png" class="postimage" alt="Image">'
|
||||
),
|
||||
array(
|
||||
'[img]foo://area51.phpbb.com/images/area51.png[/img]',
|
||||
'[img]foo://area51.phpbb.com/images/area51.png[/img]'
|
||||
),
|
||||
array(
|
||||
'[url]https://area51.phpbb.com/[/url]',
|
||||
'<a href="https://area51.phpbb.com/" class="postlink">https://area51.phpbb.com/</a>'
|
||||
|
@@ -342,26 +342,6 @@ class phpbb_text_processing_message_parser_test extends phpbb_test_case
|
||||
},
|
||||
array('You may only use fonts up to size 120.')
|
||||
),
|
||||
array(
|
||||
'[img]http://example.org/100x100.png[/img]',
|
||||
'<r>[img]<URL url="http://example.org/100x100.png">http://example.org/100x100.png</URL>[/img]</r>',
|
||||
array(true, true, true, true, true, true, true),
|
||||
function ($phpbb_container)
|
||||
{
|
||||
$phpbb_container->get('config')->set('max_post_img_height', 12);
|
||||
},
|
||||
array('Your images may only be up to 12 pixels high.')
|
||||
),
|
||||
array(
|
||||
'[img]http://example.org/100x100.png[/img]',
|
||||
'<r>[img]<URL url="http://example.org/100x100.png">http://example.org/100x100.png</URL>[/img]</r>',
|
||||
array(true, true, true, true, true, true, true),
|
||||
function ($phpbb_container)
|
||||
{
|
||||
$phpbb_container->get('config')->set('max_post_img_width', 34);
|
||||
},
|
||||
array('Your images may only be up to 34 pixels wide.')
|
||||
),
|
||||
array(
|
||||
'[img]http://example.org/100x100.png[/img]',
|
||||
'<r><IMG src="http://example.org/100x100.png"><s>[img]</s><URL url="http://example.org/100x100.png">http://example.org/100x100.png</URL><e>[/img]</e></IMG></r>',
|
||||
@@ -392,16 +372,6 @@ class phpbb_text_processing_message_parser_test extends phpbb_test_case
|
||||
$phpbb_container->get('config')->set('max_sig_img_width', 34);
|
||||
}
|
||||
),
|
||||
array(
|
||||
'[img]http://example.org/404.png[/img]',
|
||||
'<r>[img]<URL url="http://example.org/404.png">http://example.org/404.png</URL>[/img]</r>',
|
||||
array(true, true, true, true, true, true, true),
|
||||
function ($phpbb_container)
|
||||
{
|
||||
$phpbb_container->get('config')->set('max_post_img_height', 12);
|
||||
},
|
||||
array('It was not possible to determine the dimensions of the image.')
|
||||
),
|
||||
array(
|
||||
'[flash=999,999]http://example.org/foo.swf[/flash]',
|
||||
'<r>[flash=999,999]<URL url="http://example.org/foo.swf">http://example.org/foo.swf</URL>[/flash]</r>',
|
||||
|
Reference in New Issue
Block a user