Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
ResetMethodTest.php
Go to the documentation of this file.
1 <?php
8 
10 
14 class ResetMethodTest extends \PHPUnit\Framework\TestCase
15 {
19  protected $model;
20 
24  protected $objectManager;
25 
30  protected function setUp()
31  {
32  $this->objectManager = new ObjectManager($this);
33  $this->model = $this->objectManager->getObject(\Magento\Security\Model\Config\Source\ResetMethod::class);
34  }
35 
36  public function testToOptionArray()
37  {
38  $expected = [
39  [
40  'value' => \Magento\Security\Model\Config\Source\ResetMethod::OPTION_BY_IP_AND_EMAIL,
41  'label' => __('By IP and Email')
42  ],
43  [
44  'value' => \Magento\Security\Model\Config\Source\ResetMethod::OPTION_BY_IP,
45  'label' => __('By IP')
46  ],
47  [
48  'value' => \Magento\Security\Model\Config\Source\ResetMethod::OPTION_BY_EMAIL,
49  'label' => __('By Email')
50  ],
51  [
52  'value' => \Magento\Security\Model\Config\Source\ResetMethod::OPTION_NONE,
53  'label' => __('None')
54  ],
55  ];
56  $this->assertEquals($expected, $this->model->toOptionArray());
57  }
58 
59  public function testToArray()
60  {
61  $expected = [
62  \Magento\Security\Model\Config\Source\ResetMethod::OPTION_BY_IP_AND_EMAIL => __('By IP and Email'),
63  \Magento\Security\Model\Config\Source\ResetMethod::OPTION_BY_IP => __('By IP'),
64  \Magento\Security\Model\Config\Source\ResetMethod::OPTION_BY_EMAIL => __('By Email'),
65  \Magento\Security\Model\Config\Source\ResetMethod::OPTION_NONE => __('None'),
66  ];
67  $this->assertEquals($expected, $this->model->toArray());
68  }
69 }
__()
Definition: __.php:13