Skip to content
Permalink
Browse files

NEW: Allow namespaces in template include statements.

  • Loading branch information
sminnee authored and Damian Mooyman committed May 21, 2016
1 parent b249cc3 commit a9eebdc7edc31023cb7272ed3fff2ca6f31de0b1
Showing with 1,605 additions and 1,569 deletions.
  1. +1 −0 tests/templates/Namespace/NamespaceInclude.ss
  2. +22 −0 tests/view/SSViewerTest.php
  3. +1,580 −1,568 view/SSTemplateParser.php
  4. +2 −1 view/SSTemplateParser.php.inc
@@ -0,0 +1 @@
NamespaceInclude
@@ -728,6 +728,28 @@ public function testIncludeWithArguments() {
$this->assertEqualIgnoringWhitespace('A B', $res, 'Objects can be passed as named arguments');
}
public function testNamespaceInclude() {
$data = new ArrayData([]);
$this->assertEquals(
"tests:( NamespaceInclude\n )",
$this->render('tests:( <% include Namespace\NamespaceInclude %> )', $data),
'Backslashes work for namespace references in includes'
);
$this->assertEquals(
"tests:( NamespaceInclude\n )",
$this->render('tests:( <% include Namespace/NamespaceInclude %> )', $data),
'Forward slashes work for namespace references in includes'
);
$this->assertEquals(
"tests:( NamespaceInclude\n )",
$this->render('tests:( <% include NamespaceInclude %> )', $data),
'Namespace can be missed for a namespaed include'
);
}
public function testRecursiveInclude() {
$view = new SSViewer(array('SSViewerTestRecursiveInclude'));

0 comments on commit a9eebdc

Please sign in to comment.
You can’t perform that action at this time.