![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/old/dev/tests/integration/testsuite/Magento/Customer/Model/ |
<?php /** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ declare(strict_types=1); namespace Magento\Customer\Model; use Magento\Framework\Exception\InvalidEmailOrPasswordException; use Magento\Framework\ObjectManagerInterface; use Magento\TestFramework\Helper\Bootstrap; use PHPUnit\Framework\TestCase; /** * Tests for customer authentication model. * * @see \Magento\Customer\Model\Authentication * @magentoDbIsolation enabled */ class AuthenticationTest extends TestCase { /** @var ObjectManagerInterface */ private $objectManager; /** @var AuthenticationInterface */ private $authentication; /** * @inheritdoc */ protected function setUp(): void { parent::setUp(); $this->objectManager = Bootstrap::getObjectManager(); $this->authentication = $this->objectManager->get(AuthenticationInterface::class); } /** * @magentoDataFixture Magento/Customer/_files/expired_lock_for_customer.php * * @return void */ public function testCustomerAuthenticate(): void { $this->assertTrue($this->authentication->authenticate(1, 'password')); } /** * @magentoDataFixture Magento/Customer/_files/expired_lock_for_customer.php * * @return void */ public function testCustomerAuthenticateWithWrongPassword(): void { $this->expectExceptionObject(new InvalidEmailOrPasswordException(__('Invalid login or password.'))); $this->authentication->authenticate(1, 'password1'); } }