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

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@arthur-schiwon.de>2021-06-22 13:56:00 +0300
committerbackportbot[bot] <backportbot[bot]@users.noreply.github.com>2021-06-30 08:15:49 +0300
commit63d2aad5d3a6fd016a13920e636e4c5e7e22c493 (patch)
tree5b873754c2892b696c42fa6dd76e1e1f747afe25 /tests
parent19d236734077fdb4bd73a13a94bf07e01b028b17 (diff)
adjust verification state updater method
- also fixes scope of internal methods Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/Accounts/AccountManagerTest.php15
1 files changed, 5 insertions, 10 deletions
diff --git a/tests/lib/Accounts/AccountManagerTest.php b/tests/lib/Accounts/AccountManagerTest.php
index d9a55825122..d70d453c248 100644
--- a/tests/lib/Accounts/AccountManagerTest.php
+++ b/tests/lib/Accounts/AccountManagerTest.php
@@ -246,7 +246,7 @@ class AccountManagerTest extends TestCase {
],
];
foreach ($users as $userInfo) {
- $this->accountManager->updateUser($userInfo['user'], $userInfo['data'], false);
+ $this->invokePrivate($this->accountManager, 'updateUser', [$userInfo['user'], $userInfo['data'], false]);
}
}
@@ -278,7 +278,7 @@ class AccountManagerTest extends TestCase {
* @param bool $updateExisting
*/
public function testUpdateUser($newData, $oldData, $insertNew, $updateExisting) {
- $accountManager = $this->getInstance(['getUser', 'insertNewUser', 'updateExistingUser', 'updateVerifyStatus', 'checkEmailVerification']);
+ $accountManager = $this->getInstance(['getUser', 'insertNewUser', 'updateExistingUser', 'checkEmailVerification']);
/** @var IUser $user */
$user = $this->createMock(IUser::class);
@@ -288,8 +288,6 @@ class AccountManagerTest extends TestCase {
if ($updateExisting) {
$accountManager->expects($this->once())->method('checkEmailVerification')
->with($oldData, $newData, $user)->willReturn($newData);
- $accountManager->expects($this->once())->method('updateVerifyStatus')
- ->with($oldData, $newData)->willReturn($newData);
$accountManager->expects($this->once())->method('updateExistingUser')
->with($user, $newData);
$accountManager->expects($this->never())->method('insertNewUser');
@@ -303,7 +301,6 @@ class AccountManagerTest extends TestCase {
if (!$insertNew && !$updateExisting) {
$accountManager->expects($this->never())->method('updateExistingUser');
$accountManager->expects($this->never())->method('checkEmailVerification');
- $accountManager->expects($this->never())->method('updateVerifyStatus');
$accountManager->expects($this->never())->method('insertNewUser');
$this->eventDispatcher->expects($this->never())->method('dispatch');
} else {
@@ -319,13 +316,13 @@ class AccountManagerTest extends TestCase {
);
}
- $accountManager->updateUser($user, $newData);
+ $this->invokePrivate($accountManager, 'updateUser', [$user, $newData]);
}
public function dataTrueFalse() {
return [
+ #$newData | $oldData | $insertNew | $updateExisting
[['myProperty' => ['value' => 'newData']], ['myProperty' => ['value' => 'oldData']], false, true],
- [['myProperty' => ['value' => 'newData']], [], true, false],
[['myProperty' => ['value' => 'oldData']], ['myProperty' => ['value' => 'oldData']], false, false]
];
}
@@ -356,9 +353,7 @@ class AccountManagerTest extends TestCase {
}
$this->addDummyValuesToTable($setUser, $setData);
- $this->assertEquals($expectedData,
- $accountManager->getUser($askUser)
- );
+ $this->assertEquals($expectedData, $this->invokePrivate($accountManager, 'getUser', [$askUser]));
}
public function dataTestGetUser() {