| Conditions | 1 |
| Paths | 1 |
| Total Lines | 19 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 10 | public function testAddClass() { |
||
| 11 | $htmlElement = new \Fiv\Form\Element\Html(); |
||
| 12 | |||
| 13 | $currentClassName = $htmlElement->getAttribute('class'); |
||
| 14 | |||
| 15 | $this->assertEmpty($currentClassName); |
||
| 16 | |||
| 17 | $htmlElement->addClass('test'); |
||
| 18 | $this->assertEquals('test', $htmlElement->getAttribute('class')); |
||
| 19 | |||
| 20 | $htmlElement->setAttribute('class', ''); |
||
| 21 | $this->assertEmpty($htmlElement->getAttribute('class')); |
||
| 22 | |||
| 23 | $htmlElement->setAttribute('class', 'custom_class'); |
||
| 24 | $this->assertEquals("custom_class", $htmlElement->getAttribute('class')); |
||
| 25 | |||
| 26 | $htmlElement->addClass('other_class'); |
||
| 27 | $this->assertEquals('custom_class other_class', $htmlElement->getAttribute('class')); |
||
| 28 | } |
||
| 29 | |||
| 44 |