| Total Complexity | 5 |
| Total Lines | 36 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 9 | class PasswordFieldTest extends SapphireTest |
||
| 10 | { |
||
| 11 | public function boolDataProvider() |
||
| 16 | ]; |
||
| 17 | } |
||
| 18 | |||
| 19 | /** |
||
| 20 | * @dataProvider boolDataProvider |
||
| 21 | * @param bool $bool |
||
| 22 | */ |
||
| 23 | public function testAutocomplete($bool) |
||
| 24 | { |
||
| 25 | Config::modify()->set(PasswordField::class, 'autocomplete', $bool); |
||
| 26 | $field = new PasswordField('test'); |
||
| 27 | $attrs = $field->getAttributes(); |
||
| 28 | |||
| 29 | $this->assertArrayHasKey('autocomplete', $attrs); |
||
| 30 | $this->assertEquals($bool ? 'on' : 'off', $attrs['autocomplete']); |
||
| 31 | } |
||
| 32 | |||
| 33 | /** |
||
| 34 | * @dataProvider boolDataProvider |
||
| 35 | * @param bool $bool |
||
| 36 | */ |
||
| 37 | public function testValuePostback($bool) |
||
| 45 | } |
||
| 46 | } |
||
| 47 |