From f4b9a7143cac8551cf32dc967c2eae6fee62371d Mon Sep 17 00:00:00 2001 From: kasimi Date: Sat, 18 Apr 2020 01:24:39 +0200 Subject: [PATCH] [ticket/16449] Fixed tests PHPBB3-16449 --- .../phpbb_functional_test_case.php | 21 +++++++++++-------- tests/test_framework/phpbb_ui_test_case.php | 21 +++++++++++-------- 2 files changed, 24 insertions(+), 18 deletions(-) diff --git a/tests/test_framework/phpbb_functional_test_case.php b/tests/test_framework/phpbb_functional_test_case.php index 19062aa148..94a7d4e7af 100644 --- a/tests/test_framework/phpbb_functional_test_case.php +++ b/tests/test_framework/phpbb_functional_test_case.php @@ -418,17 +418,18 @@ class phpbb_functional_test_case extends phpbb_test_case public function install_ext($extension) { + $this->add_lang('acp/extensions'); + $this->login(); $this->admin_login(); $ext_path = str_replace('/', '%2F', $extension); $crawler = self::request('GET', 'adm/index.php?i=acp_extensions&mode=main&action=enable_pre&ext_name=' . $ext_path . '&sid=' . $this->sid); - $this->assertGreaterThan(1, $crawler->filter('div.main fieldset div input.button2')->count()); + $this->assertGreaterThan(1, $crawler->filter('div.main fieldset.submit-buttons input')->count()); - $form = $crawler->selectButton('confirm')->form(); + $form = $crawler->selectButton($this->lang('EXTENSION_ENABLE'))->form(); $crawler = self::submit($form); - $this->add_lang('acp/extensions'); $meta_refresh = $crawler->filter('meta[http-equiv="refresh"]'); @@ -448,17 +449,18 @@ class phpbb_functional_test_case extends phpbb_test_case public function disable_ext($extension) { + $this->add_lang('acp/extensions'); + $this->login(); $this->admin_login(); $ext_path = str_replace('/', '%2F', $extension); $crawler = self::request('GET', 'adm/index.php?i=acp_extensions&mode=main&action=disable_pre&ext_name=' . $ext_path . '&sid=' . $this->sid); - $this->assertGreaterThan(1, $crawler->filter('div.main fieldset div input.button2')->count()); + $this->assertGreaterThan(1, $crawler->filter('div.main fieldset.submit-buttons input')->count()); - $form = $crawler->selectButton('confirm')->form(); + $form = $crawler->selectButton($this->lang('EXTENSION_DISABLE'))->form(); $crawler = self::submit($form); - $this->add_lang('acp/extensions'); $meta_refresh = $crawler->filter('meta[http-equiv="refresh"]'); @@ -478,17 +480,18 @@ class phpbb_functional_test_case extends phpbb_test_case public function delete_ext_data($extension) { + $this->add_lang('acp/extensions'); + $this->login(); $this->admin_login(); $ext_path = str_replace('/', '%2F', $extension); $crawler = self::request('GET', 'adm/index.php?i=acp_extensions&mode=main&action=delete_data_pre&ext_name=' . $ext_path . '&sid=' . $this->sid); - $this->assertGreaterThan(1, $crawler->filter('div.main fieldset div input.button2')->count()); + $this->assertGreaterThan(1, $crawler->filter('div.main fieldset.submit-buttons input')->count()); - $form = $crawler->selectButton('confirm')->form(); + $form = $crawler->selectButton($this->lang('EXTENSION_DELETE_DATA'))->form(); $crawler = self::submit($form); - $this->add_lang('acp/extensions'); $meta_refresh = $crawler->filter('meta[http-equiv="refresh"]'); diff --git a/tests/test_framework/phpbb_ui_test_case.php b/tests/test_framework/phpbb_ui_test_case.php index 243db39d69..f593e13b18 100644 --- a/tests/test_framework/phpbb_ui_test_case.php +++ b/tests/test_framework/phpbb_ui_test_case.php @@ -333,16 +333,17 @@ class phpbb_ui_test_case extends phpbb_test_case public function install_ext($extension) { + $this->add_lang('acp/extensions'); + $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($this->find_element('cssSelector', 'div.main fieldset div input.button2'))); + $this->assertNotEmpty(count($this->find_element('cssSelector', 'div.main fieldset.submit-buttons input.button2'))); - $this->find_element('cssSelector', "input[value='Yes']")->submit(); - $this->add_lang('acp/extensions'); + $this->find_element('cssSelector', "input[value='" . $this->lang('EXTENSION_ENABLE') . "']")->submit(); try { @@ -368,16 +369,17 @@ class phpbb_ui_test_case extends phpbb_test_case public function disable_ext($extension) { + $this->add_lang('acp/extensions'); + $this->login(); $this->admin_login(); $ext_path = str_replace('/', '%2F', $extension); $this->visit('adm/index.php?i=acp_extensions&mode=main&action=disable_pre&ext_name=' . $ext_path . '&sid=' . $this->sid); - $this->assertNotEmpty(count($this->find_element('cssSelector', 'div.main fieldset div input.button2'))); + $this->assertNotEmpty(count($this->find_element('cssSelector', 'div.main fieldset.submit-buttons input.button2'))); - $this->find_element('cssSelector', "input[value='Yes']")->submit(); - $this->add_lang('acp/extensions'); + $this->find_element('cssSelector', "input[value='" . $this->lang('EXTENSION_DISABLE') . "']")->submit(); try { @@ -403,16 +405,17 @@ class phpbb_ui_test_case extends phpbb_test_case public function delete_ext_data($extension) { + $this->add_lang('acp/extensions'); + $this->login(); $this->admin_login(); $ext_path = str_replace('/', '%2F', $extension); $this->visit('adm/index.php?i=acp_extensions&mode=main&action=delete_data_pre&ext_name=' . $ext_path . '&sid=' . $this->sid); - $this->assertNotEmpty(count($this->find_element('cssSelector', 'div.main fieldset div input.button2'))); + $this->assertNotEmpty(count($this->find_element('cssSelector', 'div.main fieldset.submit-buttons input.button2'))); - $this->find_element('cssSelector', "input[value='Yes']")->submit(); - $this->add_lang('acp/extensions'); + $this->find_element('cssSelector', "input[value='" . $this->lang('EXTENSION_DELETE_DATA') . "']")->submit(); try {