Skip to content

Commit

Permalink
merged branch hason/loader (PR twigphp#838)
Browse files Browse the repository at this point in the history
Commits
-------

c503287 Fixed typo in Filesystem loader

Discussion
----------

Fixed typo in Filesystem loader
  • Loading branch information
fabpot committed Sep 18, 2012
2 parents c38e06f + c503287 commit e3e8b42
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Twig/Loader/Filesystem.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public function getPaths($namespace = '__main__')
*/
public function getNamespaces()
{
return array_keys($this->paths[$namespace]);
return array_keys($this->paths);
}

/**
Expand Down
9 changes: 9 additions & 0 deletions test/Twig/Tests/Loader/FilesystemTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,4 +78,13 @@ public function testPaths()
$this->assertEquals("path (final)\n", $loader->getSource('@__main__/index.html'));
$this->assertEquals("named path (final)\n", $loader->getSource('@named/index.html'));
}

public function testGetNamespaces()
{
$loader = new Twig_Loader_Filesystem(sys_get_temp_dir());
$this->assertEquals(array('__main__'), $loader->getNamespaces());

$loader->addPath(sys_get_temp_dir(), 'named');
$this->assertEquals(array('__main__', 'named'), $loader->getNamespaces());
}
}

0 comments on commit e3e8b42

Please sign in to comment.