Repository navigation
Central account table replace user manager when testing - #27276
Conversation
|
@DeepDiver1975, thanks for your PR! By analyzing the history of the files in this pull request, we identified @butonic, @PVince81 and @bantu to be potential reviewers. |
5c85d2b to
347a631
Compare
347a631 to
8419ae6
Compare
ab79244 to
57ade34
Compare
| ]); | ||
|
|
||
| $table->setPrimaryKey(['id']); | ||
| $table->addUniqueIndex(['email']); |
There was a problem hiding this comment.
I can already hear the "internal server error" returned to the UI when someone is trying to set a duplicate email address 😉
This will need to be caught properly (separate PR).
| // if (isset($this->cachedUsers[$uid])) { | ||
| // return $this->cachedUsers[$uid]; | ||
| // } | ||
| // } |
| use OCP\IImage; | ||
| use OCP\IUser; | ||
|
|
||
| class RemoteUser implements IUser { |
There was a problem hiding this comment.
add comment: what on earth is a remote user ?
| * get the display name for the user, if no specific display name is set it will fallback to the user id | ||
| * | ||
| * @return string | ||
| * @since 8.0.0 |
There was a problem hiding this comment.
and remove @since because they don't apply for this private class
| * See the COPYING-README file. | ||
| */ | ||
|
|
||
| class PendingUserListener implements PHPUnit_Framework_TestListener { |
There was a problem hiding this comment.
what is this, why is it needed and what does it do ? answer in PHPDoc because that's the question future devs will ask themselves when seeing this 😄
| public function endTest(PHPUnit_Framework_Test $test, $time) { | ||
| } | ||
|
|
||
| public function startTestSuite(PHPUnit_Framework_TestSuite $suite) { |
There was a problem hiding this comment.
I guess it wasn't possible to put this logic into the 'TestCase` base class ?
| $diff = array_diff($currentUsers, $this->knownUsers); | ||
| if (!empty($diff)) { | ||
| $test = $suite->getName(); | ||
| PHPUnit_Framework_Assert::assertEquals($this->knownUsers, $currentUsers, "$test: Users have not been clean up properly: " . implode(' ', $diff)); |
There was a problem hiding this comment.
Ah! Now I get it!
Maybe rename the class to UncleantUsersDetector ?
| } | ||
| } | ||
|
|
||
| class DummyUserBackend extends Backend implements \OCP\IUserBackend { |
There was a problem hiding this comment.
one upon at time there was a developer who always said that even test classes need to be split into individual PHP files
There was a problem hiding this comment.
who was that? 😉
| $backend = $this->createMock('\OC\User\Database'); | ||
|
|
||
| $backend->expects($this->any()) | ||
| ->method('implementsActions') |
There was a problem hiding this comment.
Seems we lost many tests here. Is the another test that covers this directly for the "\OC\User\Database" class ?
There was a problem hiding this comment.
I implemented some of these tests using data providers to reduce code
| </filter> | ||
| <listeners> | ||
| <listener class="StartSessionListener" file="startsessionlistener.php" /> | ||
| <!--<listener class="PendingUserListener" file="PendingUserListener.php" />--> |
There was a problem hiding this comment.
delete the class if we don't want this any more...
There was a problem hiding this comment.
I'll add a comment
12f317f to
ae553b4
Compare
There was a problem hiding this comment.
an additional short version "-b" could be nice for easier typing out 😉
There was a problem hiding this comment.
ah never mind, it's already a pain to type the escaped class name, so the additional pain of typing out "backend-class" is fine
There was a problem hiding this comment.
so the additional pain of typing out "backend-class" is fine
you dont need to - its an argument not an option
There was a problem hiding this comment.
would callForAllUsers work here which comes with its own pagination ?
There was a problem hiding this comment.
since I only want to interate over all users there is no proper callForAllUsers available.
i also didn't want to add yet another argument to callForAllUsers
There was a problem hiding this comment.
log a debug entry, just in case ?
|
Some minor comments on the sync commit ae553b4 Looks good in general, up to you to decide for the changes (I hope you fix the indent though 😉). Please do a quick test before merging to make sure this still works after the little changes that were made to make tests pass. |
ae553b4 to
592e76d
Compare
592e76d to
c21f44d
Compare
|
@davitol 1feec08 should address the shib issue - mind testing - thx |
I still can reproduce it |
b4787e2 to
a51d0ef
Compare
|
rebased again 😢 |
…ction - behave accordingly
539c070 to
0f5241b
Compare
|
👍 |
since commit 9489104 PR #27276 The email address is not stored in the preferences table anymore but in the user account 9489104#diff-3030ca4989f892c50dea24eaa3f1ae38R151 So need to get it from there also Fixes #27554
since commit 9489104 PR #27276 The email address is not stored in the preferences table anymore but in the user account 9489104#diff-3030ca4989f892c50dea24eaa3f1ae38R151 So need to get it from there also Fixes #27554
|
doc ticket: owncloud-archive/documentation#2991 |
|
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Related Issue
fixes #23558
Missing
Types of changes
Checklist: