aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/functional/notification_test.php2
-rw-r--r--tests/functional/user_password_reset_test.php43
-rw-r--r--tests/functions/user_delete_test.php1
3 files changed, 45 insertions, 1 deletions
diff --git a/tests/functional/notification_test.php b/tests/functional/notification_test.php
index 5c6b87d50b..8751de8016 100644
--- a/tests/functional/notification_test.php
+++ b/tests/functional/notification_test.php
@@ -82,6 +82,6 @@ class phpbb_functional_notification_test extends phpbb_functional_test_case
// Get form token
$link = $crawler->selectLink($this->lang('NOTIFICATIONS_MARK_ALL_READ'))->link()->getUri();
$crawler = self::request('GET', substr($link, strpos($link, 'ucp.')));
- $this->assertEquals(0, $crawler->filter('#notification_list_button strong')->text());
+ $this->assertCount(0, $crawler->filter('#notification_list_button strong'));
}
}
diff --git a/tests/functional/user_password_reset_test.php b/tests/functional/user_password_reset_test.php
index f9406f0eb5..3da78407cf 100644
--- a/tests/functional/user_password_reset_test.php
+++ b/tests/functional/user_password_reset_test.php
@@ -113,6 +113,49 @@ class phpbb_functional_user_password_reset_test extends phpbb_functional_test_ca
$this->assertContains($this->lang('LOGIN_ERROR_PASSWORD', '', ''), $crawler->filter('html')->text());
}
+ /**
+ * @depends test_login
+ */
+ public function test_acivateAfterDeactivate()
+ {
+ // User is active, actkey should not exist
+ $this->get_user_data();
+ $this->assertEmpty($this->user_data['user_actkey']);
+
+ $this->login();
+ $this->admin_login();
+ $this->add_lang('acp/users');
+
+ // Go to user account page
+ $crawler = self::request('GET', 'adm/index.php?i=acp_users&mode=overview&sid=' . $this->sid);
+ $this->assertContainsLang('FIND_USERNAME', $crawler->filter('html')->text());
+
+ $form = $crawler->selectButton('Submit')->form();
+ $crawler = self::submit($form, array('username' => 'reset-password-test-user'));
+
+ // Deactivate account and go back to overview of current user
+ $this->assertContainsLang('USER_TOOLS', $crawler->filter('html')->text());
+ $form = $crawler->filter('input[name=update]')->selectButton('Submit')->form();
+ $crawler = self::submit($form, array('action' => 'active'));
+
+ $this->assertContainsLang('USER_ADMIN_DEACTIVED', $crawler->filter('html')->text());
+ $link = $crawler->selectLink('Back to previous page')->link();
+ $crawler = self::request('GET', preg_replace('#(.+)(adm/index.php.+)#', '$2', $link->getUri()));
+
+ // Ensure again that actkey is empty after deactivation
+ $this->get_user_data();
+ $this->assertEmpty($this->user_data['user_actkey']);
+
+ // Force reactivation of account and check that act key is not empty anymore
+ $this->assertContainsLang('USER_TOOLS', $crawler->filter('html')->text());
+ $form = $crawler->filter('input[name=update]')->selectButton('Submit')->form();
+ $crawler = self::submit($form, array('action' => 'reactivate'));
+ $this->assertContainsLang('FORCE_REACTIVATION_SUCCESS', $crawler->filter('html')->text());
+
+ $this->get_user_data();
+ $this->assertNotEmpty($this->user_data['user_actkey']);
+ }
+
protected function get_user_data()
{
$db = $this->get_db();
diff --git a/tests/functions/user_delete_test.php b/tests/functions/user_delete_test.php
index 480b5fc5e1..db9b6e0c90 100644
--- a/tests/functions/user_delete_test.php
+++ b/tests/functions/user_delete_test.php
@@ -72,6 +72,7 @@ class phpbb_functions_user_delete_test extends phpbb_database_test_case
$oauth_provider_collection,
'phpbb_users',
$phpbb_container,
+ $phpbb_dispatcher,
$this->phpbb_root_path,
$this->php_ext
);