diff options
author | Joas Schilling <nickvergessen@gmx.de> | 2014-11-21 20:20:45 +0100 |
---|---|---|
committer | Joas Schilling <nickvergessen@gmx.de> | 2014-11-21 20:20:45 +0100 |
commit | a1917086017e3d59f229223edf52eddd72a08b24 (patch) | |
tree | b9dd8cec356444bd073a17c54c45d2dbdcd7c364 /tests/functional | |
parent | 90a5d29523ba699c8cbd97a9fe59bd8c1946a4ea (diff) | |
parent | 973c2a9a3aaad10ec589a9ef5e53862b1543f8f6 (diff) | |
download | forums-a1917086017e3d59f229223edf52eddd72a08b24.tar forums-a1917086017e3d59f229223edf52eddd72a08b24.tar.gz forums-a1917086017e3d59f229223edf52eddd72a08b24.tar.bz2 forums-a1917086017e3d59f229223edf52eddd72a08b24.tar.xz forums-a1917086017e3d59f229223edf52eddd72a08b24.zip |
Merge branch 'develop-ascraeus' into develop
Diffstat (limited to 'tests/functional')
-rw-r--r-- | tests/functional/acp_registration_test.php | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/tests/functional/acp_registration_test.php b/tests/functional/acp_registration_test.php new file mode 100644 index 0000000000..ef9843679e --- /dev/null +++ b/tests/functional/acp_registration_test.php @@ -0,0 +1,55 @@ +<?php +/** +* +* This file is part of the phpBB Forum Software package. +* +* @copyright (c) phpBB Limited <https://www.phpbb.com> +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +/** +* @group functional +*/ +class phpbb_functional_acp_registration_test extends phpbb_functional_test_case +{ + protected function set_email_enable($db, $status) + { + $sql = "UPDATE phpbb_config + SET config_value = '" . (($status) ? '1' : '0') . "' + WHERE config_name = 'email_enable'"; + $db->sql_query($sql); + + $this->purge_cache(); + } + + public function test_submitting_activation_method() + { + $db = $this->get_db(); + + $this->set_email_enable($db, false); + + $this->add_lang('acp/board'); + $this->login(); + $this->admin_login(); + + $crawler = self::request('GET', 'adm/index.php?i=acp_board&mode=registration&sid=' . $this->sid); + $this->assertContainsLang('ACP_REGISTER_SETTINGS_EXPLAIN', $this->get_content()); + + $form = $crawler->selectButton($this->lang('SUBMIT'))->form(); + $form['config[require_activation]']->select(USER_ACTIVATION_ADMIN); + $crawler = self::submit($form); + $this->assertContainsLang('ACC_ACTIVATION_WARNING', $crawler->filter('div.main')->text()); + + $crawler = self::request('GET', 'adm/index.php?i=acp_board&mode=registration&sid=' . $this->sid); + $form = $crawler->selectButton($this->lang('SUBMIT'))->form(); + $form['config[require_activation]']->select(USER_ACTIVATION_NONE); + $crawler = self::submit($form); + $this->assertNotContainsLang('ACC_ACTIVATION_WARNING', $crawler->filter('div.main')->text()); + + $this->set_email_enable($db, true); + } +} |