Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordiosmosis <diosmosis@users.noreply.github.com>2018-09-06 19:42:06 +0300
committerStefan Giehl <stefan@piwik.org>2018-09-06 19:42:06 +0300
commitc9d4cfcb7b7fb7735058a8b265801e16406c4f69 (patch)
treee66c0958bf09f4c72eb001648e4ff7649f04c1bd /plugins/UsersManager/tests/Integration/APITest.php
parent9acf1e0ee4a7da143ec5e72640db9660f892424b (diff)
Make sure user is not logged out when settings saved w/ no password change. (#13391)
Makes sure when password is not deliberately set through API, ts_password_modified does not change.
Diffstat (limited to 'plugins/UsersManager/tests/Integration/APITest.php')
-rw-r--r--plugins/UsersManager/tests/Integration/APITest.php13
1 files changed, 13 insertions, 0 deletions
diff --git a/plugins/UsersManager/tests/Integration/APITest.php b/plugins/UsersManager/tests/Integration/APITest.php
index 241ce6d4bf..4c4bae1882 100644
--- a/plugins/UsersManager/tests/Integration/APITest.php
+++ b/plugins/UsersManager/tests/Integration/APITest.php
@@ -304,6 +304,19 @@ class APITest extends IntegrationTestCase
$this->assertTrue($passwordHelper->verify(UsersManager::getPasswordHash('newPassword'), $user['password']));
}
+ public function test_updateUser_doesNotChangePasswordIfFalsey()
+ {
+ $model = new Model();
+ $userBefore = $model->getUser($this->login);
+
+ $this->api->updateUser($this->login, false, 'email@example.com', 'newAlias', false);
+
+ $user = $model->getUser($this->login);
+
+ $this->assertSame($userBefore['password'], $user['password']);
+ $this->assertSame($userBefore['ts_password_modified'], $user['ts_password_modified']);
+ }
+
public function test_getSitesAccessFromUser_forSuperUser()
{
$user2 = 'userLogin2';