[ticket/181] Correctly check if Board3 Portal extension is disabled
This commit is contained in:
@@ -23,17 +23,24 @@ class phpbb_functional_portal_redirect_test extends \board3\portal\tests\testfra
|
||||
|
||||
protected function enable_board3_portal_ext()
|
||||
{
|
||||
$enable_portal = false;
|
||||
$crawler = self::request('GET', 'adm/index.php?i=acp_extensions&mode=main&sid=' . $this->sid);
|
||||
$crawler->filter('tr.ext_disabled')->each(function ($node, $i)
|
||||
$disabled_extensions = $crawler->filter('tr.ext_disabled')->extract(array('_text'));
|
||||
foreach ($disabled_extensions as $extension)
|
||||
{
|
||||
if (strpos($node->text(), 'Board3 Portal') !== false)
|
||||
if (strpos($extension, 'Board3 Portal') !== false)
|
||||
{
|
||||
$enable_portal = true;
|
||||
}
|
||||
}
|
||||
|
||||
if ($enable_portal)
|
||||
{
|
||||
$crawler = self::request('GET', 'adm/index.php?i=acp_extensions&mode=main&action=enable_pre&ext_name=board3%2fportal&sid=' . $this->sid);
|
||||
$form = $crawler->selectButton('Enable')->form();
|
||||
$crawler = self::submit($form);
|
||||
$this->assertContains('The extension was enabled successfully', $crawler->text());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public function test_redirect()
|
||||
|
||||
Reference in New Issue
Block a user