-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e2035c7
commit 0b959df
Showing
13 changed files
with
295 additions
and
468 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,7 +16,6 @@ | |
use CoopTilleuls\ForgotPasswordBundle\Controller\ResetPassword; | ||
use CoopTilleuls\ForgotPasswordBundle\Manager\ForgotPasswordManager; | ||
use CoopTilleuls\ForgotPasswordBundle\Provider\ProviderInterface; | ||
use CoopTilleuls\ForgotPasswordBundle\Tests\ProphecyTrait; | ||
use PHPUnit\Framework\TestCase; | ||
use Prophecy\Prophecy\ObjectProphecy; | ||
use Symfony\Component\HttpFoundation\Response; | ||
|
@@ -26,9 +25,7 @@ | |
*/ | ||
final class ResetPasswordTest extends TestCase | ||
{ | ||
use ProphecyTrait; | ||
|
||
/** | ||
/** | ||
* @var ProviderInterface|ObjectProphecy | ||
*/ | ||
private $providerMock; | ||
|
@@ -39,15 +36,15 @@ final class ResetPasswordTest extends TestCase | |
|
||
protected function setUp(): void | ||
{ | ||
$this->providerMock = $this->prophesize(ProviderInterface::class); | ||
$this->managerMock = $this->prophesize(ForgotPasswordManager::class); | ||
$this->providerMock = $this->createMock(ProviderInterface::class); | ||
$this->managerMock = $this->createMock(ForgotPasswordManager::class); | ||
} | ||
|
||
public function testResetPasswordAction(): void | ||
{ | ||
$this->managerMock->resetPassword('email', '[email protected]', $this->providerMock)->shouldBeCalledOnce(); | ||
$controller = new ResetPassword($this->managerMock->reveal()); | ||
$response = $controller('email', '[email protected]', $this->providerMock->reveal()); | ||
$this->managerMock->expects($this->once())->method('resetPassword')->with('email', '[email protected]', $this->providerMock); | ||
$controller = new ResetPassword($this->managerMock); | ||
$response = $controller('email', '[email protected]', $this->providerMock); | ||
$this->assertInstanceOf(Response::class, $response); | ||
$this->assertEquals('', $response->getContent()); | ||
$this->assertEquals(204, $response->getStatusCode()); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.