[ticket/469] Enable portal on all pages in subsilver2 & add tests
B3P-469
This commit is contained in:
@@ -53,4 +53,59 @@ class phpbb_functional_portal_no_error_test extends \board3\portal\tests\testfra
|
||||
$this->assertContains('subsilver', $crawler->text());
|
||||
self::request('GET', 'app.php/portal?style=2');
|
||||
}
|
||||
|
||||
public function data_portal_all_pages()
|
||||
{
|
||||
return array(
|
||||
array(1),
|
||||
array(2),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider data_portal_all_pages
|
||||
* @dependsOn test_enable_subsilver
|
||||
*/
|
||||
public function test_portal_all_pages($style_id)
|
||||
{
|
||||
$crawler = self::request('GET', 'index.php?style=' . $style_id);
|
||||
$this->assertNotContains('Menu', $crawler->text());
|
||||
|
||||
$crawler = self::request('GET', 'adm/index.php?i=-board3-portal-acp-portal_module&mode=config&sid=' . $this->sid);
|
||||
|
||||
$form = $crawler->selectButton('submit')->form(array(
|
||||
'config[board3_show_all_pages]' => 1,
|
||||
'board3_show_all_side' => 0,
|
||||
));
|
||||
$crawler = self::submit($form);
|
||||
$this->assertContainsLang('CONFIG_UPDATED', $crawler->text());
|
||||
|
||||
$crawler = self::request('GET', 'index.php?style=' . $style_id);
|
||||
$this->assertContains('Menu', $crawler->text());
|
||||
|
||||
$crawler = self::request('GET', 'adm/index.php?i=-board3-portal-acp-portal_module&mode=config&sid=' . $this->sid);
|
||||
|
||||
$form = $crawler->selectButton('submit')->form(array(
|
||||
'config[board3_show_all_pages]' => 1,
|
||||
'board3_show_all_side' => 1,
|
||||
));
|
||||
$crawler = self::submit($form);
|
||||
$this->assertContainsLang('CONFIG_UPDATED', $crawler->text());
|
||||
|
||||
$crawler = self::request('GET', 'index.php?style=' . $style_id);
|
||||
$this->assertNotContains('Board Style', $crawler->text());
|
||||
$this->assertContains('User menu', $crawler->text());
|
||||
|
||||
$crawler = self::request('GET', 'adm/index.php?i=-board3-portal-acp-portal_module&mode=config&sid=' . $this->sid);
|
||||
|
||||
$form = $crawler->selectButton('submit')->form(array(
|
||||
'config[board3_show_all_pages]' => 0,
|
||||
'board3_show_all_side' => 0,
|
||||
));
|
||||
$crawler = self::submit($form);
|
||||
$this->assertContainsLang('CONFIG_UPDATED', $crawler->text());
|
||||
|
||||
$crawler = self::request('GET', 'index.php?style=' . $style_id);
|
||||
$this->assertNotContains('Menu', $crawler->text());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user