| Conditions | 1 |
| Paths | 1 |
| Total Lines | 35 |
| Code Lines | 29 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 32 | public function testMarkupManipulation() |
||
| 33 | { |
||
| 34 | $expected = <<<EOF |
||
| 35 | <a title="show image" href="#">show image</a> <a title="show image" href="#">show image</a> <hr><article class="foo">bar</article> <strong class="foo">bar</strong> <input type="text" name="foo" id="foo"> |
||
| 36 | EOF; |
||
| 37 | |||
| 38 | |||
| 39 | $actual = $this->replacer->replaceTag( |
||
| 40 | 'img', |
||
| 41 | 'a', |
||
| 42 | false, |
||
| 43 | ['src' => 'href', 'alt' => false], |
||
| 44 | 'title="show image"', |
||
| 45 | 'show image</a>' |
||
| 46 | )->replaceTag( |
||
| 47 | 'div', |
||
| 48 | 'article', |
||
| 49 | true, |
||
| 50 | ['id' => 'class'], |
||
| 51 | null, |
||
| 52 | null, |
||
| 53 | '<hr>' |
||
| 54 | )->replaceTag( |
||
| 55 | 'em', |
||
| 56 | 'strong', |
||
| 57 | true |
||
| 58 | )->replaceTag( |
||
| 59 | 'input', |
||
| 60 | 'input', |
||
| 61 | false, |
||
| 62 | ['name' => ['name', 'id']] |
||
| 63 | )->compress()->getMarkup(); |
||
| 64 | |||
| 65 | |||
| 66 | $this->assertEquals($expected, $actual); |
||
| 67 | } |
||
| 68 | } |