concatenation with spaces around

This commit is contained in:
Dariusz Rumiński
2014-09-06 01:21:20 +02:00
parent c2a39e0f13
commit 1319f0486d
11 changed files with 26 additions and 26 deletions
+1 -1
View File
@@ -22,7 +22,7 @@ class Mustache_Test_AutoloaderTest extends PHPUnit_Framework_TestCase
public function testAutoloader()
{
$loader = new Mustache_Autoloader(dirname(__FILE__).'/../../fixtures/autoloader');
$loader = new Mustache_Autoloader(dirname(__FILE__) . '/../../fixtures/autoloader');
$this->assertNull($loader->autoload('NonMustacheClass'));
$this->assertFalse(class_exists('NonMustacheClass'));
+3 -3
View File
@@ -76,7 +76,7 @@ class Mustache_Test_CompilerTest extends PHPUnit_Framework_TestCase
array(
"\nclass Monkey extends Mustache_Template",
'$value = $this->resolveValue($context->find(\'name\'), $context, $indent);',
'$buffer .= $indent . htmlspecialchars($value, '.ENT_COMPAT.', \'ISO-8859-1\');',
'$buffer .= $indent . htmlspecialchars($value, ' . ENT_COMPAT . ', \'ISO-8859-1\');',
'return $buffer;',
)
),
@@ -96,7 +96,7 @@ class Mustache_Test_CompilerTest extends PHPUnit_Framework_TestCase
array(
"\nclass Monkey extends Mustache_Template",
'$value = $this->resolveValue($context->find(\'name\'), $context, $indent);',
'$buffer .= $indent . htmlspecialchars($value, '.ENT_QUOTES.', \'ISO-8859-1\');',
'$buffer .= $indent . htmlspecialchars($value, ' . ENT_QUOTES . ', \'ISO-8859-1\');',
'return $buffer;',
)
),
@@ -123,7 +123,7 @@ class Mustache_Test_CompilerTest extends PHPUnit_Framework_TestCase
"\nclass Monkey extends Mustache_Template",
"\$buffer .= \$indent . 'foo\n';",
'$value = $this->resolveValue($context->find(\'name\'), $context, $indent);',
'$buffer .= htmlspecialchars($value, '.ENT_COMPAT.', \'UTF-8\');',
'$buffer .= htmlspecialchars($value, ' . ENT_COMPAT . ', \'UTF-8\');',
'$value = $this->resolveValue($context->last(), $context, $indent);',
'$buffer .= \'\\\'bar\\\'\';',
'return $buffer;',
+1 -1
View File
@@ -237,7 +237,7 @@ class Mustache_Test_EngineTest extends Mustache_Test_FunctionalTestCase
public static function wrapWithUnderscores($text)
{
return '__'.$text.'__';
return '__' . $text . '__';
}
/**
@@ -23,7 +23,7 @@ class Mustache_Test_FiveThree_Functional_MustacheSpecTest extends Mustache_Test_
*/
public function testSpecInitialized()
{
if (!file_exists(dirname(__FILE__).'/../../../../../vendor/spec/specs/')) {
if (!file_exists(dirname(__FILE__) . '/../../../../../vendor/spec/specs/')) {
$this->markTestSkipped('Mustache spec submodule not initialized: run "git submodule update --init"');
}
}
@@ -46,7 +46,7 @@ class Mustache_Test_Functional_ExamplesTest extends PHPUnit_Framework_TestCase
*/
public function getExamples()
{
$path = realpath(dirname(__FILE__).'/../../../fixtures/examples');
$path = realpath(dirname(__FILE__) . '/../../../fixtures/examples');
$examples = array();
$handle = opendir($path);
@@ -55,7 +55,7 @@ class Mustache_Test_Functional_ExamplesTest extends PHPUnit_Framework_TestCase
continue;
}
$fullpath = $path.'/'.$file;
$fullpath = $path . '/' . $file;
if (is_dir($fullpath)) {
$examples[$file] = $this->loadExample($fullpath);
}
@@ -81,7 +81,7 @@ class Mustache_Test_Functional_ExamplesTest extends PHPUnit_Framework_TestCase
$handle = opendir($path);
while (($file = readdir($handle)) !== false) {
$fullpath = $path.'/'.$file;
$fullpath = $path . '/' . $file;
$info = pathinfo($fullpath);
if (is_dir($fullpath) && $info['basename'] == 'partials') {
@@ -128,7 +128,7 @@ class Mustache_Test_Functional_ExamplesTest extends PHPUnit_Framework_TestCase
continue;
}
$fullpath = $path.'/'.$file;
$fullpath = $path . '/' . $file;
$info = pathinfo($fullpath);
if ($info['extension'] === 'mustache') {
@@ -23,7 +23,7 @@ class Mustache_Test_Functional_MustacheSpecTest extends Mustache_Test_SpecTestCa
*/
public function testSpecInitialized()
{
if (!file_exists(dirname(__FILE__).'/../../../../vendor/spec/specs/')) {
if (!file_exists(dirname(__FILE__) . '/../../../../vendor/spec/specs/')) {
$this->markTestSkipped('Mustache spec submodule not initialized: run "git submodule update --init"');
}
}
+2 -2
View File
@@ -26,14 +26,14 @@ abstract class Mustache_Test_FunctionalTestCase extends PHPUnit_Framework_TestCa
*/
protected static function rmdir($path)
{
$path = rtrim($path, '/').'/';
$path = rtrim($path, '/') . '/';
$handle = opendir($path);
while (($file = readdir($handle)) !== false) {
if ($file == '.' || $file == '..') {
continue;
}
$fullpath = $path.$file;
$fullpath = $path . $file;
if (is_dir($fullpath)) {
self::rmdir($fullpath);
} else {
@@ -16,7 +16,7 @@ class Mustache_Test_Loader_FilesystemLoaderTest extends PHPUnit_Framework_TestCa
{
public function testConstructor()
{
$baseDir = realpath(dirname(__FILE__).'/../../../fixtures/templates');
$baseDir = realpath(dirname(__FILE__) . '/../../../fixtures/templates');
$loader = new Mustache_Loader_FilesystemLoader($baseDir, array('extension' => '.ms'));
$this->assertEquals('alpha contents', $loader->load('alpha'));
$this->assertEquals('beta contents', $loader->load('beta.ms'));
@@ -24,14 +24,14 @@ class Mustache_Test_Loader_FilesystemLoaderTest extends PHPUnit_Framework_TestCa
public function testTrailingSlashes()
{
$baseDir = dirname(__FILE__).'/../../../fixtures/templates/';
$baseDir = dirname(__FILE__) . '/../../../fixtures/templates/';
$loader = new Mustache_Loader_FilesystemLoader($baseDir);
$this->assertEquals('one contents', $loader->load('one'));
}
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'));
$this->assertEquals('alpha contents', $loader->load('alpha'));
@@ -40,7 +40,7 @@ class Mustache_Test_Loader_FilesystemLoaderTest extends PHPUnit_Framework_TestCa
public function testLoadTemplates()
{
$baseDir = realpath(dirname(__FILE__).'/../../../fixtures/templates');
$baseDir = realpath(dirname(__FILE__) . '/../../../fixtures/templates');
$loader = new Mustache_Loader_FilesystemLoader($baseDir);
$this->assertEquals('one contents', $loader->load('one'));
$this->assertEquals('two contents', $loader->load('two.mustache'));
@@ -48,7 +48,7 @@ class Mustache_Test_Loader_FilesystemLoaderTest extends PHPUnit_Framework_TestCa
public function testEmptyExtensionString()
{
$baseDir = realpath(dirname(__FILE__).'/../../../fixtures/templates');
$baseDir = realpath(dirname(__FILE__) . '/../../../fixtures/templates');
$loader = new Mustache_Loader_FilesystemLoader($baseDir, array('extension' => ''));
$this->assertEquals('one contents', $loader->load('one.mustache'));
@@ -64,7 +64,7 @@ class Mustache_Test_Loader_FilesystemLoaderTest extends PHPUnit_Framework_TestCa
*/
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()
{
$baseDir = realpath(dirname(__FILE__).'/../../../fixtures/templates');
$baseDir = realpath(dirname(__FILE__) . '/../../../fixtures/templates');
$loader = new Mustache_Loader_FilesystemLoader($baseDir);
$loader->load('fake');