| Línea 36... |
Línea 36... |
| 36 |
/**
|
36 |
/**
|
| 37 |
* Tests getting the factor combinations
|
37 |
* Tests getting the factor combinations
|
| 38 |
*
|
38 |
*
|
| 39 |
* @covers ::get_factor_combinations
|
39 |
* @covers ::get_factor_combinations
|
| 40 |
*/
|
40 |
*/
|
| 41 |
public function test_get_factor_combinations_default() {
|
41 |
public function test_get_factor_combinations_default(): void {
|
| 42 |
$namagemfa = new \tool_mfa\local\admin_setting_managemfa();
|
42 |
$namagemfa = new \tool_mfa\local\admin_setting_managemfa();
|
| 43 |
$factors = \tool_mfa\plugininfo\factor::get_enabled_factors();
|
43 |
$factors = \tool_mfa\plugininfo\factor::get_enabled_factors();
|
| 44 |
$combinations = $namagemfa->get_factor_combinations($factors, 0, count($factors) - 1);
|
44 |
$combinations = $namagemfa->get_factor_combinations($factors, 0, count($factors) - 1);
|
| 45 |
$this->assertEquals(0, count($factors));
|
45 |
$this->assertEquals(0, count($factors));
|
| 46 |
$this->assertEquals(0, count($combinations));
|
46 |
$this->assertEquals(0, count($combinations));
|
| Línea 139... |
Línea 139... |
| 139 |
* @covers ::get_factor_combinations
|
139 |
* @covers ::get_factor_combinations
|
| 140 |
* @dataProvider get_factor_combinations_provider
|
140 |
* @dataProvider get_factor_combinations_provider
|
| 141 |
* @param array $factorset configured factors
|
141 |
* @param array $factorset configured factors
|
| 142 |
* @param int $combinationscount expected count of available combinations
|
142 |
* @param int $combinationscount expected count of available combinations
|
| 143 |
*/
|
143 |
*/
|
| 144 |
public function test_get_factor_combinations_with_data_provider($factorset, $combinationscount) {
|
144 |
public function test_get_factor_combinations_with_data_provider($factorset, $combinationscount): void {
|
| 145 |
$this->resetAfterTest();
|
145 |
$this->resetAfterTest();
|
| 146 |
$enabledcount = 0;
|
146 |
$enabledcount = 0;
|
| Línea 147... |
Línea 147... |
| 147 |
|
147 |
|
| 148 |
foreach ($factorset as $factor) {
|
148 |
foreach ($factorset as $factor) {
|
| Línea 172... |
Línea 172... |
| 172 |
/**
|
172 |
/**
|
| 173 |
* Tests checking the factor combinations
|
173 |
* Tests checking the factor combinations
|
| 174 |
*
|
174 |
*
|
| 175 |
* @covers ::get_factor_combinations
|
175 |
* @covers ::get_factor_combinations
|
| 176 |
*/
|
176 |
*/
|
| 177 |
public function test_factor_combination_checker() {
|
177 |
public function test_factor_combination_checker(): void {
|
| 178 |
$this->resetAfterTest();
|
178 |
$this->resetAfterTest();
|
| 179 |
$managemfa = new \tool_mfa\local\admin_setting_managemfa();
|
179 |
$managemfa = new \tool_mfa\local\admin_setting_managemfa();
|
| 180 |
$user = $this->getDataGenerator()->create_user();
|
180 |
$user = $this->getDataGenerator()->create_user();
|
| 181 |
$this->setUser($user);
|
181 |
$this->setUser($user);
|