Skip to content

Commit

Permalink
[stable10] Backport of Adjust acceptance test for issue 33384
Browse files Browse the repository at this point in the history
  • Loading branch information
phil-davis authored and sharidas committed Jan 22, 2019
1 parent 6175c68 commit 67ce367
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
9 changes: 6 additions & 3 deletions tests/Core/Command/User/ResetPasswordTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -281,19 +281,22 @@ public function testPasswordFromEnvAndPasswordConfirmationEmail($expectedResult)
->method('getEnvVar')
->willReturn('fooPass');

$this->lostController->method('generateTokenAndLink')
$this->lostController->expects($this->once())
->method('generateTokenAndLink')
->with('foo')
->willReturn(['http://localhost/foo/bar/123AbcFooBar/foo', '123AbcFooBar']);

if ($expectedResult === true) {
$this->lostController->method('setPassword')
$this->lostController->expects($this->once())
->method('setPassword')
->willReturn(['status' => 'success']);

$output->expects($this->once())
->method('writeln')
->with("<info>Successfully reset password for foo.</info>");
} else {
$this->lostController->method('setPassword')
$this->lostController->expects($this->once())
->method('setPassword')
->willReturn("failed");

$output->expects($this->once())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,17 @@ Feature: reset user password
Use the following link to reset your password: <a href=
"""

@issue-33384
Scenario: user should get email when the administrator changes their password and specifies to also send email
Given these users have been created:
| username | password | displayname | email |
| brand-new-user | %regular% | New user | brand.new.user@oc.com.np |
When the administrator resets the password of user "brand-new-user" to "%alt1%" sending email using the occ command
Then the command should have been successful
And the command output should contain the text "Successfully reset password for brand-new-user"
And the email address "[email protected]" should not have received an email
#And the email address "[email protected]" should have received an email with the body containing
#"""
#Password changed successfully
#"""
And the email address "[email protected]" should have received an email with the body containing
"""
Password changed successfully
"""
And the content of file "textfile0.txt" for user "brand-new-user" using password "%alt1%" should be "ownCloud test text file 0" plus end-of-line
But user "brand-new-user" using password "%regular%" should not be able to download file "textfile0.txt"

Expand Down

0 comments on commit 67ce367

Please sign in to comment.