Skip to content

Commit

Permalink
Merge branch 'develop-2' of github.com:auraphp/Aura.View into develop-2
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul M. Jones committed Nov 7, 2014
2 parents c9a6947 + 1f34b7a commit 395dc36
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/TemplateRegistry.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ class TemplateRegistry
*/
public function __construct(array $map = array())
{
$this->map = $map;
foreach ($map as $name => $spec) {
$this->set($name, $spec);
}
}

/**
Expand Down
13 changes: 13 additions & 0 deletions tests/unit/src/ViewTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -132,4 +132,17 @@ public function testSections()
$expect = 'foo bar baz dib zim gir irk';
$this->assertSame($expect, $actual);
}

public function testMapFilesToTemplateRegistryOnConstruct()
{
$view = new View(
new TemplateRegistry(array('foo' => __DIR__ . '/foo_template.php')),
new TemplateRegistry,
new HelperRegistry
);
$view->setView('foo');
$actual = $view->__invoke();
$expect = 'Hello Foo!';
$this->assertSame($expect, $actual);
}
}

0 comments on commit 395dc36

Please sign in to comment.