Skip to content

Commit

Permalink
Add missing test for single directory and NS
Browse files Browse the repository at this point in the history
  • Loading branch information
Nigel Greenway committed Mar 13, 2016
1 parent 49e2ecc commit 9b0a353
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion tests/TwigTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public function testSingleNamespaceAndMultipleDirectories()
$this->assertEquals('Happy Tuesday!', $outputMulti);
}

public function testSingleTemplateWithANamespace()
public function testArrayWithASingleTemplateWithANamespace()
{
$views = new Twig([
'One' => [
Expand All @@ -72,6 +72,19 @@ public function testSingleTemplateWithANamespace()
$this->assertEquals("<p>Hi, my name is Josh.</p>\n", $output);
}

public function testASingleTemplateWithANamespace()
{
$views = new Twig([
'One' => __DIR__.'/templates',
]);

$output = $views->fetch('@One/example.html', [
'name' => 'Josh'
]);

$this->assertEquals("<p>Hi, my name is Josh.</p>\n", $output);
}

public function testMultipleTemplatesWithMultipleNamespace()
{
$weekday = (new \DateTimeImmutable('2016-03-08'))->format('l');
Expand Down

0 comments on commit 9b0a353

Please sign in to comment.