mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-30 21:40:43 +02:00
Merge branch 'develop' of https://github.com/phpbb/phpbb into feature/passwords
Conflicts: phpBB/config/services.yml
This commit is contained in:
@@ -869,9 +869,10 @@ class phpbb_functional_test_case extends phpbb_test_case
|
||||
* @param string $subject
|
||||
* @param string $message
|
||||
* @param array $additional_form_data Any additional form data to be sent in the request
|
||||
* @return array post_id, topic_id
|
||||
* @param string $expected Lang var of expected message after posting
|
||||
* @return array|null post_id, topic_id if message is 'POST_STORED'
|
||||
*/
|
||||
public function create_topic($forum_id, $subject, $message, $additional_form_data = array())
|
||||
public function create_topic($forum_id, $subject, $message, $additional_form_data = array(), $expected = 'POST_STORED')
|
||||
{
|
||||
$posting_url = "posting.php?mode=post&f={$forum_id}&sid={$this->sid}";
|
||||
|
||||
@@ -881,7 +882,7 @@ class phpbb_functional_test_case extends phpbb_test_case
|
||||
'post' => true,
|
||||
), $additional_form_data);
|
||||
|
||||
return self::submit_post($posting_url, 'POST_TOPIC', $form_data);
|
||||
return self::submit_post($posting_url, 'POST_TOPIC', $form_data, $expected);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -894,9 +895,10 @@ class phpbb_functional_test_case extends phpbb_test_case
|
||||
* @param string $subject
|
||||
* @param string $message
|
||||
* @param array $additional_form_data Any additional form data to be sent in the request
|
||||
* @return array post_id, topic_id
|
||||
* @param string $expected Lang var of expected message after posting
|
||||
* @return array|null post_id, topic_id if message is 'POST_STORED'
|
||||
*/
|
||||
public function create_post($forum_id, $topic_id, $subject, $message, $additional_form_data = array())
|
||||
public function create_post($forum_id, $topic_id, $subject, $message, $additional_form_data = array(), $expected = 'POST_STORED')
|
||||
{
|
||||
$posting_url = "posting.php?mode=reply&f={$forum_id}&t={$topic_id}&sid={$this->sid}";
|
||||
|
||||
@@ -906,7 +908,7 @@ class phpbb_functional_test_case extends phpbb_test_case
|
||||
'post' => true,
|
||||
), $additional_form_data);
|
||||
|
||||
return self::submit_post($posting_url, 'POST_REPLY', $form_data);
|
||||
return self::submit_post($posting_url, 'POST_REPLY', $form_data, $expected);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -915,9 +917,10 @@ class phpbb_functional_test_case extends phpbb_test_case
|
||||
* @param string $posting_url
|
||||
* @param string $posting_contains
|
||||
* @param array $form_data
|
||||
* @return array post_id, topic_id
|
||||
* @param string $expected Lang var of expected message after posting
|
||||
* @return array|null post_id, topic_id if message is 'POST_STORED'
|
||||
*/
|
||||
protected function submit_post($posting_url, $posting_contains, $form_data)
|
||||
protected function submit_post($posting_url, $posting_contains, $form_data, $expected = 'POST_STORED')
|
||||
{
|
||||
$this->add_lang('posting');
|
||||
|
||||
@@ -946,7 +949,12 @@ class phpbb_functional_test_case extends phpbb_test_case
|
||||
// contained in one of the actual form fields that the browser sees (i.e. it ignores "hidden" inputs)
|
||||
// Instead, I send it as a request with the submit button "post" set to true.
|
||||
$crawler = self::request('POST', $posting_url, $form_data);
|
||||
$this->assertContains($this->lang('POST_STORED'), $crawler->filter('html')->text());
|
||||
$this->assertContainsLang($expected, $crawler->filter('html')->text());
|
||||
|
||||
if ($expected !== 'POST_STORED')
|
||||
{
|
||||
return;
|
||||
}
|
||||
$url = $crawler->selectLink($this->lang('VIEW_MESSAGE', '', ''))->link()->getUri();
|
||||
|
||||
return array(
|
||||
|
@@ -19,6 +19,19 @@ abstract class phpbb_session_test_case extends phpbb_database_test_case
|
||||
function setUp()
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
global $symfony_request, $phpbb_filesystem, $phpbb_path_helper, $request, $phpbb_root_path, $phpEx;
|
||||
$symfony_request = new \phpbb\symfony_request(
|
||||
new phpbb_mock_request()
|
||||
);
|
||||
$phpbb_filesystem = new \phpbb\filesystem();
|
||||
$phpbb_path_helper = new \phpbb\path_helper(
|
||||
$symfony_request,
|
||||
$phpbb_filesystem,
|
||||
$phpbb_root_path,
|
||||
$phpEx
|
||||
);
|
||||
|
||||
$this->session_factory = new phpbb_session_testable_factory;
|
||||
$this->db = $this->new_dbal();
|
||||
$this->session_facade =
|
||||
|
@@ -158,6 +158,11 @@ class phpbb_test_case_helpers
|
||||
{
|
||||
$config['redis_port'] = $phpbb_redis_port;
|
||||
}
|
||||
|
||||
if (isset($fulltext_sphinx_id))
|
||||
{
|
||||
$config['fulltext_sphinx_id'] = $fulltext_sphinx_id;
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($_SERVER['PHPBB_TEST_DBMS']))
|
||||
|
Reference in New Issue
Block a user