Skip to content

Commit 000c822

Browse files
committed
add integration test
1 parent d30e5e2 commit 000c822

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
declare(strict_types=1);
7+
8+
namespace Magento\Customer\Model\ForgotPasswordToken;
9+
10+
use Magento\Framework\Exception\NoSuchEntityException;
11+
use Magento\Framework\ObjectManagerInterface;
12+
use Magento\TestFramework\Helper\Bootstrap;
13+
use PHPUnit\Framework\TestCase;
14+
15+
class GetCustomerByTokenTest extends TestCase
16+
{
17+
private const RESET_PASSWORD = '8ed8677e6c79e68b94e61658bd756ea5';
18+
19+
/** @var ObjectManagerInterface */
20+
private $objectManager;
21+
22+
/**
23+
* @var GetCustomerByToken
24+
*/
25+
private $customerByToken;
26+
27+
protected function setUp()
28+
{
29+
$this->objectManager = Bootstrap::getObjectManager();
30+
$this->customerByToken = $this->objectManager->get(GetCustomerByToken::class);
31+
}
32+
33+
/**
34+
* @magentoDataFixture Magento/Customer/_files/customer.php
35+
*/
36+
public function testExecuteWithNoSuchEntityException(): void
37+
{
38+
$this->expectExceptionMessage('No such entity with rp_token = ' . self::RESET_PASSWORD);
39+
$this->customerByToken->execute(self::RESET_PASSWORD);
40+
}
41+
}

0 commit comments

Comments
 (0)