/
githubmirror
/
magento2
Обзор
Документация
Войти
/
githubmirror
/
magento2
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
2.4-develop
dev/tests/integration/testsuite/Magento/Customer/Model/AuthenticationTest.php
60 строк
2 KB
Alexandra Zota
ACP2E-4019: CE copyright updates for 2.4.9-beta1
22 окт 2025, 10:44
22 окт 2025, 10:44
264bea2
Код
Авторство
О чём код?
<?php /** * Copyright 2020 Adobe * All Rights Reserved. */ 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'); } }