Skip to content

Commit

Permalink
add integration test
Browse files Browse the repository at this point in the history
  • Loading branch information
engcom-Echo committed May 8, 2020
1 parent d30e5e2 commit 000c822
Showing 1 changed file with 41 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
declare(strict_types=1);

namespace Magento\Customer\Model\ForgotPasswordToken;

use Magento\Framework\Exception\NoSuchEntityException;
use Magento\Framework\ObjectManagerInterface;
use Magento\TestFramework\Helper\Bootstrap;
use PHPUnit\Framework\TestCase;

class GetCustomerByTokenTest extends TestCase
{
private const RESET_PASSWORD = '8ed8677e6c79e68b94e61658bd756ea5';

/** @var ObjectManagerInterface */
private $objectManager;

/**
* @var GetCustomerByToken
*/
private $customerByToken;

protected function setUp()
{
$this->objectManager = Bootstrap::getObjectManager();
$this->customerByToken = $this->objectManager->get(GetCustomerByToken::class);
}

/**
* @magentoDataFixture Magento/Customer/_files/customer.php
*/
public function testExecuteWithNoSuchEntityException(): void
{
$this->expectExceptionMessage('No such entity with rp_token = ' . self::RESET_PASSWORD);
$this->customerByToken->execute(self::RESET_PASSWORD);
}
}

0 comments on commit 000c822

Please sign in to comment.