![]() 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/vendor/magento/module-security/Test/Unit/Model/Config/Source/ |
<?php /** * * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ declare(strict_types=1); namespace Magento\Security\Test\Unit\Model\Config\Source; use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; use Magento\Security\Model\Config\Source\ResetMethod; use PHPUnit\Framework\TestCase; /** * Test class for \Magento\Security\Model\Config\Source\ResetMethod testing */ class ResetMethodTest extends TestCase { /** * @var ResetMethod */ protected $model; /** * @var ObjectManager */ protected $objectManager; /** * Init mocks for tests * @return void */ protected function setUp(): void { $this->objectManager = new ObjectManager($this); $this->model = $this->objectManager->getObject(ResetMethod::class); } public function testToOptionArray() { $expected = [ [ 'value' => ResetMethod::OPTION_BY_IP_AND_EMAIL, 'label' => __('By IP and Email') ], [ 'value' => ResetMethod::OPTION_BY_IP, 'label' => __('By IP') ], [ 'value' => ResetMethod::OPTION_BY_EMAIL, 'label' => __('By Email') ], [ 'value' => ResetMethod::OPTION_NONE, 'label' => __('None') ], ]; $this->assertEquals($expected, $this->model->toOptionArray()); } public function testToArray() { $expected = [ ResetMethod::OPTION_BY_IP_AND_EMAIL => __('By IP and Email'), ResetMethod::OPTION_BY_IP => __('By IP'), ResetMethod::OPTION_BY_EMAIL => __('By Email'), ResetMethod::OPTION_NONE => __('None'), ]; $this->assertEquals($expected, $this->model->toArray()); } }