mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-26 20:08:55 +00:00
Compare commits
7 commits
86d309a2e4
...
1ee152e98f
Author | SHA1 | Date | |
---|---|---|---|
|
1ee152e98f | ||
|
8f8a93fa71 | ||
|
c726382d84 | ||
|
5deeea025f | ||
|
6947dc8c92 | ||
|
ddc7f1df34 | ||
|
fabef37d71 |
9 changed files with 161 additions and 7 deletions
|
@ -2806,6 +2806,13 @@ ucp_pm_viewmessage_custom_fields_before
|
||||||
* Purpose: Add data before the custom fields on the user profile when viewing
|
* Purpose: Add data before the custom fields on the user profile when viewing
|
||||||
a private message
|
a private message
|
||||||
|
|
||||||
|
ucp_pm_viewmessage_message_content_before
|
||||||
|
===
|
||||||
|
* Locations:
|
||||||
|
+ styles/prosilver/template/ucp_pm_viewmessage.html
|
||||||
|
* Since: 3.3.16-RC1
|
||||||
|
* Purpose: Add content before the private message text
|
||||||
|
|
||||||
ucp_pm_viewmessage_options_before
|
ucp_pm_viewmessage_options_before
|
||||||
===
|
===
|
||||||
* Locations:
|
* Locations:
|
||||||
|
|
|
@ -42,7 +42,7 @@ $lang = array_merge($lang, array(
|
||||||
<br><br>
|
<br><br>
|
||||||
Our forums are powered by phpBB (hereinafter “they”, “them”, “their”, “phpBB software”, “www.phpbb.com”, “phpBB Limited”, “phpBB Teams”) which is a bulletin board solution released under the “<a href="http://opensource.org/licenses/gpl-2.0.php">GNU General Public License v2</a>” (hereinafter “GPL”) and can be downloaded from <a href="https://www.phpbb.com/">www.phpbb.com</a>. The phpBB software only facilitates internet based discussions; phpBB Limited is not responsible for what we allow and/or disallow as permissible content and/or conduct. For further information about phpBB, please see: <a href="https://www.phpbb.com/">https://www.phpbb.com/</a>.
|
Our forums are powered by phpBB (hereinafter “they”, “them”, “their”, “phpBB software”, “www.phpbb.com”, “phpBB Limited”, “phpBB Teams”) which is a bulletin board solution released under the “<a href="http://opensource.org/licenses/gpl-2.0.php">GNU General Public License v2</a>” (hereinafter “GPL”) and can be downloaded from <a href="https://www.phpbb.com/">www.phpbb.com</a>. The phpBB software only facilitates internet based discussions; phpBB Limited is not responsible for what we allow and/or disallow as permissible content and/or conduct. For further information about phpBB, please see: <a href="https://www.phpbb.com/">https://www.phpbb.com/</a>.
|
||||||
<br><br>
|
<br><br>
|
||||||
You agree not to post any abusive, obscene, vulgar, slanderous, hateful, threatening, sexually-orientated or any other material that may violate any laws be it of your country, the country where “%1$s” is hosted or International Law. Doing so may lead to you being immediately and permanently banned, with notification of your Internet Service Provider if deemed required by us. The IP address of all posts are recorded to aid in enforcing these conditions. You agree that “%1$s” have the right to remove, edit, move or close any topic at any time should we see fit. As a user you agree to any information you have entered to being stored in a database. While this information will not be disclosed to any third party without your consent, neither “%1$s” nor phpBB shall be held responsible for any hacking attempt that may lead to the data being compromised.
|
You agree not to post any abusive, obscene, vulgar, libellous, hateful, threatening, sexually-orientated or any other material that may violate any laws be it of your country, the country where “%1$s” is hosted or International Law. Doing so may lead to you being immediately and permanently banned, with notification of your Internet Service Provider if deemed required by us. The IP address of all posts are recorded to aid in enforcing these conditions. You agree that “%1$s” have the right to remove, edit, move or close any topic at any time should we see fit. As a user you agree to any information you have entered to being stored in a database. While this information will not be disclosed to any third party without your consent, neither “%1$s” nor phpBB shall be held responsible for any hacking attempt that may lead to the data being compromised.
|
||||||
',
|
',
|
||||||
|
|
||||||
'PRIVACY_POLICY' => 'This policy explains in detail how “%1$s” along with its affiliated companies (hereinafter “we”, “us”, “our”, “%1$s”, “%2$s”) and phpBB (hereinafter “they”, “them”, “their”, “phpBB software”, “www.phpbb.com”, “phpBB Limited”, “phpBB Teams”) use any information collected during any session of usage by you (hereinafter “your information”).
|
'PRIVACY_POLICY' => 'This policy explains in detail how “%1$s” along with its affiliated companies (hereinafter “we”, “us”, “our”, “%1$s”, “%2$s”) and phpBB (hereinafter “they”, “them”, “their”, “phpBB software”, “www.phpbb.com”, “phpBB Limited”, “phpBB Teams”) use any information collected during any session of usage by you (hereinafter “your information”).
|
||||||
|
|
|
@ -4,4 +4,4 @@
|
||||||
to hide visually and `aria-hidden="true"` to hide from screen-readers; using
|
to hide visually and `aria-hidden="true"` to hide from screen-readers; using
|
||||||
`hidden` or `display: none` would prevent the task from running.
|
`hidden` or `display: none` would prevent the task from running.
|
||||||
#}
|
#}
|
||||||
<img class="sr-only" aria-hidden="true" src="{{ CRON_TASK_URL|e('html_attr') }}" width="1" height="1" alt="">
|
<img class="sr-only" aria-hidden="true" src="{{ CRON_TASK_URL|e('url') }}" width="1" height="1" alt="">
|
||||||
|
|
|
@ -130,6 +130,7 @@
|
||||||
<!-- IF S_BCC_RECIPIENT --><br /><strong>{L_BCC}{L_COLON}</strong> <!-- BEGIN bcc_recipient --><!-- IF bcc_recipient.NAME_FULL -->{bcc_recipient.NAME_FULL}<!-- ELSE --><a href="{bcc_recipient.U_VIEW}"<!-- IF bcc_recipient.COLOUR --> style="color:{bcc_recipient.COLOUR};"<!-- ENDIF -->><strong>{bcc_recipient.NAME}</strong></a><!-- ENDIF --> <!-- END bcc_recipient --><!-- ENDIF -->
|
<!-- IF S_BCC_RECIPIENT --><br /><strong>{L_BCC}{L_COLON}</strong> <!-- BEGIN bcc_recipient --><!-- IF bcc_recipient.NAME_FULL -->{bcc_recipient.NAME_FULL}<!-- ELSE --><a href="{bcc_recipient.U_VIEW}"<!-- IF bcc_recipient.COLOUR --> style="color:{bcc_recipient.COLOUR};"<!-- ENDIF -->><strong>{bcc_recipient.NAME}</strong></a><!-- ENDIF --> <!-- END bcc_recipient --><!-- ENDIF -->
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
{% EVENT ucp_pm_viewmessage_message_content_before %}
|
||||||
|
|
||||||
<div class="content">{MESSAGE}</div>
|
<div class="content">{MESSAGE}</div>
|
||||||
|
|
||||||
|
|
142
tests/cron/wrapper_test.php
Normal file
142
tests/cron/wrapper_test.php
Normal file
|
@ -0,0 +1,142 @@
|
||||||
|
<?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.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
require_once __DIR__ . '/../template/template_test_case.php';
|
||||||
|
|
||||||
|
class phpbb_cron_wrapper_test extends phpbb_template_template_test_case
|
||||||
|
{
|
||||||
|
private $task;
|
||||||
|
private $routing_helper;
|
||||||
|
private $wrapper;
|
||||||
|
|
||||||
|
protected function setUp(): void
|
||||||
|
{
|
||||||
|
global $phpbb_root_path;
|
||||||
|
|
||||||
|
// Test the engine can be used
|
||||||
|
$this->setup_engine([], $phpbb_root_path . 'styles/all/template');
|
||||||
|
|
||||||
|
$this->template->clear_cache();
|
||||||
|
|
||||||
|
global $phpbb_filesystem;
|
||||||
|
|
||||||
|
$phpbb_filesystem = new \phpbb\filesystem\filesystem();
|
||||||
|
|
||||||
|
$this->task = $this->createMock(\phpbb\cron\task\task::class);
|
||||||
|
$this->routing_helper = $this->createMock(\phpbb\routing\helper::class);
|
||||||
|
|
||||||
|
$this->wrapper = new \phpbb\cron\task\wrapper(
|
||||||
|
$this->task,
|
||||||
|
$this->routing_helper,
|
||||||
|
'/phpbb/',
|
||||||
|
'php',
|
||||||
|
$this->template
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function test_generate_template_pagination()
|
||||||
|
{
|
||||||
|
$this->task = $this->createMock(\phpbb\cron\task\parametrized::class);
|
||||||
|
$this->task->expects($this->any())
|
||||||
|
->method('get_parameters')
|
||||||
|
->willReturn(['f' => '5']);
|
||||||
|
$this->task->expects($this->any())
|
||||||
|
->method('get_name')
|
||||||
|
->willReturn('test_task');
|
||||||
|
$this->routing_helper = $this->createMock(\phpbb\routing\helper::class);
|
||||||
|
$this->routing_helper->expects($this->any())
|
||||||
|
->method('route')
|
||||||
|
->with('phpbb_cron_run', ['cron_type' => 'test_task', 'f' => '5'])
|
||||||
|
->willReturn('app.php/cron/foo?f=5');
|
||||||
|
|
||||||
|
$this->wrapper = new \phpbb\cron\task\wrapper(
|
||||||
|
$this->task,
|
||||||
|
$this->routing_helper,
|
||||||
|
'/phpbb/',
|
||||||
|
'php',
|
||||||
|
$this->template
|
||||||
|
);
|
||||||
|
|
||||||
|
$this->assertEquals('<img class="sr-only" aria-hidden="true" src="app.php%2Fcron%2Ffoo%3Ff%3D5" width="1" height="1" alt="">', str_replace(["\n", "\t"], '', $this->wrapper->get_html_tag()));
|
||||||
|
}
|
||||||
|
|
||||||
|
public function test_is_parametrized_false()
|
||||||
|
{
|
||||||
|
$this->assertFalse($this->wrapper->is_parametrized());
|
||||||
|
}
|
||||||
|
|
||||||
|
public function test_is_ready()
|
||||||
|
{
|
||||||
|
$this->task->method('is_runnable')->willReturn(true);
|
||||||
|
$this->task->method('should_run')->willReturn(true);
|
||||||
|
|
||||||
|
$this->assertTrue($this->wrapper->is_ready());
|
||||||
|
}
|
||||||
|
|
||||||
|
public function test_get_url_non_parametrized()
|
||||||
|
{
|
||||||
|
$this->task->method('get_name')->willReturn('test_task');
|
||||||
|
$this->routing_helper->expects($this->once())
|
||||||
|
->method('route')
|
||||||
|
->with('phpbb_cron_run', ['cron_type' => 'test_task'])
|
||||||
|
->willReturn('/cron/url');
|
||||||
|
|
||||||
|
$this->assertEquals('/cron/url', $this->wrapper->get_url());
|
||||||
|
}
|
||||||
|
|
||||||
|
public function test_get_html_tag()
|
||||||
|
{
|
||||||
|
$this->template = $this->createMock(\phpbb\template\template::class);
|
||||||
|
$this->wrapper = new \phpbb\cron\task\wrapper(
|
||||||
|
$this->task,
|
||||||
|
$this->routing_helper,
|
||||||
|
'/phpbb/',
|
||||||
|
'php',
|
||||||
|
$this->template
|
||||||
|
);
|
||||||
|
|
||||||
|
$this->template->expects($this->once())
|
||||||
|
->method('set_filenames');
|
||||||
|
$this->template->expects($this->once())
|
||||||
|
->method('assign_var');
|
||||||
|
$this->template->expects($this->once())
|
||||||
|
->method('assign_display')
|
||||||
|
->willReturn('<img src="cron">');
|
||||||
|
|
||||||
|
$this->assertEquals('<img src="cron">', $this->wrapper->get_html_tag());
|
||||||
|
}
|
||||||
|
|
||||||
|
public function test_call_forwards_to_task()
|
||||||
|
{
|
||||||
|
$this->task = $this->getMockBuilder(\phpbb\cron\task\task::class)
|
||||||
|
->disableOriginalConstructor()
|
||||||
|
->setMethods(['get_name', 'run', 'is_runnable', 'should_run', 'some_method'])
|
||||||
|
->getMock();
|
||||||
|
$this->routing_helper = $this->createMock(\phpbb\routing\helper::class);
|
||||||
|
|
||||||
|
$this->wrapper = new \phpbb\cron\task\wrapper(
|
||||||
|
$this->task,
|
||||||
|
$this->routing_helper,
|
||||||
|
'/phpbb/',
|
||||||
|
'php',
|
||||||
|
$this->template
|
||||||
|
);
|
||||||
|
$this->task->expects($this->once())
|
||||||
|
->method('some_method')
|
||||||
|
->with('arg1', 'arg2')
|
||||||
|
->willReturn('result');
|
||||||
|
|
||||||
|
$result = $this->wrapper->some_method('arg1', 'arg2');
|
||||||
|
$this->assertEquals('result', $result);
|
||||||
|
}
|
||||||
|
}
|
|
@ -15,7 +15,7 @@ require_once __DIR__ . '/template_test_case.php';
|
||||||
|
|
||||||
class phpbb_template_extension_test extends phpbb_template_template_test_case
|
class phpbb_template_extension_test extends phpbb_template_template_test_case
|
||||||
{
|
{
|
||||||
protected function setup_engine(array $new_config = array())
|
protected function setup_engine(array $new_config = array(), string $template_path = '')
|
||||||
{
|
{
|
||||||
global $config, $phpbb_container, $phpbb_dispatcher, $phpbb_root_path, $phpEx;
|
global $config, $phpbb_container, $phpbb_dispatcher, $phpbb_root_path, $phpEx;
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,7 @@ class phpbb_template_template_includecss_test extends phpbb_template_template_te
|
||||||
/** @var string */
|
/** @var string */
|
||||||
protected $parent_template_path;
|
protected $parent_template_path;
|
||||||
|
|
||||||
protected function setup_engine(array $new_config = array())
|
protected function setup_engine(array $new_config = array(), string $template_path = '')
|
||||||
{
|
{
|
||||||
global $phpbb_root_path, $phpEx, $user;
|
global $phpbb_root_path, $phpEx, $user;
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
use phpbb\template\twig\twig;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* This file is part of the phpBB Forum Software package.
|
* This file is part of the phpBB Forum Software package.
|
||||||
|
@ -14,6 +17,7 @@
|
||||||
class phpbb_template_template_test_case extends phpbb_test_case
|
class phpbb_template_template_test_case extends phpbb_test_case
|
||||||
{
|
{
|
||||||
protected $lang;
|
protected $lang;
|
||||||
|
/** @var twig */
|
||||||
protected $template;
|
protected $template;
|
||||||
protected $template_path;
|
protected $template_path;
|
||||||
protected $user;
|
protected $user;
|
||||||
|
@ -69,7 +73,7 @@ class phpbb_template_template_test_case extends phpbb_test_case
|
||||||
return $defaults;
|
return $defaults;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function setup_engine(array $new_config = array())
|
protected function setup_engine(array $new_config = array(), string $template_path = '')
|
||||||
{
|
{
|
||||||
global $phpbb_root_path, $phpEx;
|
global $phpbb_root_path, $phpEx;
|
||||||
|
|
||||||
|
@ -92,7 +96,7 @@ class phpbb_template_template_test_case extends phpbb_test_case
|
||||||
$phpEx
|
$phpEx
|
||||||
);
|
);
|
||||||
|
|
||||||
$this->template_path = $this->test_path . '/templates';
|
$this->template_path = $template_path ?: $this->test_path . '/templates';
|
||||||
|
|
||||||
$container = new phpbb_mock_container_builder();
|
$container = new phpbb_mock_container_builder();
|
||||||
$cache_path = $phpbb_root_path . 'cache/twig';
|
$cache_path = $phpbb_root_path . 'cache/twig';
|
||||||
|
|
|
@ -15,7 +15,7 @@ require_once __DIR__ . '/template_test_case.php';
|
||||||
|
|
||||||
class phpbb_template_template_test_case_with_tree extends phpbb_template_template_test_case
|
class phpbb_template_template_test_case_with_tree extends phpbb_template_template_test_case
|
||||||
{
|
{
|
||||||
protected function setup_engine(array $new_config = array())
|
protected function setup_engine(array $new_config = array(), string $template_path = '')
|
||||||
{
|
{
|
||||||
global $phpbb_root_path, $phpEx, $user;
|
global $phpbb_root_path, $phpEx, $user;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue