phpbb_ui_test_case::install_ext PHP Method

install_ext() public method

public install_ext ( $extension )
    public function install_ext($extension)
    {
        $this->login();
        $this->admin_login();
        $ext_path = str_replace('/', '%2F', $extension);
        $this->visit('adm/index.php?i=acp_extensions&mode=main&action=enable_pre&ext_name=' . $ext_path . '&sid=' . $this->sid);
        $this->assertNotEmpty(count(self::find_element('cssSelector', '.submit-buttons')));
        self::find_element('cssSelector', "input[value='Enable']")->submit();
        $this->add_lang('acp/extensions');
        try {
            $meta_refresh = self::find_element('cssSelector', 'meta[http-equiv="refresh"]');
            // Wait for extension to be fully enabled
            while (sizeof($meta_refresh)) {
                preg_match('#url=.+/(adm+.+)#', $meta_refresh->getAttribute('content'), $match);
                self::$webDriver->execute(array('method' => 'post', 'url' => $match[1]));
                $meta_refresh = self::find_element('cssSelector', 'meta[http-equiv="refresh"]');
            }
        } catch (\Facebook\WebDriver\Exception\NoSuchElementException $e) {
            // Probably no refresh triggered
        }
        $this->assertContainsLang('EXTENSION_ENABLE_SUCCESS', self::find_element('cssSelector', 'div.successbox')->getText());
        $this->logout();
    }