| @@ 1489-1503 (lines=15) @@ | ||
| 1486 | } |
|
| 1487 | } |
|
| 1488 | ||
| 1489 | public function testClosedBlockExtension() { |
|
| 1490 | $count = 0; |
|
| 1491 | $parser = new SSTemplateParser(); |
|
| 1492 | $parser->addClosedBlock( |
|
| 1493 | 'test', |
|
| 1494 | function (&$res) use (&$count) { |
|
| 1495 | $count++; |
|
| 1496 | } |
|
| 1497 | ); |
|
| 1498 | ||
| 1499 | $template = new SSViewer_FromString("<% test %><% end_test %>", $parser); |
|
| 1500 | $template->process(new SSViewerTestFixture()); |
|
| 1501 | ||
| 1502 | $this->assertEquals(1, $count); |
|
| 1503 | } |
|
| 1504 | ||
| 1505 | public function testOpenBlockExtension() { |
|
| 1506 | $count = 0; |
|
| @@ 1505-1519 (lines=15) @@ | ||
| 1502 | $this->assertEquals(1, $count); |
|
| 1503 | } |
|
| 1504 | ||
| 1505 | public function testOpenBlockExtension() { |
|
| 1506 | $count = 0; |
|
| 1507 | $parser = new SSTemplateParser(); |
|
| 1508 | $parser->addOpenBlock( |
|
| 1509 | 'test', |
|
| 1510 | function (&$res) use (&$count) { |
|
| 1511 | $count++; |
|
| 1512 | } |
|
| 1513 | ); |
|
| 1514 | ||
| 1515 | $template = new SSViewer_FromString("<% test %>", $parser); |
|
| 1516 | $template->process(new SSViewerTestFixture()); |
|
| 1517 | ||
| 1518 | $this->assertEquals(1, $count); |
|
| 1519 | } |
|
| 1520 | ||
| 1521 | /** |
|
| 1522 | * Tests if caching for SSViewer_FromString is working |
|