Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Behat] Changing my account password with token I received scenario #9742

Merged
merged 3 commits into from
Oct 2, 2018

Conversation

loic425
Copy link
Member

@loic425 loic425 commented Sep 28, 2018

Q A
Branch? 1.2
Bug fix? no
New feature? no
BC breaks? no/yes
Deprecations? no/yes
Related tickets fixes #9731
License MIT

I've changed a behat page and its interface cause I've renamed an existing one... If you have a better idea, I'm opened. But the old name was confusing with missing one.

@loic425 loic425 changed the title [Behat] add Changing my account password with token I received scenario [Behat] Changing my account password with token I received scenario Sep 28, 2018
Copy link
Contributor

@pamil pamil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good overall, I've found just some minor issues :)

private function prepareUserPasswordResetToken(UserInterface $user)
{
$token = 'itotallyforgotmypassword';
$this->sharedStorage->set('password_reset_token', $token);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we don't need shared storage here if in When I follow link on my email to reset my password step we would get the User model and take the password reset token from there.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we keep this following code with storage on setup context ?

$this->sharedStorage->set('password_reset_token', $token);

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's no longer needed then.

use Behat\Mink\Exception\ElementNotFoundException;
use Sylius\Behat\Page\SymfonyPage;

class RequestPasswordRequestResetPage extends SymfonyPage implements RequestPasswordResetPageInterface
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a doubled Request in the class name, shouldn't it be RequestPasswordResetPage (esp. because of the interface name)?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lol yeah, it's a mistake :)

*
* @return bool
*/
public function checkValidationMessageFor($element, $message);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can use typehints both for arguments and the return value in this interface.

@pamil pamil added the Behat Issues and PRs aimed at improving Behat usage. label Oct 2, 2018
@pamil pamil merged commit 6453598 into Sylius:1.2 Oct 2, 2018
@pamil
Copy link
Contributor

pamil commented Oct 2, 2018

Thank you, Loic! 🥇 🎉

@loic425 loic425 deleted the fix/resetting-password branch October 2, 2018 15:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Behat Issues and PRs aimed at improving Behat usage.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants