| Total Complexity | 5 |
| Total Lines | 64 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 16 | class FormatTest extends BaseTest |
||
| 17 | { |
||
| 18 | public function testFormatDiv(): void |
||
| 19 | { |
||
| 20 | $s = $this->getStempler(); |
||
| 21 | |||
| 22 | $this->assertSame( |
||
| 23 | "<div>\n hello\n</div>", |
||
| 24 | $s->get('format/f1', new ViewContext())->render([]) |
||
| 25 | ); |
||
| 26 | } |
||
| 27 | |||
| 28 | public function testFormatDiv2(): void |
||
| 29 | { |
||
| 30 | $s = $this->getStempler(); |
||
| 31 | |||
| 32 | $this->assertSame( |
||
| 33 | "<div>\n hello\n</div>", |
||
| 34 | $s->get('format/f2', new ViewContext())->render([]) |
||
| 35 | ); |
||
| 36 | } |
||
| 37 | |||
| 38 | public function testFormatDiv3(): void |
||
| 39 | { |
||
| 40 | $s = $this->getStempler(); |
||
| 41 | |||
| 42 | $this->assertSame( |
||
| 43 | '<div> first |
||
| 44 | <div> |
||
| 45 | hello |
||
| 46 | </div> |
||
| 47 | test |
||
| 48 | </div>', |
||
| 49 | $s->get('format/f3', new ViewContext())->render([]) |
||
| 50 | ); |
||
| 51 | } |
||
| 52 | |||
| 53 | public function testFormatDiv4(): void |
||
| 54 | { |
||
| 55 | $s = $this->getStempler(); |
||
| 56 | |||
| 57 | $this->assertSame( |
||
| 58 | '<div> |
||
| 59 | hello |
||
| 60 | <pre> |
||
| 61 | test magic |
||
| 62 | |||
| 63 | |||
| 64 | </pre> |
||
| 65 | extra spaces |
||
| 66 | </div>', |
||
| 67 | str_replace("\r", '', $s->get('format/f4', new ViewContext())->render([])) |
||
| 68 | ); |
||
| 69 | } |
||
| 70 | |||
| 71 | public function testFormatDiv5(): void |
||
| 72 | { |
||
| 73 | $s = $this->getStempler(); |
||
| 74 | |||
| 75 | $this->assertSame( |
||
| 76 | '<div> |
||
| 77 | hello |
||
| 78 | </div>', |
||
| 79 | $s->get('format/f5', new ViewContext())->render([]) |
||
| 80 | ); |
||
| 83 |