mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-15 11:56:50 +00:00
Remove unused local vars
This commit is contained in:
@@ -48,7 +48,7 @@ class Twig_Tests_EnvironmentTest extends PHPUnit_Framework_TestCase
|
||||
// globals can be added after calling getGlobals
|
||||
$twig = new Twig_Environment(new Twig_Loader_String());
|
||||
$twig->addGlobal('foo', 'foo');
|
||||
$globals = $twig->getGlobals();
|
||||
$twig->getGlobals();
|
||||
$twig->addGlobal('foo', 'bar');
|
||||
$globals = $twig->getGlobals();
|
||||
$this->assertEquals('bar', $globals['foo']);
|
||||
@@ -65,7 +65,7 @@ class Twig_Tests_EnvironmentTest extends PHPUnit_Framework_TestCase
|
||||
// globals can be modified after extensions init
|
||||
$twig = new Twig_Environment(new Twig_Loader_String());
|
||||
$twig->addGlobal('foo', 'foo');
|
||||
$globals = $twig->getGlobals();
|
||||
$twig->getGlobals();
|
||||
$twig->getFunctions();
|
||||
$twig->addGlobal('foo', 'bar');
|
||||
$globals = $twig->getGlobals();
|
||||
@@ -74,7 +74,7 @@ class Twig_Tests_EnvironmentTest extends PHPUnit_Framework_TestCase
|
||||
// globals can be modified after extensions and runtime init
|
||||
$twig = new Twig_Environment(new Twig_Loader_String());
|
||||
$twig->addGlobal('foo', 'foo');
|
||||
$globals = $twig->getGlobals();
|
||||
$twig->getGlobals();
|
||||
$twig->getFunctions();
|
||||
$twig->initRuntime();
|
||||
$twig->addGlobal('foo', 'bar');
|
||||
|
||||
@@ -32,7 +32,7 @@ class Twig_Tests_FileCachingTest extends PHPUnit_Framework_TestCase
|
||||
public function testWritingCacheFiles()
|
||||
{
|
||||
$name = 'This is just text.';
|
||||
$template = $this->env->loadTemplate($name);
|
||||
$this->env->loadTemplate($name);
|
||||
$cacheFileName = $this->env->getCacheFilename($name);
|
||||
|
||||
$this->assertTrue(file_exists($cacheFileName), 'Cache file does not exist.');
|
||||
@@ -42,7 +42,7 @@ class Twig_Tests_FileCachingTest extends PHPUnit_Framework_TestCase
|
||||
public function testClearingCacheFiles()
|
||||
{
|
||||
$name = 'I will be deleted.';
|
||||
$template = $this->env->loadTemplate($name);
|
||||
$this->env->loadTemplate($name);
|
||||
$cacheFileName = $this->env->getCacheFilename($name);
|
||||
|
||||
$this->assertTrue(file_exists($cacheFileName), 'Cache file does not exist.');
|
||||
|
||||
@@ -46,7 +46,6 @@ class Twig_Tests_LexerTest extends PHPUnit_Framework_TestCase
|
||||
$stream = $lexer->tokenize($template);
|
||||
|
||||
$count = 0;
|
||||
$tokens = array();
|
||||
while (!$stream->isEOF()) {
|
||||
$token = $stream->next();
|
||||
if ($type === $token->getType()) {
|
||||
@@ -114,7 +113,7 @@ class Twig_Tests_LexerTest extends PHPUnit_Framework_TestCase
|
||||
$template = '{% raw %}'.str_repeat('*', 100000).'{% endraw %}';
|
||||
|
||||
$lexer = new Twig_Lexer(new Twig_Environment());
|
||||
$stream = $lexer->tokenize($template);
|
||||
$lexer->tokenize($template);
|
||||
|
||||
// should not throw an exception
|
||||
}
|
||||
@@ -124,7 +123,7 @@ class Twig_Tests_LexerTest extends PHPUnit_Framework_TestCase
|
||||
$template = '{{ '.str_repeat('x', 100000).' }}';
|
||||
|
||||
$lexer = new Twig_Lexer(new Twig_Environment());
|
||||
$stream = $lexer->tokenize($template);
|
||||
$lexer->tokenize($template);
|
||||
|
||||
// should not throw an exception
|
||||
}
|
||||
@@ -134,7 +133,7 @@ class Twig_Tests_LexerTest extends PHPUnit_Framework_TestCase
|
||||
$template = '{% '.str_repeat('x', 100000).' %}';
|
||||
|
||||
$lexer = new Twig_Lexer(new Twig_Environment());
|
||||
$stream = $lexer->tokenize($template);
|
||||
$lexer->tokenize($template);
|
||||
|
||||
// should not throw an exception
|
||||
}
|
||||
@@ -216,7 +215,7 @@ class Twig_Tests_LexerTest extends PHPUnit_Framework_TestCase
|
||||
$template = '{{ "bar #{x" }}';
|
||||
|
||||
$lexer = new Twig_Lexer(new Twig_Environment());
|
||||
$stream = $lexer->tokenize($template);
|
||||
$lexer->tokenize($template);
|
||||
}
|
||||
|
||||
public function testStringWithNestedInterpolations()
|
||||
@@ -281,7 +280,7 @@ bar
|
||||
';
|
||||
|
||||
$lexer = new Twig_Lexer(new Twig_Environment());
|
||||
$stream = $lexer->tokenize($template);
|
||||
$lexer->tokenize($template);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -300,6 +299,6 @@ bar
|
||||
';
|
||||
|
||||
$lexer = new Twig_Lexer(new Twig_Environment());
|
||||
$stream = $lexer->tokenize($template);
|
||||
$lexer->tokenize($template);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -301,7 +301,7 @@ class Twig_Test_EscapingTest extends PHPUnit_Framework_TestCase
|
||||
|
||||
public function testCssEscapingEscapesOwaspRecommendedRanges()
|
||||
{
|
||||
$immune = array(); // CSS has no exceptions to escaping ranges
|
||||
// CSS has no exceptions to escaping ranges
|
||||
for ($chr=0; $chr < 0xFF; $chr++) {
|
||||
if ($chr >= 0x30 && $chr <= 0x39
|
||||
|| $chr >= 0x41 && $chr <= 0x5A
|
||||
|
||||
Reference in New Issue
Block a user