CS update
This commit is contained in:
@@ -317,7 +317,7 @@ class Mustache_Test_EngineTest extends Mustache_Test_FunctionalTestCase
|
||||
list($name, $mustache) = $this->getLoggedMustache(Mustache_Logger::DEBUG);
|
||||
$mustache->render('{{ foo }}{{> bar }}', array('foo' => 'FOO'));
|
||||
$log = file_get_contents($name);
|
||||
$this->assertContains("DEBUG: Instantiating template: ", $log);
|
||||
$this->assertContains('DEBUG: Instantiating template: ', $log);
|
||||
$this->assertContains("WARNING: Partial not found: \"bar\"", $log);
|
||||
}
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ class Mustache_Test_FiveThree_Functional_EngineTest extends PHPUnit_Framework_Te
|
||||
|
||||
return array(
|
||||
array(array(Mustache_Engine::PRAGMA_FILTERS), $helpers, $data, $tpl, '2000-01-01 12:01:00'),
|
||||
array(array(), $helpers, $data, $tpl, '' ),
|
||||
array(array(), $helpers, $data, $tpl, ''),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ class Mustache_Test_FiveThree_Functional_FiltersTest extends PHPUnit_Framework_T
|
||||
array(
|
||||
'{{% FILTERS }}{{ date | longdate }}',
|
||||
$helpers,
|
||||
(object) array('date' => new DateTime('1/1/2000', new DateTimeZone("UTC"))),
|
||||
(object) array('date' => new DateTime('1/1/2000', new DateTimeZone('UTC'))),
|
||||
'2000-01-01 12:01:00',
|
||||
),
|
||||
|
||||
@@ -72,7 +72,7 @@ class Mustache_Test_FiveThree_Functional_FiltersTest extends PHPUnit_Framework_T
|
||||
});
|
||||
|
||||
$foo = new \StdClass();
|
||||
$foo->date = new DateTime('1/1/2000', new DateTimeZone("UTC"));
|
||||
$foo->date = new DateTime('1/1/2000', new DateTimeZone('UTC'));
|
||||
|
||||
$this->assertEquals('[[2000-01-01 12:01:00]]', $tpl->render($foo));
|
||||
}
|
||||
|
||||
@@ -55,13 +55,13 @@ class Mustache_Test_Logger_StreamLoggerTest extends PHPUnit_Framework_TestCase
|
||||
{
|
||||
$stream = tmpfile();
|
||||
$logger = new Mustache_Logger_StreamLogger($stream, $logLevel);
|
||||
$logger->log($level, "logged");
|
||||
$logger->log($level, 'logged');
|
||||
|
||||
rewind($stream);
|
||||
$result = fread($stream, 1024);
|
||||
|
||||
if ($shouldLog) {
|
||||
$this->assertContains("logged", $result);
|
||||
$this->assertContains('logged', $result);
|
||||
} else {
|
||||
$this->assertEmpty($result);
|
||||
}
|
||||
|
||||
@@ -154,7 +154,7 @@ class Mustache_Test_ParserTest extends PHPUnit_Framework_TestCase
|
||||
array(
|
||||
Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_TEXT,
|
||||
Mustache_Tokenizer::LINE => 0,
|
||||
Mustache_Tokenizer::VALUE => " ",
|
||||
Mustache_Tokenizer::VALUE => ' ',
|
||||
),
|
||||
array(
|
||||
Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_DELIM_CHANGE,
|
||||
|
||||
@@ -30,7 +30,7 @@ class Mustache_Test_TokenizerTest extends PHPUnit_Framework_TestCase
|
||||
{
|
||||
$tokenizer = new Mustache_Tokenizer();
|
||||
|
||||
$text = "{{{ name }}";
|
||||
$text = '{{{ name }}';
|
||||
$tokenizer->scan($text, null);
|
||||
}
|
||||
|
||||
@@ -41,8 +41,8 @@ class Mustache_Test_TokenizerTest extends PHPUnit_Framework_TestCase
|
||||
{
|
||||
$tokenizer = new Mustache_Tokenizer();
|
||||
|
||||
$text = "<%{ name %>";
|
||||
$tokenizer->scan($text, "<% %>");
|
||||
$text = '<%{ name %>';
|
||||
$tokenizer->scan($text, '<% %>');
|
||||
}
|
||||
|
||||
public function getTokens()
|
||||
@@ -183,7 +183,7 @@ class Mustache_Test_TokenizerTest extends PHPUnit_Framework_TestCase
|
||||
|
||||
// See https://github.com/bobthecow/mustache.php/issues/183
|
||||
array(
|
||||
"{{# a }}0{{/ a }}",
|
||||
'{{# a }}0{{/ a }}',
|
||||
null,
|
||||
array(
|
||||
array(
|
||||
@@ -197,7 +197,7 @@ class Mustache_Test_TokenizerTest extends PHPUnit_Framework_TestCase
|
||||
array(
|
||||
Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_TEXT,
|
||||
Mustache_Tokenizer::LINE => 0,
|
||||
Mustache_Tokenizer::VALUE => "0",
|
||||
Mustache_Tokenizer::VALUE => '0',
|
||||
),
|
||||
array(
|
||||
Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_END_SECTION,
|
||||
@@ -212,8 +212,8 @@ class Mustache_Test_TokenizerTest extends PHPUnit_Framework_TestCase
|
||||
|
||||
// custom delimiters don't swallow the next character, even if it is a }, }}}, or the same delimiter
|
||||
array(
|
||||
"<% a %>} <% b %>%> <% c %>}}}",
|
||||
"<% %>",
|
||||
'<% a %>} <% b %>%> <% c %>}}}',
|
||||
'<% %>',
|
||||
array(
|
||||
array(
|
||||
Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_ESCAPED,
|
||||
@@ -226,7 +226,7 @@ class Mustache_Test_TokenizerTest extends PHPUnit_Framework_TestCase
|
||||
array(
|
||||
Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_TEXT,
|
||||
Mustache_Tokenizer::LINE => 0,
|
||||
Mustache_Tokenizer::VALUE => "} ",
|
||||
Mustache_Tokenizer::VALUE => '} ',
|
||||
),
|
||||
array(
|
||||
Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_ESCAPED,
|
||||
@@ -239,7 +239,7 @@ class Mustache_Test_TokenizerTest extends PHPUnit_Framework_TestCase
|
||||
array(
|
||||
Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_TEXT,
|
||||
Mustache_Tokenizer::LINE => 0,
|
||||
Mustache_Tokenizer::VALUE => "%> ",
|
||||
Mustache_Tokenizer::VALUE => '%> ',
|
||||
),
|
||||
array(
|
||||
Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_ESCAPED,
|
||||
@@ -252,15 +252,15 @@ class Mustache_Test_TokenizerTest extends PHPUnit_Framework_TestCase
|
||||
array(
|
||||
Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_TEXT,
|
||||
Mustache_Tokenizer::LINE => 0,
|
||||
Mustache_Tokenizer::VALUE => "}}}",
|
||||
Mustache_Tokenizer::VALUE => '}}}',
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
// unescaped custom delimiters are properly parsed
|
||||
array(
|
||||
"<%{ a }%>",
|
||||
"<% %>",
|
||||
'<%{ a }%>',
|
||||
'<% %>',
|
||||
array(
|
||||
array(
|
||||
Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_UNESCAPED,
|
||||
@@ -289,7 +289,7 @@ class Mustache_Test_TokenizerTest extends PHPUnit_Framework_TestCase
|
||||
array(
|
||||
Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_TEXT,
|
||||
Mustache_Tokenizer::LINE => 0,
|
||||
Mustache_Tokenizer::VALUE => "default",
|
||||
Mustache_Tokenizer::VALUE => 'default',
|
||||
),
|
||||
array(
|
||||
Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_END_SECTION,
|
||||
|
||||
+4
-4
@@ -2,15 +2,15 @@
|
||||
|
||||
class Delimiters
|
||||
{
|
||||
public $start = "It worked the first time.";
|
||||
public $start = 'It worked the first time.';
|
||||
|
||||
public function middle()
|
||||
{
|
||||
return array(
|
||||
array('item' => "And it worked the second time."),
|
||||
array('item' => "As well as the third."),
|
||||
array('item' => 'And it worked the second time.'),
|
||||
array('item' => 'As well as the third.'),
|
||||
);
|
||||
}
|
||||
|
||||
public $final = "Then, surprisingly, it worked the final time.";
|
||||
public $final = 'Then, surprisingly, it worked the final time.';
|
||||
}
|
||||
|
||||
+1
-1
@@ -7,5 +7,5 @@ class DoubleSection
|
||||
return true;
|
||||
}
|
||||
|
||||
public $two = "second";
|
||||
public $two = 'second';
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
class SectionIteratorObjects
|
||||
{
|
||||
public $start = "It worked the first time.";
|
||||
public $start = 'It worked the first time.';
|
||||
|
||||
protected $_data = array(
|
||||
array('item' => 'And it worked the second time.'),
|
||||
@@ -14,5 +14,5 @@ class SectionIteratorObjects
|
||||
return new ArrayIterator($this->_data);
|
||||
}
|
||||
|
||||
public $final = "Then, surprisingly, it worked the final time.";
|
||||
public $final = 'Then, surprisingly, it worked the final time.';
|
||||
}
|
||||
|
||||
@@ -2,14 +2,14 @@
|
||||
|
||||
class SectionMagicObjects
|
||||
{
|
||||
public $start = "It worked the first time.";
|
||||
public $start = 'It worked the first time.';
|
||||
|
||||
public function middle()
|
||||
{
|
||||
return new MagicObject();
|
||||
}
|
||||
|
||||
public $final = "Then, surprisingly, it worked the final time.";
|
||||
public $final = 'Then, surprisingly, it worked the final time.';
|
||||
}
|
||||
|
||||
class MagicObject
|
||||
|
||||
@@ -2,14 +2,14 @@
|
||||
|
||||
class SectionObjects
|
||||
{
|
||||
public $start = "It worked the first time.";
|
||||
public $start = 'It worked the first time.';
|
||||
|
||||
public function middle()
|
||||
{
|
||||
return new SectionObject();
|
||||
}
|
||||
|
||||
public $final = "Then, surprisingly, it worked the final time.";
|
||||
public $final = 'Then, surprisingly, it worked the final time.';
|
||||
}
|
||||
|
||||
class SectionObject
|
||||
|
||||
+4
-4
@@ -2,15 +2,15 @@
|
||||
|
||||
class Sections
|
||||
{
|
||||
public $start = "It worked the first time.";
|
||||
public $start = 'It worked the first time.';
|
||||
|
||||
public function middle()
|
||||
{
|
||||
return array(
|
||||
array('item' => "And it worked the second time."),
|
||||
array('item' => "As well as the third."),
|
||||
array('item' => 'And it worked the second time.'),
|
||||
array('item' => 'As well as the third.'),
|
||||
);
|
||||
}
|
||||
|
||||
public $final = "Then, surprisingly, it worked the final time.";
|
||||
public $final = 'Then, surprisingly, it worked the final time.';
|
||||
}
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
|
||||
class Simple
|
||||
{
|
||||
public $name = "Chris";
|
||||
public $name = 'Chris';
|
||||
public $value = 10000;
|
||||
|
||||
public function taxed_value()
|
||||
|
||||
+1
-1
@@ -2,5 +2,5 @@
|
||||
|
||||
class Unescaped
|
||||
{
|
||||
public $title = "Bear > Shark";
|
||||
public $title = 'Bear > Shark';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user