| Conditions | 1 |
| Paths | 1 |
| Total Lines | 22 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 13 | public function testIsHidden() |
||
| 14 | { |
||
| 15 | $authorizationService = new class implements AuthorizationServiceInterface { |
||
| 16 | public function isAllowed(string $right): bool |
||
| 17 | { |
||
| 18 | return ($right === 'ok'); |
||
| 19 | } |
||
| 20 | }; |
||
| 21 | |||
| 22 | $registry = new Registry(new EmptyContainer(), $authorizationService); |
||
| 23 | |||
| 24 | $field = new Field('test', new StringType(), $registry); |
||
| 25 | |||
| 26 | $this->assertFalse($field->isHidden()); |
||
| 27 | $field->hide(); |
||
| 28 | $this->assertTrue($field->isHidden()); |
||
| 29 | $field->show(); |
||
| 30 | $this->assertFalse($field->isHidden()); |
||
| 31 | |||
| 32 | $field->requiresRight('nope'); |
||
| 33 | |||
| 34 | } |
||
| 35 | } |
||
| 36 |