aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/dbal/fixtures/migrator_module.xml39
-rw-r--r--tests/dbal/migrator_tool_module_test.php120
-rw-r--r--tests/di/create_container_test.php2
-rw-r--r--tests/functional/notification_test.php2
-rw-r--r--tests/functional/search/base.php24
-rw-r--r--tests/functional/user_password_reset_test.php43
-rw-r--r--tests/functions/convert_30_dbms_to_31_test.php1
-rw-r--r--tests/functions/user_delete_test.php1
-rw-r--r--tests/migrator/schema_generator_test.php2
-rw-r--r--tests/mock/request.php5
-rw-r--r--tests/test_framework/phpbb_database_test_case.php2
-rw-r--r--tests/test_framework/phpbb_database_test_connection_manager.php15
-rw-r--r--tests/test_framework/phpbb_test_case_helpers.php11
-rw-r--r--tests/text_formatter/s9e/default_formatting_test.php2
-rw-r--r--tests/text_formatter/s9e/factory_test.php2
-rw-r--r--tests/text_formatter/s9e/renderer_test.php4
-rw-r--r--tests/text_processing/generate_text_for_display_test.php2
-rw-r--r--tests/text_processing/smilies_test.php8
-rw-r--r--tests/text_processing/tickets_data/PHPBB3-13425.html2
-rw-r--r--tests/text_processing/tickets_data/PHPBB3-14846.html1
-rw-r--r--tests/text_processing/tickets_data/PHPBB3-14846.txt1
-rw-r--r--tests/text_processing/tickets_data/PHPBB3-14846.xml28
-rw-r--r--tests/text_processing/tickets_data/PHPBB3-7187.html2
-rw-r--r--tests/text_processing/tickets_data/PHPBB3-7275.html2
24 files changed, 259 insertions, 62 deletions
diff --git a/tests/dbal/fixtures/migrator_module.xml b/tests/dbal/fixtures/migrator_module.xml
index e172d7a145..e85c43ee25 100644
--- a/tests/dbal/fixtures/migrator_module.xml
+++ b/tests/dbal/fixtures/migrator_module.xml
@@ -90,5 +90,44 @@
<value></value>
<value></value>
</row>
+ <row>
+ <value>7</value>
+ <value>1</value>
+ <value>1</value>
+ <value></value>
+ <value>ucp</value>
+ <value>0</value>
+ <value>13</value>
+ <value>18</value>
+ <value>UCP_MAIN_CAT</value>
+ <value></value>
+ <value></value>
+ </row>
+ <row>
+ <value>8</value>
+ <value>1</value>
+ <value>1</value>
+ <value>ucp_subcat</value>
+ <value>ucp</value>
+ <value>7</value>
+ <value>14</value>
+ <value>17</value>
+ <value>UCP_SUBCATEGORY</value>
+ <value>ucp_test</value>
+ <value></value>
+ </row>
+ <row>
+ <value>9</value>
+ <value>1</value>
+ <value>1</value>
+ <value>ucp_module</value>
+ <value>ucp</value>
+ <value>8</value>
+ <value>15</value>
+ <value>16</value>
+ <value>UCP_MODULE</value>
+ <value>ucp_module_test</value>
+ <value></value>
+ </row>
</table>
</dataset>
diff --git a/tests/dbal/migrator_tool_module_test.php b/tests/dbal/migrator_tool_module_test.php
index 1744b7e92d..29b21166b6 100644
--- a/tests/dbal/migrator_tool_module_test.php
+++ b/tests/dbal/migrator_tool_module_test.php
@@ -45,10 +45,10 @@ class phpbb_dbal_migrator_tool_module_test extends phpbb_database_test_case
$this->tool = new \phpbb\db\migration\tool\module($this->db, $this->cache, $this->user, $module_manager, $phpbb_root_path, $phpEx, 'phpbb_modules');
}
- public function exists_data()
+ public function exists_data_acp()
{
return array(
- // Test the category
+ // Test the existing category
array(
'',
'ACP_CAT',
@@ -60,7 +60,7 @@ class phpbb_dbal_migrator_tool_module_test extends phpbb_database_test_case
true,
),
- // Test the module
+ // Test the existing module
array(
'',
'ACP_MODULE',
@@ -76,17 +76,88 @@ class phpbb_dbal_migrator_tool_module_test extends phpbb_database_test_case
'ACP_MODULE',
true,
),
+
+ // Test for non-existant modules
+ array(
+ '',
+ 'ACP_NON_EXISTANT_CAT',
+ false,
+ ),
+ array(
+ 'ACP_CAT',
+ 'ACP_NON_EXISTANT_MODULE',
+ false,
+ ),
);
}
/**
- * @dataProvider exists_data
+ * @dataProvider exists_data_acp
*/
- public function test_exists($parent, $module, $expected)
+ public function test_exists_acp($parent, $module, $expected)
{
$this->assertEquals($expected, $this->tool->exists('acp', $parent, $module));
}
+ public function exists_data_ucp()
+ {
+ return array(
+ // Test the existing category
+ array(
+ '',
+ 'UCP_MAIN_CAT',
+ true,
+ ),
+ array(
+ 0,
+ 'UCP_MAIN_CAT',
+ true,
+ ),
+
+ // Test the existing module
+ array(
+ '',
+ 'UCP_SUBCATEGORY',
+ false,
+ ),
+ array(
+ false,
+ 'UCP_SUBCATEGORY',
+ true,
+ ),
+ array(
+ 'UCP_MAIN_CAT',
+ 'UCP_SUBCATEGORY',
+ true,
+ ),
+ array(
+ 'UCP_SUBCATEGORY',
+ 'UCP_MODULE',
+ true,
+ ),
+
+ // Test for non-existant modules
+ array(
+ '',
+ 'UCP_NON_EXISTANT_CAT',
+ false,
+ ),
+ array(
+ 'UCP_MAIN_CAT',
+ 'UCP_NON_EXISTANT_MODULE',
+ false,
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider exists_data_ucp
+ */
+ public function test_exists_ucp($parent, $module, $expected)
+ {
+ $this->assertEquals($expected, $this->tool->exists('ucp', $parent, $module));
+ }
+
public function test_add()
{
try
@@ -159,6 +230,45 @@ class phpbb_dbal_migrator_tool_module_test extends phpbb_database_test_case
$this->fail($e);
}
$this->assertEquals(true, $this->tool->exists('acp', 'ACP_FORUM_BASED_PERMISSIONS', 'ACP_NEW_PERMISSIONS_MODULE'));
+
+ // Test adding UCP modules
+ // Test adding new UCP category
+ try
+ {
+ $this->tool->add('ucp', 0, 'UCP_NEW_CAT');
+ }
+ catch (Exception $e)
+ {
+ $this->fail($e);
+ }
+ $this->assertEquals(true, $this->tool->exists('ucp', 0, 'UCP_NEW_CAT'));
+
+ // Test adding new UCP subcategory
+ try
+ {
+ $this->tool->add('ucp', 'UCP_NEW_CAT', 'UCP_NEW_SUBCAT');
+ }
+ catch (Exception $e)
+ {
+ $this->fail($e);
+ }
+ $this->assertEquals(true, $this->tool->exists('ucp', 'UCP_NEW_CAT', 'UCP_NEW_SUBCAT'));
+
+ // Test adding new UCP module
+ try
+ {
+ $this->tool->add('ucp', 'UCP_NEW_SUBCAT', array(
+ 'module_basename' => 'ucp_new_module',
+ 'module_langname' => 'UCP_NEW_MODULE',
+ 'module_mode' => 'ucp_test',
+ 'module_auth' => '',
+ ));
+ }
+ catch (Exception $e)
+ {
+ $this->fail($e);
+ }
+ $this->assertEquals(true, $this->tool->exists('ucp', 'UCP_NEW_SUBCAT', 'UCP_NEW_MODULE'));
}
public function test_remove()
diff --git a/tests/di/create_container_test.php b/tests/di/create_container_test.php
index 4dd0583ebe..aba7a3560b 100644
--- a/tests/di/create_container_test.php
+++ b/tests/di/create_container_test.php
@@ -73,8 +73,6 @@ namespace
// Checks the construction of a dumped container
$container = $this->builder->get_container();
$this->assertInstanceOf('phpbb_cache_container', $container);
- $this->assertFalse($container->isFrozen());
- $container->getParameterBag(); // needed, otherwise the container is not marked as frozen
$this->assertTrue($container->isFrozen());
}
diff --git a/tests/functional/notification_test.php b/tests/functional/notification_test.php
index 5c6b87d50b..8751de8016 100644
--- a/tests/functional/notification_test.php
+++ b/tests/functional/notification_test.php
@@ -82,6 +82,6 @@ class phpbb_functional_notification_test extends phpbb_functional_test_case
// Get form token
$link = $crawler->selectLink($this->lang('NOTIFICATIONS_MARK_ALL_READ'))->link()->getUri();
$crawler = self::request('GET', substr($link, strpos($link, 'ucp.')));
- $this->assertEquals(0, $crawler->filter('#notification_list_button strong')->text());
+ $this->assertCount(0, $crawler->filter('#notification_list_button strong'));
}
}
diff --git a/tests/functional/search/base.php b/tests/functional/search/base.php
index fc6f4c0a0b..48c444fb76 100644
--- a/tests/functional/search/base.php
+++ b/tests/functional/search/base.php
@@ -79,18 +79,16 @@ abstract class phpbb_functional_search_base extends phpbb_functional_test_case
{
$this->add_lang('acp/search');
$crawler = self::request('GET', 'adm/index.php?i=acp_search&mode=index&sid=' . $this->sid);
- $form_values = $crawler->selectButton('Create index')->form()->getValues();
- $crawler = self::request(
- 'POST',
- 'adm/index.php?i=acp_search&mode=index&sid=' . $this->sid,
+ $form = $crawler->selectButton('Create index')->form();
+ $form_values = $form->getValues();
+ $form_values = array_merge($form_values,
array(
'search_type' => ( ($backend === null) ? $this->search_backend : $backend ),
'action' => 'create',
- 'submit' => true,
- 'form_token' => $form_values['form_token'],
- 'creation_time' => $form_values['creation_time'],
)
);
+ $form->setValues($form_values);
+ $crawler = self::submit($form);
$this->assertContainsLang('SEARCH_INDEX_CREATED', $crawler->text());
}
@@ -98,18 +96,16 @@ abstract class phpbb_functional_search_base extends phpbb_functional_test_case
{
$this->add_lang('acp/search');
$crawler = self::request('GET', 'adm/index.php?i=acp_search&mode=index&sid=' . $this->sid);
- $form_values = $crawler->selectButton('Delete index')->form()->getValues();
- $crawler = self::request(
- 'POST',
- 'adm/index.php?i=acp_search&mode=index&sid=' . $this->sid,
+ $form = $crawler->selectButton('Delete index')->form();
+ $form_values = $form->getValues();
+ $form_values = array_merge($form_values,
array(
'search_type' => $this->search_backend,
'action' => 'delete',
- 'submit' => true,
- 'form_token' => $form_values['form_token'],
- 'creation_time' => $form_values['creation_time'],
)
);
+ $form->setValues($form_values);
+ $crawler = self::submit($form);
$this->assertContainsLang('SEARCH_INDEX_REMOVED', $crawler->text());
}
}
diff --git a/tests/functional/user_password_reset_test.php b/tests/functional/user_password_reset_test.php
index f9406f0eb5..3da78407cf 100644
--- a/tests/functional/user_password_reset_test.php
+++ b/tests/functional/user_password_reset_test.php
@@ -113,6 +113,49 @@ class phpbb_functional_user_password_reset_test extends phpbb_functional_test_ca
$this->assertContains($this->lang('LOGIN_ERROR_PASSWORD', '', ''), $crawler->filter('html')->text());
}
+ /**
+ * @depends test_login
+ */
+ public function test_acivateAfterDeactivate()
+ {
+ // User is active, actkey should not exist
+ $this->get_user_data();
+ $this->assertEmpty($this->user_data['user_actkey']);
+
+ $this->login();
+ $this->admin_login();
+ $this->add_lang('acp/users');
+
+ // Go to user account page
+ $crawler = self::request('GET', 'adm/index.php?i=acp_users&mode=overview&sid=' . $this->sid);
+ $this->assertContainsLang('FIND_USERNAME', $crawler->filter('html')->text());
+
+ $form = $crawler->selectButton('Submit')->form();
+ $crawler = self::submit($form, array('username' => 'reset-password-test-user'));
+
+ // Deactivate account and go back to overview of current user
+ $this->assertContainsLang('USER_TOOLS', $crawler->filter('html')->text());
+ $form = $crawler->filter('input[name=update]')->selectButton('Submit')->form();
+ $crawler = self::submit($form, array('action' => 'active'));
+
+ $this->assertContainsLang('USER_ADMIN_DEACTIVED', $crawler->filter('html')->text());
+ $link = $crawler->selectLink('Back to previous page')->link();
+ $crawler = self::request('GET', preg_replace('#(.+)(adm/index.php.+)#', '$2', $link->getUri()));
+
+ // Ensure again that actkey is empty after deactivation
+ $this->get_user_data();
+ $this->assertEmpty($this->user_data['user_actkey']);
+
+ // Force reactivation of account and check that act key is not empty anymore
+ $this->assertContainsLang('USER_TOOLS', $crawler->filter('html')->text());
+ $form = $crawler->filter('input[name=update]')->selectButton('Submit')->form();
+ $crawler = self::submit($form, array('action' => 'reactivate'));
+ $this->assertContainsLang('FORCE_REACTIVATION_SUCCESS', $crawler->filter('html')->text());
+
+ $this->get_user_data();
+ $this->assertNotEmpty($this->user_data['user_actkey']);
+ }
+
protected function get_user_data()
{
$db = $this->get_db();
diff --git a/tests/functions/convert_30_dbms_to_31_test.php b/tests/functions/convert_30_dbms_to_31_test.php
index e46a569565..456eb64461 100644
--- a/tests/functions/convert_30_dbms_to_31_test.php
+++ b/tests/functions/convert_30_dbms_to_31_test.php
@@ -22,7 +22,6 @@ class phpbb_convert_30_dbms_to_31_test extends phpbb_test_case
array('mysqli'),
array('oracle'),
array('postgres'),
- array('sqlite'),
);
}
diff --git a/tests/functions/user_delete_test.php b/tests/functions/user_delete_test.php
index 480b5fc5e1..db9b6e0c90 100644
--- a/tests/functions/user_delete_test.php
+++ b/tests/functions/user_delete_test.php
@@ -72,6 +72,7 @@ class phpbb_functions_user_delete_test extends phpbb_database_test_case
$oauth_provider_collection,
'phpbb_users',
$phpbb_container,
+ $phpbb_dispatcher,
$this->phpbb_root_path,
$this->php_ext
);
diff --git a/tests/migrator/schema_generator_test.php b/tests/migrator/schema_generator_test.php
index 40a8343e22..1996d207ea 100644
--- a/tests/migrator/schema_generator_test.php
+++ b/tests/migrator/schema_generator_test.php
@@ -29,7 +29,7 @@ class schema_generator_test extends phpbb_test_case
parent::setUp();
$this->config = new \phpbb\config\config(array());
- $this->db = new \phpbb\db\driver\sqlite();
+ $this->db = new \phpbb\db\driver\sqlite3();
$factory = new \phpbb\db\tools\factory();
$this->db_tools = $factory->get($this->db);
$this->table_prefix = 'phpbb_';
diff --git a/tests/mock/request.php b/tests/mock/request.php
index e7217a94a9..6a32ba0cf1 100644
--- a/tests/mock/request.php
+++ b/tests/mock/request.php
@@ -34,6 +34,11 @@ class phpbb_mock_request implements \phpbb\request\request_interface
$this->data[$super_global][$var_name] = $value;
}
+ public function raw_variable($var_name, $default, $super_global = \phpbb\request\request_interface::REQUEST)
+ {
+ return $this->variable($var_name, $default, true, $super_global);
+ }
+
public function variable($var_name, $default, $multibyte = false, $super_global = \phpbb\request\request_interface::REQUEST)
{
return isset($this->data[$super_global][$var_name]) ? $this->data[$super_global][$var_name] : $default;
diff --git a/tests/test_framework/phpbb_database_test_case.php b/tests/test_framework/phpbb_database_test_case.php
index 4d0460ebeb..b7386e9a3e 100644
--- a/tests/test_framework/phpbb_database_test_case.php
+++ b/tests/test_framework/phpbb_database_test_case.php
@@ -76,7 +76,7 @@ abstract class phpbb_database_test_case extends PHPUnit_Extensions_Database_Test
global $table_prefix;
- $db = new \phpbb\db\driver\sqlite();
+ $db = new \phpbb\db\driver\sqlite3();
$factory = new \phpbb\db\tools\factory();
$db_tools = $factory->get($db, true);
diff --git a/tests/test_framework/phpbb_database_test_connection_manager.php b/tests/test_framework/phpbb_database_test_connection_manager.php
index 27ac64e21d..147029d699 100644
--- a/tests/test_framework/phpbb_database_test_connection_manager.php
+++ b/tests/test_framework/phpbb_database_test_connection_manager.php
@@ -55,7 +55,6 @@ class phpbb_database_test_connection_manager
switch ($this->dbms['PDO'])
{
- case 'sqlite2':
case 'sqlite': // SQLite3 driver
$dsn .= $this->config['dbhost'];
break;
@@ -193,7 +192,6 @@ class phpbb_database_test_connection_manager
{
switch ($this->config['dbms'])
{
- case 'phpbb\db\driver\sqlite':
case 'phpbb\db\driver\sqlite3':
$this->connect();
// Drop all of the tables
@@ -269,12 +267,6 @@ class phpbb_database_test_connection_manager
$sql = 'SHOW TABLES';
break;
- case 'phpbb\db\driver\sqlite':
- $sql = 'SELECT name
- FROM sqlite_master
- WHERE type = "table"';
- break;
-
case 'phpbb\db\driver\sqlite3':
$sql = 'SELECT name
FROM sqlite_master
@@ -378,7 +370,7 @@ class phpbb_database_test_connection_manager
$classes = $finder->core_path('phpbb/db/migration/data/')
->get_classes();
- $db = new \phpbb\db\driver\sqlite();
+ $db = new \phpbb\db\driver\sqlite3();
$factory = new \phpbb\db\tools\factory();
$db_tools = $factory->get($db, true);
@@ -454,11 +446,6 @@ class phpbb_database_test_connection_manager
'DELIM' => ';',
'PDO' => 'pgsql',
),
- 'phpbb\db\driver\sqlite' => array(
- 'SCHEMA' => 'sqlite',
- 'DELIM' => ';',
- 'PDO' => 'sqlite2',
- ),
'phpbb\db\driver\sqlite3' => array(
'SCHEMA' => 'sqlite',
'DELIM' => ';',
diff --git a/tests/test_framework/phpbb_test_case_helpers.php b/tests/test_framework/phpbb_test_case_helpers.php
index c4b653ec7c..7fb9a740b8 100644
--- a/tests/test_framework/phpbb_test_case_helpers.php
+++ b/tests/test_framework/phpbb_test_case_helpers.php
@@ -122,17 +122,6 @@ class phpbb_test_case_helpers
'dbpasswd' => '',
));
}
- else if (extension_loaded('sqlite'))
- {
- $config = array_merge($config, array(
- 'dbms' => 'phpbb\db\driver\sqlite',
- 'dbhost' => dirname(__FILE__) . '/../phpbb_unit_tests.sqlite2', // filename
- 'dbport' => '',
- 'dbname' => '',
- 'dbuser' => '',
- 'dbpasswd' => '',
- ));
- }
if (isset($_SERVER['PHPBB_TEST_CONFIG']))
{
diff --git a/tests/text_formatter/s9e/default_formatting_test.php b/tests/text_formatter/s9e/default_formatting_test.php
index a70528aba3..e25c3246b5 100644
--- a/tests/text_formatter/s9e/default_formatting_test.php
+++ b/tests/text_formatter/s9e/default_formatting_test.php
@@ -298,7 +298,7 @@ class phpbb_textformatter_s9e_default_formatting_test extends phpbb_test_case
),
array(
"Emoji: \xF0\x9F\x98\x80",
- 'Emoji: <img alt="' . "\xF0\x9F\x98\x80" . '" class="smilies" draggable="false" width="18" height="18" src="//twemoji.maxcdn.com/svg/1f600.svg">'
+ 'Emoji: <img alt="' . "\xF0\x9F\x98\x80" . '" class="smilies" draggable="false" width="18" height="18" src="//cdn.jsdelivr.net/emojione/assets/svg/1f600.svg">'
),
array(
"Emoji: \xF0\x9F\x98\x80",
diff --git a/tests/text_formatter/s9e/factory_test.php b/tests/text_formatter/s9e/factory_test.php
index 368b8a4f4b..3d3ea8b794 100644
--- a/tests/text_formatter/s9e/factory_test.php
+++ b/tests/text_formatter/s9e/factory_test.php
@@ -165,7 +165,7 @@ class phpbb_textformatter_s9e_factory_test extends phpbb_database_test_case
$renderer = $this->get_test_case_helpers()->set_s9e_services(null, $fixture)->get('text_formatter.renderer');
$this->assertSame(
- '<img class="smilies" src="phpBB/images/smilies/%22%27%3C&amp;%3E.png" alt="&quot;\'&lt;&amp;&gt;" title="&quot;\'&lt;&amp;&gt;">',
+ '<img class="smilies" src="phpBB/images/smilies/%22%27%3C&amp;%3E.png" width="15" height="17" alt="&quot;\'&lt;&amp;&gt;" title="&quot;\'&lt;&amp;&gt;">',
$renderer->render('<r><E>"\'&lt;&amp;&gt;</E></r>')
);
}
diff --git a/tests/text_formatter/s9e/renderer_test.php b/tests/text_formatter/s9e/renderer_test.php
index 2b034259c9..175b90fdc7 100644
--- a/tests/text_formatter/s9e/renderer_test.php
+++ b/tests/text_formatter/s9e/renderer_test.php
@@ -115,7 +115,7 @@ class phpbb_textformatter_s9e_renderer_test extends phpbb_test_case
),
array(
'<r><E>:)</E></r>',
- '<img class="smilies" src="phpBB/images/smilies/icon_e_smile.gif" alt=":)" title="Smile">',
+ '<img class="smilies" src="phpBB/images/smilies/icon_e_smile.gif" width="15" height="17" alt=":)" title="Smile">',
array('set_viewsmilies' => true)
),
array(
@@ -248,7 +248,7 @@ class phpbb_textformatter_s9e_renderer_test extends phpbb_test_case
),
array(
'<r><E>:)</E></r>',
- '<img class="smilies" src="phpBB/images/smilies/icon_e_smile.gif" alt=":)" title="Smile">'
+ '<img class="smilies" src="phpBB/images/smilies/icon_e_smile.gif" width="15" height="17" alt=":)" title="Smile">'
),
array(
'<r><E>:)</E></r>',
diff --git a/tests/text_processing/generate_text_for_display_test.php b/tests/text_processing/generate_text_for_display_test.php
index dfbd0977a0..b8b5b18561 100644
--- a/tests/text_processing/generate_text_for_display_test.php
+++ b/tests/text_processing/generate_text_for_display_test.php
@@ -190,7 +190,7 @@ class phpbb_text_processing_generate_text_for_display_test extends phpbb_test_ca
),
array(
'<r><E>:)</E></r>',
- '<img class="smilies" src="phpBB/images/smilies/icon_e_smile.gif" alt=":)" title="Smile">'
+ '<img class="smilies" src="phpBB/images/smilies/icon_e_smile.gif" width="15" height="17" alt=":)" title="Smile">'
),
array(
'<r><E>:)</E></r>',
diff --git a/tests/text_processing/smilies_test.php b/tests/text_processing/smilies_test.php
index ebdbe7dadc..3778e5f58c 100644
--- a/tests/text_processing/smilies_test.php
+++ b/tests/text_processing/smilies_test.php
@@ -30,19 +30,19 @@ class phpbb_text_processing_smilies_test extends phpbb_test_case
return array(
array(
':) beginning',
- '<img class="smilies" src="phpBB/images/smilies/icon_e_smile.gif" alt=":)" title="Smile"> beginning'
+ '<img class="smilies" src="phpBB/images/smilies/icon_e_smile.gif" width="15" height="17" alt=":)" title="Smile"> beginning'
),
array(
'end :)',
- 'end <img class="smilies" src="phpBB/images/smilies/icon_e_smile.gif" alt=":)" title="Smile">'
+ 'end <img class="smilies" src="phpBB/images/smilies/icon_e_smile.gif" width="15" height="17" alt=":)" title="Smile">'
),
array(
':)',
- '<img class="smilies" src="phpBB/images/smilies/icon_e_smile.gif" alt=":)" title="Smile">'
+ '<img class="smilies" src="phpBB/images/smilies/icon_e_smile.gif" width="15" height="17" alt=":)" title="Smile">'
),
array(
'xx (18) 8) xx',
- 'xx (18) <img class="smilies" src="phpBB/images/smilies/custom.gif" alt="8)" title="8)"> xx'
+ 'xx (18) <img class="smilies" src="phpBB/images/smilies/custom.gif" width="17" height="18" alt="8)" title="8)"> xx'
),
);
}
diff --git a/tests/text_processing/tickets_data/PHPBB3-13425.html b/tests/text_processing/tickets_data/PHPBB3-13425.html
index 9a042dc558..a3b6d21f40 100644
--- a/tests/text_processing/tickets_data/PHPBB3-13425.html
+++ b/tests/text_processing/tickets_data/PHPBB3-13425.html
@@ -1 +1 @@
-<blockquote class="uncited"><div><img class="smilies" src="phpBB/images/smilies/icon_lol.gif" alt=":lol:" title="Laughing"> starts with a smiley</div></blockquote> \ No newline at end of file
+<blockquote class="uncited"><div><img class="smilies" src="phpBB/images/smilies/icon_lol.gif" width="15" height="17" alt=":lol:" title="Laughing"> starts with a smiley</div></blockquote> \ No newline at end of file
diff --git a/tests/text_processing/tickets_data/PHPBB3-14846.html b/tests/text_processing/tickets_data/PHPBB3-14846.html
new file mode 100644
index 0000000000..461ca25bc6
--- /dev/null
+++ b/tests/text_processing/tickets_data/PHPBB3-14846.html
@@ -0,0 +1 @@
+<div style="padding: .2em .5em; font-size: .8em; width: 200px; background: #FFD;">moderator text<div style="font-weight: bold; text-align: right">- Mickroz</div></div> \ No newline at end of file
diff --git a/tests/text_processing/tickets_data/PHPBB3-14846.txt b/tests/text_processing/tickets_data/PHPBB3-14846.txt
new file mode 100644
index 0000000000..ded7b3f1fe
--- /dev/null
+++ b/tests/text_processing/tickets_data/PHPBB3-14846.txt
@@ -0,0 +1 @@
+[mod=Mickroz]moderator text[/mod] \ No newline at end of file
diff --git a/tests/text_processing/tickets_data/PHPBB3-14846.xml b/tests/text_processing/tickets_data/PHPBB3-14846.xml
new file mode 100644
index 0000000000..94b094f0e3
--- /dev/null
+++ b/tests/text_processing/tickets_data/PHPBB3-14846.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<dataset>
+ <table name="phpbb_bbcodes">
+ <column>bbcode_id</column>
+ <column>bbcode_tag</column>
+ <column>bbcode_helpline</column>
+ <column>display_on_posting</column>
+ <column>bbcode_match</column>
+ <column>bbcode_tpl</column>
+ <column>first_pass_match</column>
+ <column>first_pass_replace</column>
+ <column>second_pass_match</column>
+ <column>second_pass_replace</column>
+
+ <row>
+ <value>13</value>
+ <value>mod=</value>
+ <value></value>
+ <value>1</value>
+ <value>[mod={TEXT1}]{TEXT2}[/mod]</value>
+ <value><![CDATA[<div style="padding: .2em .5em; font-size: .8em; width: 200px; background: #FFD;">{TEXT2}<div style="font-weight: bold; text-align: right">- {TEXT1}</div></div>]]></value>
+ <value><![CDATA[!\[mod\=(.*?)\](.*?)\[/mod\]!ies]]></value>
+ <value><![CDATA['[mod='.str_replace(array("\r\n", '\"', '\'', '(', ')'), array("\n", '"', '&#39;', '&#40;', '&#41;'), trim('${1}')).':$uid]'.str_replace(array("\r\n", '\"', '\'', '(', ')'), array("\n", '"', '&#39;', '&#40;', '&#41;'), trim('${2}')).'[/mod:$uid]']]></value>
+ <value><![CDATA[!\[mod\=(.*?):$uid\](.*?)\[/mod:$uid\]!s]]></value>
+ <value><![CDATA[<div style="padding: .2em .5em; font-size: .8em; width: 200px; background: #FFD;">${2}<div style="font-weight: bold; text-align: right">- ${1}</div></div>]]></value>
+ </row>
+ </table>
+</dataset>
diff --git a/tests/text_processing/tickets_data/PHPBB3-7187.html b/tests/text_processing/tickets_data/PHPBB3-7187.html
index 9138779d29..a37cdf038e 100644
--- a/tests/text_processing/tickets_data/PHPBB3-7187.html
+++ b/tests/text_processing/tickets_data/PHPBB3-7187.html
@@ -1 +1 @@
-<blockquote class="uncited"><div><img class="smilies" src="phpBB/images/smilies/icon_e_geek.gif" alt=":geek:" title="Geek"> <img class="smilies" src="phpBB/images/smilies/icon_e_ugeek.gif" alt=":ugeek:" title="Uber Geek"></div></blockquote> \ No newline at end of file
+<blockquote class="uncited"><div><img class="smilies" src="phpBB/images/smilies/icon_e_geek.gif" width="17" height="17" alt=":geek:" title="Geek"> <img class="smilies" src="phpBB/images/smilies/icon_e_ugeek.gif" width="17" height="18" alt=":ugeek:" title="Uber Geek"></div></blockquote> \ No newline at end of file
diff --git a/tests/text_processing/tickets_data/PHPBB3-7275.html b/tests/text_processing/tickets_data/PHPBB3-7275.html
index 12502833fd..470aebb5d0 100644
--- a/tests/text_processing/tickets_data/PHPBB3-7275.html
+++ b/tests/text_processing/tickets_data/PHPBB3-7275.html
@@ -1 +1 @@
-<div align="center"><img class="smilies" src="phpBB/images/smilies/icon_e_smile.gif" alt=":)" title="Smile"></div> \ No newline at end of file
+<div align="center"><img class="smilies" src="phpBB/images/smilies/icon_e_smile.gif" width="15" height="17" alt=":)" title="Smile"></div> \ No newline at end of file