mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-31 14:00:31 +02:00
Merge branch 'prep-release-3.2.10' into prep-release-3.3.1
This commit is contained in:
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());
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user