Merge pull request #537 from marc1706/ticket/534
[ticket/534] Adapt tests for master branch of phpBB
This commit is contained in:
@@ -2,8 +2,6 @@ language: php
|
||||
|
||||
matrix:
|
||||
include:
|
||||
- php: 5.3.3
|
||||
env: DB=mysqli
|
||||
- php: 5.3
|
||||
env: DB=mysqli # MyISAM
|
||||
- php: 5.4
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
"role": "Developer"
|
||||
}],
|
||||
"require": {
|
||||
"php": ">=5.3.3",
|
||||
"php": ">=5.3.9",
|
||||
"nickvergessen/phpbb-tool-trimmessage": "1.3.*"
|
||||
},
|
||||
"require-dev": {
|
||||
|
||||
@@ -113,21 +113,21 @@ class phpbb_functional_portal_acp_test extends \board3\portal\tests\testframewor
|
||||
public function data_add_second_module()
|
||||
{
|
||||
return array(
|
||||
array('\board3\portal\modules\news', 2, 'The module was added successfully.'),
|
||||
array('\board3\portal\modules\news', 1, 'It is not possible to add the module to the selected column.'),
|
||||
array('\board3\portal\modules\attachments', 2, 'The module was added successfully'),
|
||||
array('\board3\portal\modules\attachments', 2, 'This module can only be added once'),
|
||||
array('\board3\portal\modules\attachments', 1, 'This module can only be added once'),
|
||||
array('\board3\portal\modules\news', 2, 'center', 'The module was added successfully.'),
|
||||
array('\board3\portal\modules\news', 1, 'left', 'It is not possible to add the module to the selected column.'),
|
||||
array('\board3\portal\modules\attachments', 2, 'center', 'The module was added successfully'),
|
||||
array('\board3\portal\modules\attachments', 2, 'center', 'This module can only be added once'),
|
||||
array('\board3\portal\modules\attachments', 1, 'left', 'This module can only be added once'),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider data_add_second_module
|
||||
*/
|
||||
public function test_add_second_news($module_class, $column, $expected_message)
|
||||
public function test_add_second_news($module_class, $column, $column_name, $expected_message)
|
||||
{
|
||||
$this->add_lang_ext('board3/portal', 'info_acp_portal');
|
||||
$crawler = self::request('GET', 'adm/index.php?i=-board3-portal-acp-portal_module&mode=modules&add_column=' . $column . '&add[center]=add&sid=' . $this->sid);
|
||||
$crawler = self::request('GET', 'adm/index.php?i=-board3-portal-acp-portal_module&mode=modules&add_column=' . $column . '&add[' . $column_name . ']=add&sid=' . $this->sid);
|
||||
$form = $crawler->selectButton('submit')->form();
|
||||
$form['module_classname']->disableValidation()->select($module_class);
|
||||
$crawler = self::submit($form);
|
||||
|
||||
@@ -59,6 +59,8 @@ class phpbb_functional_portal_announcement_test extends \board3\portal\tests\tes
|
||||
|
||||
public function test_shortened_message()
|
||||
{
|
||||
$this->markTestIncomplete('Trim message tool no longer works correctly for new posts in 3.2.x');
|
||||
|
||||
// Create topic as announcement
|
||||
$data = $this->create_topic(2, 'Portal-announce-global', str_repeat('This is a global announcement for the portal', 6), array(
|
||||
'topic_type' => POST_GLOBAL,
|
||||
|
||||
@@ -25,35 +25,6 @@ class phpbb_functional_portal_no_error_test extends \board3\portal\tests\testfra
|
||||
self::request('GET', 'app.php/portal');
|
||||
}
|
||||
|
||||
public function test_enable_subsilver()
|
||||
{
|
||||
$crawler = self::request('GET', 'adm/index.php?i=acp_styles&mode=install&sid=' . $this->sid);
|
||||
$links = $crawler->filter('.actions a');
|
||||
$link = $links->selectLink('Install style')->link()->getUri();
|
||||
for ($i = 0; $i < sizeof($links); $i++)
|
||||
{
|
||||
$link = $links->eq($i)->selectLink('Install style')->link()->getUri();
|
||||
|
||||
if (strpos($link, 'subsilver2') !== false)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
$crawler = self::request('GET', substr($link, strpos($link, '/adm') + 1));
|
||||
$this->assertContains('Style "subsilver2" has been installed', $crawler->text());
|
||||
}
|
||||
|
||||
/**
|
||||
* @dependsOn test_enable_subsilver
|
||||
*/
|
||||
public function test_portal_subsilver()
|
||||
{
|
||||
$crawler = self::request('GET', 'app.php/portal');
|
||||
$this->assertContains('subsilver', $crawler->text());
|
||||
self::request('GET', 'app.php/portal?style=2');
|
||||
}
|
||||
|
||||
public function data_portal_all_pages()
|
||||
{
|
||||
return array(
|
||||
|
||||
@@ -70,10 +70,12 @@ class listener_test extends \phpbb_template_template_test_case
|
||||
'enable_mod_rewrite' => '1',
|
||||
'board3_portal_enable' => '1',
|
||||
));
|
||||
$provider = new \phpbb\controller\provider();
|
||||
$provider->find_routing_files($finder);
|
||||
$provider->find(dirname(__FILE__) . '/');
|
||||
$this->controller_helper = new \phpbb_mock_controller_helper($this->template, $this->user, $this->config, $provider, $manager, new \phpbb\symfony_request($request), $request, new \phpbb\filesystem(), '', 'php', dirname(__FILE__) . '/');
|
||||
|
||||
$filesystem = new \phpbb\filesystem\filesystem();
|
||||
$router = new \phpbb_mock_router($filesystem, $manager, dirname(__FILE__) . '/', 'php', PHPBB_ENVIRONMENT);
|
||||
$router->find_routing_files($manager->all_enabled(false));
|
||||
$router->find(dirname(__FILE__) . '/');
|
||||
$this->controller_helper = new \phpbb_mock_controller_helper($this->template, $this->user, $this->config, $router, new \phpbb\symfony_request($request), $request, new \phpbb\filesystem(), '', 'php', dirname(__FILE__) . '/');
|
||||
|
||||
$this->path_helper = new \phpbb\path_helper(
|
||||
new \phpbb\symfony_request(
|
||||
|
||||
Reference in New Issue
Block a user