|
@@ -16,7 +16,7 @@ class Mustache_Test_Loader_FilesystemLoaderTest extends PHPUnit_Framework_TestCa
|
|
|
{
|
|
{
|
|
|
public function testConstructor()
|
|
public function testConstructor()
|
|
|
{
|
|
{
|
|
|
- $baseDir = realpath(dirname(__FILE__).'/../../../fixtures/templates');
|
|
|
|
|
|
|
+ $baseDir = realpath(dirname(__FILE__) . '/../../../fixtures/templates');
|
|
|
$loader = new Mustache_Loader_FilesystemLoader($baseDir, array('extension' => '.ms'));
|
|
$loader = new Mustache_Loader_FilesystemLoader($baseDir, array('extension' => '.ms'));
|
|
|
$this->assertEquals('alpha contents', $loader->load('alpha'));
|
|
$this->assertEquals('alpha contents', $loader->load('alpha'));
|
|
|
$this->assertEquals('beta contents', $loader->load('beta.ms'));
|
|
$this->assertEquals('beta contents', $loader->load('beta.ms'));
|
|
@@ -24,14 +24,14 @@ class Mustache_Test_Loader_FilesystemLoaderTest extends PHPUnit_Framework_TestCa
|
|
|
|
|
|
|
|
public function testTrailingSlashes()
|
|
public function testTrailingSlashes()
|
|
|
{
|
|
{
|
|
|
- $baseDir = dirname(__FILE__).'/../../../fixtures/templates/';
|
|
|
|
|
|
|
+ $baseDir = dirname(__FILE__) . '/../../../fixtures/templates/';
|
|
|
$loader = new Mustache_Loader_FilesystemLoader($baseDir);
|
|
$loader = new Mustache_Loader_FilesystemLoader($baseDir);
|
|
|
$this->assertEquals('one contents', $loader->load('one'));
|
|
$this->assertEquals('one contents', $loader->load('one'));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public function testConstructorWithProtocol()
|
|
public function testConstructorWithProtocol()
|
|
|
{
|
|
{
|
|
|
- $baseDir = realpath(dirname(__FILE__).'/../../../fixtures/templates');
|
|
|
|
|
|
|
+ $baseDir = realpath(dirname(__FILE__) . '/../../../fixtures/templates');
|
|
|
|
|
|
|
|
$loader = new Mustache_Loader_FilesystemLoader('file://' . $baseDir, array('extension' => '.ms'));
|
|
$loader = new Mustache_Loader_FilesystemLoader('file://' . $baseDir, array('extension' => '.ms'));
|
|
|
$this->assertEquals('alpha contents', $loader->load('alpha'));
|
|
$this->assertEquals('alpha contents', $loader->load('alpha'));
|
|
@@ -40,7 +40,7 @@ class Mustache_Test_Loader_FilesystemLoaderTest extends PHPUnit_Framework_TestCa
|
|
|
|
|
|
|
|
public function testLoadTemplates()
|
|
public function testLoadTemplates()
|
|
|
{
|
|
{
|
|
|
- $baseDir = realpath(dirname(__FILE__).'/../../../fixtures/templates');
|
|
|
|
|
|
|
+ $baseDir = realpath(dirname(__FILE__) . '/../../../fixtures/templates');
|
|
|
$loader = new Mustache_Loader_FilesystemLoader($baseDir);
|
|
$loader = new Mustache_Loader_FilesystemLoader($baseDir);
|
|
|
$this->assertEquals('one contents', $loader->load('one'));
|
|
$this->assertEquals('one contents', $loader->load('one'));
|
|
|
$this->assertEquals('two contents', $loader->load('two.mustache'));
|
|
$this->assertEquals('two contents', $loader->load('two.mustache'));
|
|
@@ -48,7 +48,7 @@ class Mustache_Test_Loader_FilesystemLoaderTest extends PHPUnit_Framework_TestCa
|
|
|
|
|
|
|
|
public function testEmptyExtensionString()
|
|
public function testEmptyExtensionString()
|
|
|
{
|
|
{
|
|
|
- $baseDir = realpath(dirname(__FILE__).'/../../../fixtures/templates');
|
|
|
|
|
|
|
+ $baseDir = realpath(dirname(__FILE__) . '/../../../fixtures/templates');
|
|
|
|
|
|
|
|
$loader = new Mustache_Loader_FilesystemLoader($baseDir, array('extension' => ''));
|
|
$loader = new Mustache_Loader_FilesystemLoader($baseDir, array('extension' => ''));
|
|
|
$this->assertEquals('one contents', $loader->load('one.mustache'));
|
|
$this->assertEquals('one contents', $loader->load('one.mustache'));
|
|
@@ -64,7 +64,7 @@ class Mustache_Test_Loader_FilesystemLoaderTest extends PHPUnit_Framework_TestCa
|
|
|
*/
|
|
*/
|
|
|
public function testMissingBaseDirThrowsException()
|
|
public function testMissingBaseDirThrowsException()
|
|
|
{
|
|
{
|
|
|
- new Mustache_Loader_FilesystemLoader(dirname(__FILE__).'/not_a_directory');
|
|
|
|
|
|
|
+ new Mustache_Loader_FilesystemLoader(dirname(__FILE__) . '/not_a_directory');
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -72,7 +72,7 @@ class Mustache_Test_Loader_FilesystemLoaderTest extends PHPUnit_Framework_TestCa
|
|
|
*/
|
|
*/
|
|
|
public function testMissingTemplateThrowsException()
|
|
public function testMissingTemplateThrowsException()
|
|
|
{
|
|
{
|
|
|
- $baseDir = realpath(dirname(__FILE__).'/../../../fixtures/templates');
|
|
|
|
|
|
|
+ $baseDir = realpath(dirname(__FILE__) . '/../../../fixtures/templates');
|
|
|
$loader = new Mustache_Loader_FilesystemLoader($baseDir);
|
|
$loader = new Mustache_Loader_FilesystemLoader($baseDir);
|
|
|
|
|
|
|
|
$loader->load('fake');
|
|
$loader->load('fake');
|