diff --git a/ajax/fetch_collection.php b/ajax/fetch_collection.php index 318a63e..878d748 100755 --- a/ajax/fetch_collection.php +++ b/ajax/fetch_collection.php @@ -72,7 +72,7 @@ $params = []; /** - * POSTed object: + * POSTed object properties: * selected_collection_method * selected_collection_label * selected_collection_key @@ -97,15 +97,19 @@ $output_method = $_POST['selected_output_method']; } - switch ($method) { - case 'stat_5minutes_gateway': - $params = [null, null, $gateway_stats_attribs]; - break; - case 'stat_hourly_gateway': - $params = [null, null, $gateway_stats_attribs]; - break; - case 'stat_daily_gateway': - $params = [null, null, $gateway_stats_attribs]; + if (empty($params)) { + switch ($method) { + case 'stat_5minutes_gateway': + $params = [null, null, $gateway_stats_attribs]; + + break; + case 'stat_hourly_gateway': + $params = [null, null, $gateway_stats_attribs]; + + break; + case 'stat_daily_gateway': + $params = [null, null, $gateway_stats_attribs]; + } } if (!empty($method) && !empty($site_id)) { @@ -162,17 +166,14 @@ /** * Plain render mode */ + Kint_Renderer_Text::$decorations = false; Kint::$display_called_from = false; $results['data'] = @s($data_array); } else { $results['data'] = $data_array; } - - /** - * for other future output methods - */ - //$results['data'] = print_r($data_array, true); } + /** * execute timing of data collection from UniFi controller */ diff --git a/common.php b/common.php index b35424c..033101c 100755 --- a/common.php +++ b/common.php @@ -7,7 +7,7 @@ * with this package in the file LICENSE.md * */ -define('TOOL_VERSION', '2.0.4'); +define('TOOL_VERSION', '2.0.5'); /** * gather some basic information for the About modal diff --git a/composer.lock b/composer.lock index 900907c..27c5100 100755 --- a/composer.lock +++ b/composer.lock @@ -113,16 +113,16 @@ }, { "name": "symfony/polyfill-ctype", - "version": "v1.12.0", + "version": "v1.13.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "550ebaac289296ce228a706d0867afc34687e3f4" + "reference": "f8f0b461be3385e56d6de3dbb5a0df24c0c275e3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/550ebaac289296ce228a706d0867afc34687e3f4", - "reference": "550ebaac289296ce228a706d0867afc34687e3f4", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/f8f0b461be3385e56d6de3dbb5a0df24c0c275e3", + "reference": "f8f0b461be3385e56d6de3dbb5a0df24c0c275e3", "shasum": "" }, "require": { @@ -134,7 +134,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.12-dev" + "dev-master": "1.13-dev" } }, "autoload": { @@ -167,20 +167,20 @@ "polyfill", "portable" ], - "time": "2019-08-06T08:03:45+00:00" + "time": "2019-11-27T13:56:44+00:00" }, { "name": "twig/twig", - "version": "v1.42.3", + "version": "v1.42.4", "source": { "type": "git", "url": "https://github.com/twigphp/Twig.git", - "reference": "201baee843e0ffe8b0b956f336dd42b2a92fae4e" + "reference": "e587180584c3d2d6cb864a0454e777bb6dcb6152" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/twigphp/Twig/zipball/201baee843e0ffe8b0b956f336dd42b2a92fae4e", - "reference": "201baee843e0ffe8b0b956f336dd42b2a92fae4e", + "url": "https://api.github.com/repos/twigphp/Twig/zipball/e587180584c3d2d6cb864a0454e777bb6dcb6152", + "reference": "e587180584c3d2d6cb864a0454e777bb6dcb6152", "shasum": "" }, "require": { @@ -233,7 +233,7 @@ "keywords": [ "templating" ], - "time": "2019-08-24T12:51:03+00:00" + "time": "2019-11-11T16:49:32+00:00" } ], "packages-dev": [], diff --git a/index.php b/index.php index 7fe7de7..978401d 100755 --- a/index.php +++ b/index.php @@ -14,7 +14,8 @@ session_start(); /** - * check whether user has requested to clear (force expiry) the PHP session + * check whether user has requested to clear (force expiry) the PHP session, if so we + * clear the session and reload the page without the query string * - this feature can be useful when login errors occur, mostly after upgrades or credential changes */ if (isset($_GET['reset_session']) && $_GET['reset_session'] == true) { @@ -22,6 +23,9 @@ session_unset(); session_destroy(); session_start(); + $current_url = $_SERVER['REQUEST_URI']; + $current_url = strtok($current_url, '?'); + header("refresh: 0; url = $current_url"); } /** diff --git a/js/custom.js b/js/custom.js index 8022a3b..9435892 100755 --- a/js/custom.js +++ b/js/custom.js @@ -547,6 +547,7 @@ $('#about_modal').on('shown.bs.modal', function (e) { $('#span_api_browser_update').removeClass('badge-success').addClass('badge-warning'); } else if (api_browser_version == json.tag_name.substring(1)) { $('#span_api_browser_update').html('up to date'); + $('#span_api_browser_update').removeClass('badge-danger').addClass('badge-success'); } else { $('#span_api_browser_update').html('bleeding edge!'); $('#span_api_browser_update').removeClass('badge-success').addClass('badge-danger'); diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index 3521ad0..0879324 100755 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -110,17 +110,17 @@ }, { "name": "symfony/polyfill-ctype", - "version": "v1.12.0", - "version_normalized": "1.12.0.0", + "version": "v1.13.0", + "version_normalized": "1.13.0.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "550ebaac289296ce228a706d0867afc34687e3f4" + "reference": "f8f0b461be3385e56d6de3dbb5a0df24c0c275e3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/550ebaac289296ce228a706d0867afc34687e3f4", - "reference": "550ebaac289296ce228a706d0867afc34687e3f4", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/f8f0b461be3385e56d6de3dbb5a0df24c0c275e3", + "reference": "f8f0b461be3385e56d6de3dbb5a0df24c0c275e3", "shasum": "" }, "require": { @@ -129,11 +129,11 @@ "suggest": { "ext-ctype": "For best performance" }, - "time": "2019-08-06T08:03:45+00:00", + "time": "2019-11-27T13:56:44+00:00", "type": "library", "extra": { "branch-alias": { - "dev-master": "1.12-dev" + "dev-master": "1.13-dev" } }, "installation-source": "dist", @@ -170,17 +170,17 @@ }, { "name": "twig/twig", - "version": "v1.42.3", - "version_normalized": "1.42.3.0", + "version": "v1.42.4", + "version_normalized": "1.42.4.0", "source": { "type": "git", "url": "https://github.com/twigphp/Twig.git", - "reference": "201baee843e0ffe8b0b956f336dd42b2a92fae4e" + "reference": "e587180584c3d2d6cb864a0454e777bb6dcb6152" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/twigphp/Twig/zipball/201baee843e0ffe8b0b956f336dd42b2a92fae4e", - "reference": "201baee843e0ffe8b0b956f336dd42b2a92fae4e", + "url": "https://api.github.com/repos/twigphp/Twig/zipball/e587180584c3d2d6cb864a0454e777bb6dcb6152", + "reference": "e587180584c3d2d6cb864a0454e777bb6dcb6152", "shasum": "" }, "require": { @@ -192,7 +192,7 @@ "symfony/debug": "^3.4|^4.2", "symfony/phpunit-bridge": "^4.4@dev|^5.0" }, - "time": "2019-08-24T12:51:03+00:00", + "time": "2019-11-11T16:49:32+00:00", "type": "library", "extra": { "branch-alias": { diff --git a/vendor/symfony/polyfill-ctype/Ctype.php b/vendor/symfony/polyfill-ctype/Ctype.php old mode 100755 new mode 100644 diff --git a/vendor/symfony/polyfill-ctype/LICENSE b/vendor/symfony/polyfill-ctype/LICENSE old mode 100755 new mode 100644 diff --git a/vendor/symfony/polyfill-ctype/README.md b/vendor/symfony/polyfill-ctype/README.md old mode 100755 new mode 100644 diff --git a/vendor/symfony/polyfill-ctype/bootstrap.php b/vendor/symfony/polyfill-ctype/bootstrap.php old mode 100755 new mode 100644 diff --git a/vendor/symfony/polyfill-ctype/composer.json b/vendor/symfony/polyfill-ctype/composer.json old mode 100755 new mode 100644 index 090f923..2a2ea04 --- a/vendor/symfony/polyfill-ctype/composer.json +++ b/vendor/symfony/polyfill-ctype/composer.json @@ -28,7 +28,7 @@ "minimum-stability": "dev", "extra": { "branch-alias": { - "dev-master": "1.12-dev" + "dev-master": "1.13-dev" } } } diff --git a/vendor/twig/twig/.gitattributes b/vendor/twig/twig/.gitattributes new file mode 100644 index 0000000..3a3ce6e --- /dev/null +++ b/vendor/twig/twig/.gitattributes @@ -0,0 +1,2 @@ +/tests export-ignore +/phpunit.xml.dist export-ignore diff --git a/vendor/twig/twig/CHANGELOG b/vendor/twig/twig/CHANGELOG index 6ca3d45..b9833e5 100644 --- a/vendor/twig/twig/CHANGELOG +++ b/vendor/twig/twig/CHANGELOG @@ -1,3 +1,8 @@ +* 1.42.4 (2019-11-11) + + * optimized "block('foo') ?? 'bar" + * added supported for exponential numbers + * 1.42.3 (2019-08-24) * fixed the "split" filter when the delimiter is "0" diff --git a/vendor/twig/twig/doc/filters/batch.rst b/vendor/twig/twig/doc/filters/batch.rst index cc50ec8..a127173 100644 --- a/vendor/twig/twig/doc/filters/batch.rst +++ b/vendor/twig/twig/doc/filters/batch.rst @@ -49,3 +49,4 @@ Arguments * ``size``: The size of the batch; fractional numbers will be rounded up * ``fill``: Used to fill in missing items +* ``preserve_keys``: Whether to preserve keys or not diff --git a/vendor/twig/twig/doc/filters/map.rst b/vendor/twig/twig/doc/filters/map.rst index 9b1f5d7..e983e33 100644 --- a/vendor/twig/twig/doc/filters/map.rst +++ b/vendor/twig/twig/doc/filters/map.rst @@ -34,5 +34,4 @@ Note that the arrow function has access to the current context. Arguments --------- -* ``array``: The sequence or mapping * ``arrow``: The arrow function diff --git a/vendor/twig/twig/doc/filters/reduce.rst b/vendor/twig/twig/doc/filters/reduce.rst index 7d04d6c..fd38967 100644 --- a/vendor/twig/twig/doc/filters/reduce.rst +++ b/vendor/twig/twig/doc/filters/reduce.rst @@ -28,6 +28,5 @@ Note that the arrow function has access to the current context. Arguments --------- -* ``array``: The sequence or mapping * ``arrow``: The arrow function * ``initial``: The initial value diff --git a/vendor/twig/twig/ext/twig/php_twig.h b/vendor/twig/twig/ext/twig/php_twig.h index 79ac938..6cc47b6 100644 --- a/vendor/twig/twig/ext/twig/php_twig.h +++ b/vendor/twig/twig/ext/twig/php_twig.h @@ -15,7 +15,7 @@ #ifndef PHP_TWIG_H #define PHP_TWIG_H -#define PHP_TWIG_VERSION "1.42.3" +#define PHP_TWIG_VERSION "1.42.4" #include "php.h" diff --git a/vendor/twig/twig/phpunit.xml.dist b/vendor/twig/twig/phpunit.xml.dist deleted file mode 100644 index 391f244..0000000 --- a/vendor/twig/twig/phpunit.xml.dist +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - ./tests/ - - - - - - - - - - - - - - - ./src/ - - - diff --git a/vendor/twig/twig/src/Environment.php b/vendor/twig/twig/src/Environment.php index acd8233..1f80f3a 100644 --- a/vendor/twig/twig/src/Environment.php +++ b/vendor/twig/twig/src/Environment.php @@ -41,11 +41,11 @@ */ class Environment { - const VERSION = '1.42.3'; - const VERSION_ID = 14203; + const VERSION = '1.42.4'; + const VERSION_ID = 14204; const MAJOR_VERSION = 1; const MINOR_VERSION = 42; - const RELEASE_VERSION = 3; + const RELEASE_VERSION = 4; const EXTRA_VERSION = ''; protected $charset; @@ -515,7 +515,7 @@ public function loadClass($cls, $name, $index = null) * * This method should not be used as a generic way to load templates. * - * @param string $template The template name + * @param string $template The template source * @param string $name An optional name of the template to be used in error messages * * @return TemplateWrapper A template instance representing the given template name diff --git a/vendor/twig/twig/src/Lexer.php b/vendor/twig/twig/src/Lexer.php index 8cae359..697a6cf 100644 --- a/vendor/twig/twig/src/Lexer.php +++ b/vendor/twig/twig/src/Lexer.php @@ -47,7 +47,7 @@ class Lexer implements \Twig_LexerInterface const STATE_INTERPOLATION = 4; const REGEX_NAME = '/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/A'; - const REGEX_NUMBER = '/[0-9]+(?:\.[0-9]+)?/A'; + const REGEX_NUMBER = '/[0-9]+(?:\.[0-9]+)?([Ee][\+\-][0-9]+)?/A'; const REGEX_STRING = '/"([^#"\\\\]*(?:\\\\.[^#"\\\\]*)*)"|\'([^\'\\\\]*(?:\\\\.[^\'\\\\]*)*)\'/As'; const REGEX_DQ_STRING_DELIM = '/"/A'; const REGEX_DQ_STRING_PART = '/[^#"\\\\]*(?:(?:\\\\.|#(?!\{))[^#"\\\\]*)*/As'; diff --git a/vendor/twig/twig/src/Node/Expression/NullCoalesceExpression.php b/vendor/twig/twig/src/Node/Expression/NullCoalesceExpression.php index 49326d4..917d31a 100644 --- a/vendor/twig/twig/src/Node/Expression/NullCoalesceExpression.php +++ b/vendor/twig/twig/src/Node/Expression/NullCoalesceExpression.php @@ -22,11 +22,15 @@ class NullCoalesceExpression extends ConditionalExpression { public function __construct(\Twig_NodeInterface $left, \Twig_NodeInterface $right, $lineno) { - $test = new AndBinary( - new DefinedTest(clone $left, 'defined', new Node(), $left->getTemplateLine()), - new NotUnary(new NullTest($left, 'null', new Node(), $left->getTemplateLine()), $left->getTemplateLine()), - $left->getTemplateLine() - ); + $test = new DefinedTest(clone $left, 'defined', new Node(), $left->getTemplateLine()); + // for "block()", we don't need the null test as the return value is always a string + if (!$left instanceof BlockReferenceExpression) { + $test = new AndBinary( + $test, + new NotUnary(new NullTest($left, 'null', new Node(), $left->getTemplateLine()), $left->getTemplateLine()), + $left->getTemplateLine() + ); + } parent::__construct($test, $left, $right, $lineno); } diff --git a/vendor/twig/twig/tests/AutoloaderTest.php b/vendor/twig/twig/tests/AutoloaderTest.php deleted file mode 100644 index 9bf538a..0000000 --- a/vendor/twig/twig/tests/AutoloaderTest.php +++ /dev/null @@ -1,26 +0,0 @@ -assertFalse(class_exists('FooBarFoo'), '->autoload() does not try to load classes that does not begin with Twig'); - - $autoloader = new \Twig_Autoloader(); - $this->assertNull($autoloader->autoload('Foo'), '->autoload() returns false if it is not able to load a class'); - } -} diff --git a/vendor/twig/twig/tests/Cache/FilesystemTest.php b/vendor/twig/twig/tests/Cache/FilesystemTest.php deleted file mode 100644 index c810cae..0000000 --- a/vendor/twig/twig/tests/Cache/FilesystemTest.php +++ /dev/null @@ -1,193 +0,0 @@ -classname = '__Twig_Tests_Cache_FilesystemTest_Template_'.$nonce; - $this->directory = sys_get_temp_dir().'/twig-test'; - $this->cache = new FilesystemCache($this->directory); - } - - protected function tearDown() - { - if (file_exists($this->directory)) { - FilesystemHelper::removeDir($this->directory); - } - } - - public function testLoad() - { - $key = $this->directory.'/cache/cachefile.php'; - - $dir = \dirname($key); - @mkdir($dir, 0777, true); - $this->assertDirectoryExists($dir); - $this->assertFalse(class_exists($this->classname, false)); - - $content = $this->generateSource(); - file_put_contents($key, $content); - - $this->cache->load($key); - - $this->assertTrue(class_exists($this->classname, false)); - } - - public function testLoadMissing() - { - $key = $this->directory.'/cache/cachefile.php'; - - $this->assertFalse(class_exists($this->classname, false)); - - $this->cache->load($key); - - $this->assertFalse(class_exists($this->classname, false)); - } - - public function testWrite() - { - $key = $this->directory.'/cache/cachefile.php'; - $content = $this->generateSource(); - - $this->assertFileNotExists($key); - $this->assertFileNotExists($this->directory); - - $this->cache->write($key, $content); - - $this->assertFileExists($this->directory); - $this->assertFileExists($key); - $this->assertSame(file_get_contents($key), $content); - } - - public function testWriteFailMkdir() - { - $this->expectException('\RuntimeException'); - $this->expectExceptionMessage('Unable to create the cache directory'); - - if (\defined('PHP_WINDOWS_VERSION_BUILD')) { - $this->markTestSkipped('Read-only directories not possible on Windows.'); - } - - $key = $this->directory.'/cache/cachefile.php'; - $content = $this->generateSource(); - - $this->assertFileNotExists($key); - - // Create read-only root directory. - @mkdir($this->directory, 0555, true); - $this->assertDirectoryExists($this->directory); - - $this->cache->write($key, $content); - } - - public function testWriteFailDirWritable() - { - $this->expectException('\RuntimeException'); - $this->expectExceptionMessage('Unable to write in the cache directory'); - - if (\defined('PHP_WINDOWS_VERSION_BUILD')) { - $this->markTestSkipped('Read-only directories not possible on Windows.'); - } - - $key = $this->directory.'/cache/cachefile.php'; - $content = $this->generateSource(); - - $this->assertFileNotExists($key); - - // Create root directory. - @mkdir($this->directory, 0777, true); - // Create read-only subdirectory. - @mkdir($this->directory.'/cache', 0555); - $this->assertDirectoryExists($this->directory.'/cache'); - - $this->cache->write($key, $content); - } - - public function testWriteFailWriteFile() - { - $this->expectException('\RuntimeException'); - $this->expectExceptionMessage('Failed to write cache file'); - - $key = $this->directory.'/cache/cachefile.php'; - $content = $this->generateSource(); - - $this->assertFileNotExists($key); - - // Create a directory in the place of the cache file. - @mkdir($key, 0777, true); - $this->assertDirectoryExists($key); - - $this->cache->write($key, $content); - } - - public function testGetTimestamp() - { - $key = $this->directory.'/cache/cachefile.php'; - - $dir = \dirname($key); - @mkdir($dir, 0777, true); - $this->assertDirectoryExists($dir); - - // Create the file with a specific modification time. - touch($key, 1234567890); - - $this->assertSame(1234567890, $this->cache->getTimestamp($key)); - } - - public function testGetTimestampMissingFile() - { - $key = $this->directory.'/cache/cachefile.php'; - $this->assertSame(0, $this->cache->getTimestamp($key)); - } - - /** - * Test file cache is tolerant towards trailing (back)slashes on the configured cache directory. - * - * @dataProvider provideDirectories - */ - public function testGenerateKey($expected, $input) - { - $cache = new FilesystemCache($input); - $this->assertRegExp($expected, $cache->generateKey('_test_', \get_class($this))); - } - - public function provideDirectories() - { - $pattern = '#a/b/[a-zA-Z0-9]+/[a-zA-Z0-9]+.php$#'; - - return [ - [$pattern, 'a/b'], - [$pattern, 'a/b/'], - [$pattern, 'a/b\\'], - [$pattern, 'a/b\\/'], - [$pattern, 'a/b\\//'], - ['#/'.substr($pattern, 1), '/a/b'], - ]; - } - - private function generateSource() - { - return strtr(' $this->classname, - ]); - } -} diff --git a/vendor/twig/twig/tests/CompilerTest.php b/vendor/twig/twig/tests/CompilerTest.php deleted file mode 100644 index cc462c2..0000000 --- a/vendor/twig/twig/tests/CompilerTest.php +++ /dev/null @@ -1,38 +0,0 @@ -createMock('\Twig\Loader\LoaderInterface'))); - - $locale = setlocale(LC_NUMERIC, 0); - if (false === $locale) { - $this->markTestSkipped('Your platform does not support locales.'); - } - - $required_locales = ['fr_FR.UTF-8', 'fr_FR.UTF8', 'fr_FR.utf-8', 'fr_FR.utf8', 'French_France.1252']; - if (false === setlocale(LC_NUMERIC, $required_locales)) { - $this->markTestSkipped('Could not set any of required locales: '.implode(', ', $required_locales)); - } - - $this->assertEquals('1.2', $compiler->repr(1.2)->getSource()); - $this->assertStringContainsString('fr', strtolower(setlocale(LC_NUMERIC, 0))); - - setlocale(LC_NUMERIC, $locale); - } -} diff --git a/vendor/twig/twig/tests/ContainerRuntimeLoaderTest.php b/vendor/twig/twig/tests/ContainerRuntimeLoaderTest.php deleted file mode 100644 index c856483..0000000 --- a/vendor/twig/twig/tests/ContainerRuntimeLoaderTest.php +++ /dev/null @@ -1,44 +0,0 @@ -createMock('Psr\Container\ContainerInterface'); - $container->expects($this->once())->method('has')->with('stdClass')->willReturn(true); - $container->expects($this->once())->method('get')->with('stdClass')->willReturn(new \stdClass()); - - $loader = new ContainerRuntimeLoader($container); - - $this->assertInstanceOf('stdClass', $loader->load('stdClass')); - } - - /** - * @requires PHP 5.3 - */ - public function testLoadUnknownRuntimeReturnsNull() - { - $container = $this->createMock('Psr\Container\ContainerInterface'); - $container->expects($this->once())->method('has')->with('Foo'); - $container->expects($this->never())->method('get'); - - $loader = new ContainerRuntimeLoader($container); - $this->assertNull($loader->load('Foo')); - } -} diff --git a/vendor/twig/twig/tests/CustomExtensionTest.php b/vendor/twig/twig/tests/CustomExtensionTest.php deleted file mode 100644 index b45e143..0000000 --- a/vendor/twig/twig/tests/CustomExtensionTest.php +++ /dev/null @@ -1,94 +0,0 @@ -expectException('InvalidArgumentException'); - $this->expectExceptionMessage($expectedExceptionMessage); - - $env = new Environment($this->createMock('\Twig\Loader\LoaderInterface')); - $env->addExtension($extension); - $env->getUnaryOperators(); - } - - public function provideInvalidExtensions() - { - return [ - [new InvalidOperatorExtension(new \stdClass()), '"Twig\Tests\InvalidOperatorExtension::getOperators()" must return an array with operators, got "stdClass".'], - [new InvalidOperatorExtension([1, 2, 3]), '"Twig\Tests\InvalidOperatorExtension::getOperators()" must return an array of 2 elements, got 3.'], - ]; - } -} - -class InvalidOperatorExtension implements ExtensionInterface -{ - private $operators; - - public function __construct($operators) - { - $this->operators = $operators; - } - - public function initRuntime(Environment $environment) - { - } - - public function getTokenParsers() - { - return []; - } - - public function getNodeVisitors() - { - return []; - } - - public function getFilters() - { - return []; - } - - public function getTests() - { - return []; - } - - public function getFunctions() - { - return []; - } - - public function getGlobals() - { - return []; - } - - public function getOperators() - { - return $this->operators; - } - - public function getName() - { - return __CLASS__; - } -} diff --git a/vendor/twig/twig/tests/EnvironmentTest.php b/vendor/twig/twig/tests/EnvironmentTest.php deleted file mode 100644 index 54a8945..0000000 --- a/vendor/twig/twig/tests/EnvironmentTest.php +++ /dev/null @@ -1,678 +0,0 @@ -tokenize('{{ foo }}', 'foo'); - $this->assertEquals('{{ foo }}', $stream->getSource()); - $this->assertEquals('foo', $stream->getFilename()); - } - - /** - * @group legacy - */ - public function testLegacyCompileSourceSignature() - { - $loader = new ArrayLoader(['foo' => '{{ foo }}']); - $env = new Environment($loader); - $this->assertStringContainsString('getTemplateName', $env->compileSource('{{ foo }}', 'foo')); - } - - /** - * @group legacy - */ - public function testRenderNoLoader() - { - $this->expectException('\LogicException'); - $this->expectExceptionMessage('You must set a loader first.'); - - $env = new Environment(); - $env->render('test'); - } - - public function testAutoescapeOption() - { - $loader = new ArrayLoader([ - 'html' => '{{ foo }} {{ foo }}', - 'js' => '{{ bar }} {{ bar }}', - ]); - - $twig = new Environment($loader, [ - 'debug' => true, - 'cache' => false, - 'autoescape' => [$this, 'escapingStrategyCallback'], - ]); - - $this->assertEquals('foo<br/ > foo<br/ >', $twig->render('html', ['foo' => 'foo
'])); - $this->assertEquals('foo\u003Cbr\/\u0020\u003E foo\u003Cbr\/\u0020\u003E', $twig->render('js', ['bar' => 'foo
'])); - } - - public function escapingStrategyCallback($name) - { - return $name; - } - - public function testGlobals() - { - // to be removed in 2.0 - $loader = $this->createMock('\Twig\Tests\EnvironmentTestLoaderInterface'); - //$loader = $this->createMock(['\Twig\Loader\LoaderInterface', '\Twig\Loader\SourceContextLoaderInterface']); - $loader->expects($this->any())->method('getSourceContext')->willReturn(new Source('', '')); - - // globals can be added after calling getGlobals - - $twig = new Environment($loader); - $twig->addGlobal('foo', 'foo'); - $twig->getGlobals(); - $twig->addGlobal('foo', 'bar'); - $globals = $twig->getGlobals(); - $this->assertEquals('bar', $globals['foo']); - - // globals can be modified after a template has been loaded - $twig = new Environment($loader); - $twig->addGlobal('foo', 'foo'); - $twig->getGlobals(); - $twig->load('index'); - $twig->addGlobal('foo', 'bar'); - $globals = $twig->getGlobals(); - $this->assertEquals('bar', $globals['foo']); - - // globals can be modified after extensions init - $twig = new Environment($loader); - $twig->addGlobal('foo', 'foo'); - $twig->getGlobals(); - $twig->getFunctions(); - $twig->addGlobal('foo', 'bar'); - $globals = $twig->getGlobals(); - $this->assertEquals('bar', $globals['foo']); - - // globals can be modified after extensions and a template has been loaded - $arrayLoader = new ArrayLoader(['index' => '{{foo}}']); - $twig = new Environment($arrayLoader); - $twig->addGlobal('foo', 'foo'); - $twig->getGlobals(); - $twig->getFunctions(); - $twig->load('index'); - $twig->addGlobal('foo', 'bar'); - $globals = $twig->getGlobals(); - $this->assertEquals('bar', $globals['foo']); - - $twig = new Environment($arrayLoader); - $twig->getGlobals(); - $twig->addGlobal('foo', 'bar'); - $template = $twig->load('index'); - $this->assertEquals('bar', $template->render([])); - - /* to be uncomment in Twig 2.0 - // globals cannot be added after a template has been loaded - $twig = new Environment($loader); - $twig->addGlobal('foo', 'foo'); - $twig->getGlobals(); - $twig->load('index'); - try { - $twig->addGlobal('bar', 'bar'); - $this->fail(); - } catch (\LogicException $e) { - $this->assertFalse(array_key_exists('bar', $twig->getGlobals())); - } - - // globals cannot be added after extensions init - $twig = new Environment($loader); - $twig->addGlobal('foo', 'foo'); - $twig->getGlobals(); - $twig->getFunctions(); - try { - $twig->addGlobal('bar', 'bar'); - $this->fail(); - } catch (\LogicException $e) { - $this->assertFalse(array_key_exists('bar', $twig->getGlobals())); - } - - // globals cannot be added after extensions and a template has been loaded - $twig = new Environment($loader); - $twig->addGlobal('foo', 'foo'); - $twig->getGlobals(); - $twig->getFunctions(); - $twig->load('index'); - try { - $twig->addGlobal('bar', 'bar'); - $this->fail(); - } catch (\LogicException $e) { - $this->assertFalse(array_key_exists('bar', $twig->getGlobals())); - } - - // test adding globals after a template has been loaded without call to getGlobals - $twig = new Environment($loader); - $twig->load('index'); - try { - $twig->addGlobal('bar', 'bar'); - $this->fail(); - } catch (\LogicException $e) { - $this->assertFalse(array_key_exists('bar', $twig->getGlobals())); - } - */ - } - - public function testExtensionsAreNotInitializedWhenRenderingACompiledTemplate() - { - $cache = new FilesystemCache($dir = sys_get_temp_dir().'/twig'); - $options = ['cache' => $cache, 'auto_reload' => false, 'debug' => false]; - - // force compilation - $twig = new Environment($loader = new ArrayLoader(['index' => '{{ foo }}']), $options); - - $key = $cache->generateKey('index', $twig->getTemplateClass('index')); - $cache->write($key, $twig->compileSource(new Source('{{ foo }}', 'index'))); - - // check that extensions won't be initialized when rendering a template that is already in the cache - $twig = $this - ->getMockBuilder('\Twig\Environment') - ->setConstructorArgs([$loader, $options]) - ->setMethods(['initExtensions']) - ->getMock() - ; - - $twig->expects($this->never())->method('initExtensions'); - - // render template - $output = $twig->render('index', ['foo' => 'bar']); - $this->assertEquals('bar', $output); - - FilesystemHelper::removeDir($dir); - } - - public function testAutoReloadCacheMiss() - { - $templateName = __FUNCTION__; - $templateContent = __FUNCTION__; - - $cache = $this->createMock('\Twig\Cache\CacheInterface'); - $loader = $this->getMockLoader($templateName, $templateContent); - $twig = new Environment($loader, ['cache' => $cache, 'auto_reload' => true, 'debug' => false]); - - // Cache miss: getTimestamp returns 0 and as a result the load() is - // skipped. - $cache->expects($this->once()) - ->method('generateKey') - ->willReturn('key'); - $cache->expects($this->once()) - ->method('getTimestamp') - ->willReturn(0); - $loader->expects($this->never()) - ->method('isFresh'); - $cache->expects($this->once()) - ->method('write'); - $cache->expects($this->once()) - ->method('load'); - - $twig->load($templateName); - } - - public function testAutoReloadCacheHit() - { - $templateName = __FUNCTION__; - $templateContent = __FUNCTION__; - - $cache = $this->createMock('\Twig\Cache\CacheInterface'); - $loader = $this->getMockLoader($templateName, $templateContent); - $twig = new Environment($loader, ['cache' => $cache, 'auto_reload' => true, 'debug' => false]); - - $now = time(); - - // Cache hit: getTimestamp returns something > extension timestamps and - // the loader returns true for isFresh(). - $cache->expects($this->once()) - ->method('generateKey') - ->willReturn('key'); - $cache->expects($this->once()) - ->method('getTimestamp') - ->willReturn($now); - $loader->expects($this->once()) - ->method('isFresh') - ->willReturn(true); - $cache->expects($this->atLeastOnce()) - ->method('load'); - - $twig->load($templateName); - } - - public function testAutoReloadOutdatedCacheHit() - { - $templateName = __FUNCTION__; - $templateContent = __FUNCTION__; - - $cache = $this->createMock('\Twig\Cache\CacheInterface'); - $loader = $this->getMockLoader($templateName, $templateContent); - $twig = new Environment($loader, ['cache' => $cache, 'auto_reload' => true, 'debug' => false]); - - $now = time(); - - $cache->expects($this->once()) - ->method('generateKey') - ->willReturn('key'); - $cache->expects($this->once()) - ->method('getTimestamp') - ->willReturn($now); - $loader->expects($this->once()) - ->method('isFresh') - ->willReturn(false); - $cache->expects($this->once()) - ->method('write'); - $cache->expects($this->once()) - ->method('load'); - - $twig->load($templateName); - } - - /** - * @group legacy - */ - public function testHasGetExtensionWithDynamicName() - { - $twig = new Environment($this->createMock('\Twig\Loader\LoaderInterface')); - - $ext1 = new EnvironmentTest_Extension_DynamicWithDeprecatedName('ext1'); - $ext2 = new EnvironmentTest_Extension_DynamicWithDeprecatedName('ext2'); - $twig->addExtension($ext1); - $twig->addExtension($ext2); - - $this->assertTrue($twig->hasExtension('ext1')); - $this->assertTrue($twig->hasExtension('ext2')); - - $this->assertTrue($twig->hasExtension('Twig\Tests\EnvironmentTest_Extension_DynamicWithDeprecatedName')); - - $this->assertSame($ext1, $twig->getExtension('ext1')); - $this->assertSame($ext2, $twig->getExtension('ext2')); - } - - public function testHasGetExtensionByClassName() - { - $twig = new Environment($this->createMock('\Twig\Loader\LoaderInterface')); - $twig->addExtension($ext = new EnvironmentTest_Extension()); - $this->assertTrue($twig->hasExtension('Twig\Tests\EnvironmentTest_Extension')); - $this->assertTrue($twig->hasExtension('\Twig\Tests\EnvironmentTest_Extension')); - - $this->assertSame($ext, $twig->getExtension('Twig\Tests\EnvironmentTest_Extension')); - $this->assertSame($ext, $twig->getExtension('\Twig\Tests\EnvironmentTest_Extension')); - - $this->assertTrue($twig->hasExtension('Twig\Tests\EnvironmentTest\Extension')); - $this->assertSame($ext, $twig->getExtension('Twig\Tests\EnvironmentTest\Extension')); - } - - public function testAddExtension() - { - $twig = new Environment($this->createMock('\Twig\Loader\LoaderInterface')); - $twig->addExtension(new EnvironmentTest_Extension()); - - $this->assertArrayHasKey('test', $twig->getTags()); - $this->assertArrayHasKey('foo_filter', $twig->getFilters()); - $this->assertArrayHasKey('foo_function', $twig->getFunctions()); - $this->assertArrayHasKey('foo_test', $twig->getTests()); - $this->assertArrayHasKey('foo_unary', $twig->getUnaryOperators()); - $this->assertArrayHasKey('foo_binary', $twig->getBinaryOperators()); - $this->assertArrayHasKey('foo_global', $twig->getGlobals()); - $visitors = $twig->getNodeVisitors(); - $found = false; - foreach ($visitors as $visitor) { - if ($visitor instanceof EnvironmentTest_NodeVisitor) { - $found = true; - } - } - $this->assertTrue($found); - } - - /** - * @requires PHP 5.3 - */ - public function testAddExtensionWithDeprecatedGetGlobals() - { - $twig = new Environment($this->createMock('\Twig\Loader\LoaderInterface')); - $twig->addExtension(new EnvironmentTest_Extension_WithGlobals()); - - $this->deprecations = []; - set_error_handler([$this, 'handleError']); - - $this->assertArrayHasKey('foo_global', $twig->getGlobals()); - - $this->assertCount(1, $this->deprecations); - $this->assertStringContainsString('Defining the getGlobals() method in the "Twig\Tests\EnvironmentTest_Extension_WithGlobals" extension ', $this->deprecations[0]); - - restore_error_handler(); - } - - /** - * @group legacy - */ - public function testRemoveExtension() - { - $twig = new Environment($this->createMock('\Twig\Loader\LoaderInterface')); - $twig->addExtension(new EnvironmentTest_Extension_WithDeprecatedName()); - $twig->removeExtension('environment_test'); - - $this->assertArrayNotHasKey('test', $twig->getTags()); - $this->assertArrayNotHasKey('foo_filter', $twig->getFilters()); - $this->assertArrayNotHasKey('foo_function', $twig->getFunctions()); - $this->assertArrayNotHasKey('foo_test', $twig->getTests()); - $this->assertArrayNotHasKey('foo_unary', $twig->getUnaryOperators()); - $this->assertArrayNotHasKey('foo_binary', $twig->getBinaryOperators()); - $this->assertArrayNotHasKey('foo_global', $twig->getGlobals()); - $this->assertCount(2, $twig->getNodeVisitors()); - } - - public function testAddMockExtension() - { - // should be replaced by the following in 2.0 (this current code is just to avoid a dep notice) - // $extension = $this->createMock('\Twig\Extension\AbstractExtension'); - $extension = eval(<< 'hey']); - - $twig = new Environment($loader); - $twig->addExtension($extension); - - $this->assertInstanceOf('\Twig\Extension\ExtensionInterface', $twig->getExtension(\get_class($extension))); - $this->assertTrue($twig->isTemplateFresh('page', time())); - } - - public function testInitRuntimeWithAnExtensionUsingInitRuntimeNoDeprecation() - { - $twig = new Environment($this->createMock('\Twig\Loader\LoaderInterface')); - $twig->addExtension(new EnvironmentTest_ExtensionWithoutDeprecationInitRuntime()); - $twig->initRuntime(); - - // add a dummy assertion here to satisfy PHPUnit, the only thing we want to test is that the code above - // can be executed without throwing any deprecations - $this->addToAssertionCount(1); - } - - /** - * @requires PHP 5.3 - */ - public function testInitRuntimeWithAnExtensionUsingInitRuntimeDeprecation() - { - $twig = new Environment($this->createMock('\Twig\Loader\LoaderInterface')); - $twig->addExtension(new EnvironmentTest_ExtensionWithDeprecationInitRuntime()); - - $this->deprecations = []; - set_error_handler([$this, 'handleError']); - - $twig->initRuntime(); - - $this->assertCount(1, $this->deprecations); - $this->assertStringContainsString('Defining the initRuntime() method in the "Twig\Tests\EnvironmentTest_ExtensionWithDeprecationInitRuntime" extension is deprecated since version 1.23.', $this->deprecations[0]); - - restore_error_handler(); - } - - public function handleError($type, $msg) - { - if (E_USER_DEPRECATED === $type) { - $this->deprecations[] = $msg; - } - } - - /** - * @requires PHP 5.3 - */ - public function testOverrideExtension() - { - $twig = new Environment($this->createMock('\Twig\Loader\LoaderInterface')); - $twig->addExtension(new EnvironmentTest_ExtensionWithDeprecationInitRuntime()); - - $this->deprecations = []; - set_error_handler([$this, 'handleError']); - - $twig->addExtension(new EnvironmentTest_Extension_WithDeprecatedName()); - $twig->addExtension(new EnvironmentTest_Extension_WithDeprecatedName()); - - $this->assertCount(1, $this->deprecations); - $this->assertStringContainsString('The possibility to register the same extension twice', $this->deprecations[0]); - - restore_error_handler(); - } - - public function testAddRuntimeLoader() - { - $runtimeLoader = $this->createMock('\Twig\RuntimeLoader\RuntimeLoaderInterface'); - $runtimeLoader->expects($this->any())->method('load')->willReturn(new EnvironmentTest_Runtime()); - - $loader = new ArrayLoader([ - 'func_array' => '{{ from_runtime_array("foo") }}', - 'func_array_default' => '{{ from_runtime_array() }}', - 'func_array_named_args' => '{{ from_runtime_array(name="foo") }}', - 'func_string' => '{{ from_runtime_string("foo") }}', - 'func_string_default' => '{{ from_runtime_string() }}', - 'func_string_named_args' => '{{ from_runtime_string(name="foo") }}', - ]); - - $twig = new Environment($loader); - $twig->addExtension(new EnvironmentTest_ExtensionWithoutRuntime()); - $twig->addRuntimeLoader($runtimeLoader); - - $this->assertEquals('foo', $twig->render('func_array')); - $this->assertEquals('bar', $twig->render('func_array_default')); - $this->assertEquals('foo', $twig->render('func_array_named_args')); - $this->assertEquals('foo', $twig->render('func_string')); - $this->assertEquals('bar', $twig->render('func_string_default')); - $this->assertEquals('foo', $twig->render('func_string_named_args')); - } - - protected function getMockLoader($templateName, $templateContent) - { - // to be removed in 2.0 - $loader = $this->createMock('Twig\Tests\EnvironmentTestLoaderInterface'); - //$loader = $this->createMock(['\Twig\Loader\LoaderInterface', '\Twig\Loader\SourceContextLoaderInterface']); - $loader->expects($this->any()) - ->method('getSourceContext') - ->with($templateName) - ->willReturn(new Source($templateContent, $templateName)); - $loader->expects($this->any()) - ->method('getCacheKey') - ->with($templateName) - ->willReturn($templateName); - - return $loader; - } -} - -class EnvironmentTest_Extension_WithGlobals extends AbstractExtension -{ - public function getGlobals() - { - return [ - 'foo_global' => 'foo_global', - ]; - } -} - -class EnvironmentTest_Extension extends AbstractExtension implements GlobalsInterface -{ - public function getTokenParsers() - { - return [ - new EnvironmentTest_TokenParser(), - ]; - } - - public function getNodeVisitors() - { - return [ - new EnvironmentTest_NodeVisitor(), - ]; - } - - public function getFilters() - { - return [ - new TwigFilter('foo_filter', 'foo_filter'), - ]; - } - - public function getTests() - { - return [ - new TwigTest('foo_test', 'foo_test'), - ]; - } - - public function getFunctions() - { - return [ - new TwigFunction('foo_function', 'foo_function'), - ]; - } - - public function getOperators() - { - return [ - ['foo_unary' => []], - ['foo_binary' => []], - ]; - } - - public function getGlobals() - { - return [ - 'foo_global' => 'foo_global', - ]; - } -} -class_alias('\Twig\Tests\EnvironmentTest_Extension', 'Twig\Tests\EnvironmentTest\Extension', false); - -class EnvironmentTest_Extension_WithDeprecatedName extends AbstractExtension -{ - public function getName() - { - return 'environment_test'; - } -} - -class EnvironmentTest_Extension_DynamicWithDeprecatedName extends AbstractExtension -{ - private $name; - - public function __construct($name) - { - $this->name = $name; - } - - public function getName() - { - return $this->name; - } -} - -class EnvironmentTest_TokenParser extends AbstractTokenParser -{ - public function parse(Token $token) - { - } - - public function getTag() - { - return 'test'; - } -} - -class EnvironmentTest_NodeVisitor implements NodeVisitorInterface -{ - public function enterNode(\Twig_NodeInterface $node, Environment $env) - { - return $node; - } - - public function leaveNode(\Twig_NodeInterface $node, Environment $env) - { - return $node; - } - - public function getPriority() - { - return 0; - } -} - -class EnvironmentTest_ExtensionWithDeprecationInitRuntime extends AbstractExtension -{ - public function initRuntime(Environment $env) - { - } -} - -class EnvironmentTest_ExtensionWithoutDeprecationInitRuntime extends AbstractExtension implements InitRuntimeInterface -{ - public function initRuntime(Environment $env) - { - } -} - -class EnvironmentTest_ExtensionWithoutRuntime extends AbstractExtension -{ - public function getFunctions() - { - return [ - new TwigFunction('from_runtime_array', ['Twig\Tests\EnvironmentTest_Runtime', 'fromRuntime']), - new TwigFunction('from_runtime_string', 'Twig\Tests\EnvironmentTest_Runtime::fromRuntime'), - ]; - } - - public function getName() - { - return 'from_runtime'; - } -} - -class EnvironmentTest_Runtime -{ - public function fromRuntime($name = 'bar') - { - return $name; - } -} - -// to be removed in 2.0 -interface EnvironmentTestLoaderInterface extends LoaderInterface, SourceContextLoaderInterface -{ -} diff --git a/vendor/twig/twig/tests/ErrorTest.php b/vendor/twig/twig/tests/ErrorTest.php deleted file mode 100644 index a84da2e..0000000 --- a/vendor/twig/twig/tests/ErrorTest.php +++ /dev/null @@ -1,234 +0,0 @@ -setSourceContext(new Source('', new \SplFileInfo(__FILE__))); - - $this->assertStringContainsString('tests'.\DIRECTORY_SEPARATOR.'ErrorTest.php', $error->getMessage()); - } - - public function testErrorWithArrayFilename() - { - $error = new Error('foo'); - $error->setSourceContext(new Source('', ['foo' => 'bar'])); - - $this->assertEquals('foo in {"foo":"bar"}', $error->getMessage()); - } - - public function testTwigExceptionGuessWithMissingVarAndArrayLoader() - { - $loader = new ArrayLoader([ - 'base.html' => '{% block content %}{% endblock %}', - 'index.html' => << true, 'debug' => true, 'cache' => false]); - - $template = $twig->load('index.html'); - try { - $template->render([]); - - $this->fail(); - } catch (RuntimeError $e) { - $this->assertEquals('Variable "foo" does not exist in "index.html" at line 3.', $e->getMessage()); - $this->assertEquals(3, $e->getTemplateLine()); - $this->assertEquals('index.html', $e->getSourceContext()->getName()); - } - } - - public function testTwigExceptionGuessWithExceptionAndArrayLoader() - { - $loader = new ArrayLoader([ - 'base.html' => '{% block content %}{% endblock %}', - 'index.html' => << true, 'debug' => true, 'cache' => false]); - - $template = $twig->load('index.html'); - try { - $template->render(['foo' => new ErrorTest_Foo()]); - - $this->fail(); - } catch (RuntimeError $e) { - $this->assertEquals('An exception has been thrown during the rendering of a template ("Runtime error...") in "index.html" at line 3.', $e->getMessage()); - $this->assertEquals(3, $e->getTemplateLine()); - $this->assertEquals('index.html', $e->getSourceContext()->getName()); - } - } - - public function testTwigExceptionGuessWithMissingVarAndFilesystemLoader() - { - $loader = new FilesystemLoader(__DIR__.'/Fixtures/errors'); - $twig = new Environment($loader, ['strict_variables' => true, 'debug' => true, 'cache' => false]); - - $template = $twig->load('index.html'); - try { - $template->render([]); - - $this->fail(); - } catch (RuntimeError $e) { - $this->assertEquals('Variable "foo" does not exist.', $e->getMessage()); - $this->assertEquals(3, $e->getTemplateLine()); - $this->assertEquals('index.html', $e->getSourceContext()->getName()); - $this->assertEquals(3, $e->getLine()); - $this->assertEquals(strtr(__DIR__.'/Fixtures/errors/index.html', '/', \DIRECTORY_SEPARATOR), $e->getFile()); - } - } - - public function testTwigExceptionGuessWithExceptionAndFilesystemLoader() - { - $loader = new FilesystemLoader(__DIR__.'/Fixtures/errors'); - $twig = new Environment($loader, ['strict_variables' => true, 'debug' => true, 'cache' => false]); - - $template = $twig->load('index.html'); - try { - $template->render(['foo' => new ErrorTest_Foo()]); - - $this->fail(); - } catch (RuntimeError $e) { - $this->assertEquals('An exception has been thrown during the rendering of a template ("Runtime error...").', $e->getMessage()); - $this->assertEquals(3, $e->getTemplateLine()); - $this->assertEquals('index.html', $e->getSourceContext()->getName()); - $this->assertEquals(3, $e->getLine()); - $this->assertEquals(strtr(__DIR__.'/Fixtures/errors/index.html', '/', \DIRECTORY_SEPARATOR), $e->getFile()); - } - } - - /** - * @dataProvider getErroredTemplates - */ - public function testTwigExceptionAddsFileAndLine($templates, $name, $line) - { - $loader = new ArrayLoader($templates); - $twig = new Environment($loader, ['strict_variables' => true, 'debug' => true, 'cache' => false]); - - $template = $twig->load('index'); - - try { - $template->render([]); - - $this->fail(); - } catch (RuntimeError $e) { - $this->assertEquals(sprintf('Variable "foo" does not exist in "%s" at line %d.', $name, $line), $e->getMessage()); - $this->assertEquals($line, $e->getTemplateLine()); - $this->assertEquals($name, $e->getSourceContext()->getName()); - } - - try { - $template->render(['foo' => new ErrorTest_Foo()]); - - $this->fail(); - } catch (RuntimeError $e) { - $this->assertEquals(sprintf('An exception has been thrown during the rendering of a template ("Runtime error...") in "%s" at line %d.', $name, $line), $e->getMessage()); - $this->assertEquals($line, $e->getTemplateLine()); - $this->assertEquals($name, $e->getSourceContext()->getName()); - } - } - - public function getErroredTemplates() - { - return [ - // error occurs in a template - [ - [ - 'index' => "\n\n{{ foo.bar }}\n\n\n{{ 'foo' }}", - ], - 'index', 3, - ], - - // error occurs in an included template - [ - [ - 'index' => "{% include 'partial' %}", - 'partial' => '{{ foo.bar }}', - ], - 'partial', 1, - ], - - // error occurs in a parent block when called via parent() - [ - [ - 'index' => "{% extends 'base' %} - {% block content %} - {{ parent() }} - {% endblock %}", - 'base' => '{% block content %}{{ foo.bar }}{% endblock %}', - ], - 'base', 1, - ], - - // error occurs in a block from the child - [ - [ - 'index' => "{% extends 'base' %} - {% block content %} - {{ foo.bar }} - {% endblock %} - {% block foo %} - {{ foo.bar }} - {% endblock %}", - 'base' => '{% block content %}{% endblock %}', - ], - 'index', 3, - ], - ]; - } - - public function testTwigLeakOutputInDebugMode() - { - $output = exec(sprintf('%s %s debug', \PHP_BINARY, escapeshellarg(__DIR__.'/Fixtures/errors/leak-output.php'))); - - $this->assertSame('Hello OOPS', $output); - } - - public function testDoesNotTwigLeakOutput() - { - $output = exec(sprintf('%s %s', \PHP_BINARY, escapeshellarg(__DIR__.'/Fixtures/errors/leak-output.php'))); - - $this->assertSame('', $output); - } -} - -class ErrorTest_Foo -{ - public function bar() - { - throw new \Exception('Runtime error...'); - } -} diff --git a/vendor/twig/twig/tests/ExpressionParserTest.php b/vendor/twig/twig/tests/ExpressionParserTest.php deleted file mode 100644 index ef31fd7..0000000 --- a/vendor/twig/twig/tests/ExpressionParserTest.php +++ /dev/null @@ -1,382 +0,0 @@ -expectException('\Twig\Error\SyntaxError'); - - $env = new Environment($this->createMock('\Twig\Loader\LoaderInterface'), ['cache' => false, 'autoescape' => false]); - $parser = new Parser($env); - - $parser->parse($env->tokenize(new Source($template, 'index'))); - } - - public function getFailingTestsForAssignment() - { - return [ - ['{% set false = "foo" %}'], - ['{% set FALSE = "foo" %}'], - ['{% set true = "foo" %}'], - ['{% set TRUE = "foo" %}'], - ['{% set none = "foo" %}'], - ['{% set NONE = "foo" %}'], - ['{% set null = "foo" %}'], - ['{% set NULL = "foo" %}'], - ['{% set 3 = "foo" %}'], - ['{% set 1 + 2 = "foo" %}'], - ['{% set "bar" = "foo" %}'], - ['{% set %}{% endset %}'], - ]; - } - - /** - * @dataProvider getTestsForArray - */ - public function testArrayExpression($template, $expected) - { - $env = new Environment($this->createMock('\Twig\Loader\LoaderInterface'), ['cache' => false, 'autoescape' => false]); - $stream = $env->tokenize($source = new Source($template, '')); - $parser = new Parser($env); - $expected->setSourceContext($source); - - $this->assertEquals($expected, $parser->parse($stream)->getNode('body')->getNode(0)->getNode('expr')); - } - - /** - * @dataProvider getFailingTestsForArray - */ - public function testArraySyntaxError($template) - { - $this->expectException('\Twig\Error\SyntaxError'); - - $env = new Environment($this->createMock('\Twig\Loader\LoaderInterface'), ['cache' => false, 'autoescape' => false]); - $parser = new Parser($env); - - $parser->parse($env->tokenize(new Source($template, 'index'))); - } - - public function getFailingTestsForArray() - { - return [ - ['{{ [1, "a": "b"] }}'], - ['{{ {"a": "b", 2} }}'], - ]; - } - - public function getTestsForArray() - { - return [ - // simple array - ['{{ [1, 2] }}', new ArrayExpression([ - new ConstantExpression(0, 1), - new ConstantExpression(1, 1), - - new ConstantExpression(1, 1), - new ConstantExpression(2, 1), - ], 1), - ], - - // array with trailing , - ['{{ [1, 2, ] }}', new ArrayExpression([ - new ConstantExpression(0, 1), - new ConstantExpression(1, 1), - - new ConstantExpression(1, 1), - new ConstantExpression(2, 1), - ], 1), - ], - - // simple hash - ['{{ {"a": "b", "b": "c"} }}', new ArrayExpression([ - new ConstantExpression('a', 1), - new ConstantExpression('b', 1), - - new ConstantExpression('b', 1), - new ConstantExpression('c', 1), - ], 1), - ], - - // hash with trailing , - ['{{ {"a": "b", "b": "c", } }}', new ArrayExpression([ - new ConstantExpression('a', 1), - new ConstantExpression('b', 1), - - new ConstantExpression('b', 1), - new ConstantExpression('c', 1), - ], 1), - ], - - // hash in an array - ['{{ [1, {"a": "b", "b": "c"}] }}', new ArrayExpression([ - new ConstantExpression(0, 1), - new ConstantExpression(1, 1), - - new ConstantExpression(1, 1), - new ArrayExpression([ - new ConstantExpression('a', 1), - new ConstantExpression('b', 1), - - new ConstantExpression('b', 1), - new ConstantExpression('c', 1), - ], 1), - ], 1), - ], - - // array in a hash - ['{{ {"a": [1, 2], "b": "c"} }}', new ArrayExpression([ - new ConstantExpression('a', 1), - new ArrayExpression([ - new ConstantExpression(0, 1), - new ConstantExpression(1, 1), - - new ConstantExpression(1, 1), - new ConstantExpression(2, 1), - ], 1), - new ConstantExpression('b', 1), - new ConstantExpression('c', 1), - ], 1), - ], - ]; - } - - public function testStringExpressionDoesNotConcatenateTwoConsecutiveStrings() - { - $this->expectException('\Twig\Error\SyntaxError'); - - $env = new Environment($this->createMock('\Twig\Loader\LoaderInterface'), ['cache' => false, 'autoescape' => false, 'optimizations' => 0]); - $stream = $env->tokenize(new Source('{{ "a" "b" }}', 'index')); - $parser = new Parser($env); - - $parser->parse($stream); - } - - /** - * @dataProvider getTestsForString - */ - public function testStringExpression($template, $expected) - { - $env = new Environment($this->createMock('\Twig\Loader\LoaderInterface'), ['cache' => false, 'autoescape' => false, 'optimizations' => 0]); - $stream = $env->tokenize($source = new Source($template, '')); - $parser = new Parser($env); - $expected->setSourceContext($source); - - $this->assertEquals($expected, $parser->parse($stream)->getNode('body')->getNode(0)->getNode('expr')); - } - - public function getTestsForString() - { - return [ - [ - '{{ "foo" }}', new ConstantExpression('foo', 1), - ], - [ - '{{ "foo #{bar}" }}', new ConcatBinary( - new ConstantExpression('foo ', 1), - new NameExpression('bar', 1), - 1 - ), - ], - [ - '{{ "foo #{bar} baz" }}', new ConcatBinary( - new ConcatBinary( - new ConstantExpression('foo ', 1), - new NameExpression('bar', 1), - 1 - ), - new ConstantExpression(' baz', 1), - 1 - ), - ], - - [ - '{{ "foo #{"foo #{bar} baz"} baz" }}', new ConcatBinary( - new ConcatBinary( - new ConstantExpression('foo ', 1), - new ConcatBinary( - new ConcatBinary( - new ConstantExpression('foo ', 1), - new NameExpression('bar', 1), - 1 - ), - new ConstantExpression(' baz', 1), - 1 - ), - 1 - ), - new ConstantExpression(' baz', 1), - 1 - ), - ], - ]; - } - - public function testAttributeCallDoesNotSupportNamedArguments() - { - $this->expectException('\Twig\Error\SyntaxError'); - - $env = new Environment($this->createMock('\Twig\Loader\LoaderInterface'), ['cache' => false, 'autoescape' => false]); - $parser = new Parser($env); - - $parser->parse($env->tokenize(new Source('{{ foo.bar(name="Foo") }}', 'index'))); - } - - public function testMacroCallDoesNotSupportNamedArguments() - { - $this->expectException('\Twig\Error\SyntaxError'); - - $env = new Environment($this->createMock('\Twig\Loader\LoaderInterface'), ['cache' => false, 'autoescape' => false]); - $parser = new Parser($env); - - $parser->parse($env->tokenize(new Source('{% from _self import foo %}{% macro foo() %}{% endmacro %}{{ foo(name="Foo") }}', 'index'))); - } - - public function testMacroDefinitionDoesNotSupportNonNameVariableName() - { - $this->expectException('\Twig\Error\SyntaxError'); - $this->expectExceptionMessage('An argument must be a name. Unexpected token "string" of value "a" ("name" expected) in "index" at line 1.'); - - $env = new Environment($this->createMock('\Twig\Loader\LoaderInterface'), ['cache' => false, 'autoescape' => false]); - $parser = new Parser($env); - - $parser->parse($env->tokenize(new Source('{% macro foo("a") %}{% endmacro %}', 'index'))); - } - - /** - * @dataProvider getMacroDefinitionDoesNotSupportNonConstantDefaultValues - */ - public function testMacroDefinitionDoesNotSupportNonConstantDefaultValues($template) - { - $this->expectException('\Twig\Error\SyntaxError'); - $this->expectExceptionMessage('A default value for an argument must be a constant (a boolean, a string, a number, or an array) in "index" at line 1'); - - $env = new Environment($this->createMock('\Twig\Loader\LoaderInterface'), ['cache' => false, 'autoescape' => false]); - $parser = new Parser($env); - - $parser->parse($env->tokenize(new Source($template, 'index'))); - } - - public function getMacroDefinitionDoesNotSupportNonConstantDefaultValues() - { - return [ - ['{% macro foo(name = "a #{foo} a") %}{% endmacro %}'], - ['{% macro foo(name = [["b", "a #{foo} a"]]) %}{% endmacro %}'], - ]; - } - - /** - * @dataProvider getMacroDefinitionSupportsConstantDefaultValues - */ - public function testMacroDefinitionSupportsConstantDefaultValues($template) - { - $env = new Environment($this->createMock('\Twig\Loader\LoaderInterface'), ['cache' => false, 'autoescape' => false]); - $parser = new Parser($env); - - $parser->parse($env->tokenize(new Source($template, 'index'))); - - // add a dummy assertion here to satisfy PHPUnit, the only thing we want to test is that the code above - // can be executed without throwing any exceptions - $this->addToAssertionCount(1); - } - - public function getMacroDefinitionSupportsConstantDefaultValues() - { - return [ - ['{% macro foo(name = "aa") %}{% endmacro %}'], - ['{% macro foo(name = 12) %}{% endmacro %}'], - ['{% macro foo(name = true) %}{% endmacro %}'], - ['{% macro foo(name = ["a"]) %}{% endmacro %}'], - ['{% macro foo(name = [["a"]]) %}{% endmacro %}'], - ['{% macro foo(name = {a: "a"}) %}{% endmacro %}'], - ['{% macro foo(name = {a: {b: "a"}}) %}{% endmacro %}'], - ]; - } - - public function testUnknownFunction() - { - $this->expectException('\Twig\Error\SyntaxError'); - $this->expectExceptionMessage('Unknown "cycl" function. Did you mean "cycle" in "index" at line 1?'); - - $env = new Environment($this->createMock('\Twig\Loader\LoaderInterface'), ['cache' => false, 'autoescape' => false]); - $parser = new Parser($env); - - $parser->parse($env->tokenize(new Source('{{ cycl() }}', 'index'))); - } - - public function testUnknownFunctionWithoutSuggestions() - { - $this->expectException('\Twig\Error\SyntaxError'); - $this->expectExceptionMessage('Unknown "foobar" function in "index" at line 1.'); - - $env = new Environment($this->createMock('\Twig\Loader\LoaderInterface'), ['cache' => false, 'autoescape' => false]); - $parser = new Parser($env); - - $parser->parse($env->tokenize(new Source('{{ foobar() }}', 'index'))); - } - - public function testUnknownFilter() - { - $this->expectException('\Twig\Error\SyntaxError'); - $this->expectExceptionMessage('Unknown "lowe" filter. Did you mean "lower" in "index" at line 1?'); - - $env = new Environment($this->createMock('\Twig\Loader\LoaderInterface'), ['cache' => false, 'autoescape' => false]); - $parser = new Parser($env); - - $parser->parse($env->tokenize(new Source('{{ 1|lowe }}', 'index'))); - } - - public function testUnknownFilterWithoutSuggestions() - { - $this->expectException('\Twig\Error\SyntaxError'); - $this->expectExceptionMessage('Unknown "foobar" filter in "index" at line 1.'); - - $env = new Environment($this->createMock('\Twig\Loader\LoaderInterface'), ['cache' => false, 'autoescape' => false]); - $parser = new Parser($env); - - $parser->parse($env->tokenize(new Source('{{ 1|foobar }}', 'index'))); - } - - public function testUnknownTest() - { - $this->expectException('\Twig\Error\SyntaxError'); - $this->expectExceptionMessage('Unknown "nul" test. Did you mean "null" in "index" at line 1'); - - $env = new Environment($this->createMock('\Twig\Loader\LoaderInterface'), ['cache' => false, 'autoescape' => false]); - $parser = new Parser($env); - $stream = $env->tokenize(new Source('{{ 1 is nul }}', 'index')); - $parser->parse($stream); - } - - public function testUnknownTestWithoutSuggestions() - { - $this->expectException('\Twig\Error\SyntaxError'); - $this->expectExceptionMessage('Unknown "foobar" test in "index" at line 1.'); - - $env = new Environment($this->createMock('\Twig\Loader\LoaderInterface'), ['cache' => false, 'autoescape' => false]); - $parser = new Parser($env); - - $parser->parse($env->tokenize(new Source('{{ 1 is foobar }}', 'index'))); - } -} diff --git a/vendor/twig/twig/tests/Extension/CoreTest.php b/vendor/twig/twig/tests/Extension/CoreTest.php deleted file mode 100644 index 66c32ff..0000000 --- a/vendor/twig/twig/tests/Extension/CoreTest.php +++ /dev/null @@ -1,371 +0,0 @@ -createMock('Twig_LoaderInterface')); - for ($i = 0; $i < 100; ++$i) { - $this->assertTrue(\in_array(twig_random($env, $value1, $value2), $expectedInArray, true)); // assertContains() would not consider the type - } - } - - public function getRandomFunctionTestData() - { - return [ - 'array' => [ - ['apple', 'orange', 'citrus'], - ['apple', 'orange', 'citrus'], - ], - 'Traversable' => [ - ['apple', 'orange', 'citrus'], - new \ArrayObject(['apple', 'orange', 'citrus']), - ], - 'unicode string' => [ - ['Ä', '€', 'é'], - 'Ä€é', - ], - 'numeric but string' => [ - ['1', '2', '3'], - '123', - ], - 'integer' => [ - range(0, 5, 1), - 5, - ], - 'float' => [ - range(0, 5, 1), - 5.9, - ], - 'negative' => [ - [0, -1, -2], - -2, - ], - 'min max int' => [ - range(50, 100), - 50, - 100, - ], - 'min max float' => [ - range(-10, 10), - -9.5, - 9.5, - ], - 'min null' => [ - range(0, 100), - null, - 100, - ], - ]; - } - - public function testRandomFunctionWithoutParameter() - { - $max = mt_getrandmax(); - - for ($i = 0; $i < 100; ++$i) { - $val = twig_random(new Environment($this->createMock('\Twig\Loader\LoaderInterface'))); - $this->assertTrue(\is_int($val) && $val >= 0 && $val <= $max); - } - } - - public function testRandomFunctionReturnsAsIs() - { - $this->assertSame('', twig_random(new Environment($this->createMock('\Twig\Loader\LoaderInterface')), '')); - $this->assertSame('', twig_random(new Environment($this->createMock('\Twig\Loader\LoaderInterface'), ['charset' => null]), '')); - - $instance = new \stdClass(); - $this->assertSame($instance, twig_random(new Environment($this->createMock('\Twig\Loader\LoaderInterface')), $instance)); - } - - public function testRandomFunctionOfEmptyArrayThrowsException() - { - $this->expectException('\Twig\Error\RuntimeError'); - - twig_random(new Environment($this->createMock('\Twig\Loader\LoaderInterface')), []); - } - - public function testRandomFunctionOnNonUTF8String() - { - if (!\function_exists('iconv') && !\function_exists('mb_convert_encoding')) { - $this->markTestSkipped('needs iconv or mbstring'); - } - - $twig = new Environment($this->createMock('\Twig\Loader\LoaderInterface')); - $twig->setCharset('ISO-8859-1'); - - $text = twig_convert_encoding('Äé', 'ISO-8859-1', 'UTF-8'); - for ($i = 0; $i < 30; ++$i) { - $rand = twig_random($twig, $text); - $this->assertTrue(\in_array(twig_convert_encoding($rand, 'UTF-8', 'ISO-8859-1'), ['Ä', 'é'], true)); - } - } - - public function testReverseFilterOnNonUTF8String() - { - if (!\function_exists('iconv') && !\function_exists('mb_convert_encoding')) { - $this->markTestSkipped('needs iconv or mbstring'); - } - - $twig = new Environment($this->createMock('\Twig\Loader\LoaderInterface')); - $twig->setCharset('ISO-8859-1'); - - $input = twig_convert_encoding('Äé', 'ISO-8859-1', 'UTF-8'); - $output = twig_convert_encoding(twig_reverse_filter($twig, $input), 'UTF-8', 'ISO-8859-1'); - - $this->assertEquals($output, 'éÄ'); - } - - /** - * @dataProvider provideCustomEscaperCases - */ - public function testCustomEscaper($expected, $string, $strategy) - { - $twig = new Environment($this->createMock('\Twig\Loader\LoaderInterface')); - $twig->getExtension('\Twig\Extension\CoreExtension')->setEscaper('foo', '\Twig\Tests\Extension\foo_escaper_for_test'); - - $this->assertSame($expected, twig_escape_filter($twig, $string, $strategy)); - } - - public function provideCustomEscaperCases() - { - return [ - ['fooUTF-8', 'foo', 'foo'], - ['UTF-8', null, 'foo'], - ['42UTF-8', 42, 'foo'], - ]; - } - - public function testUnknownCustomEscaper() - { - $this->expectException('\Twig\Error\RuntimeError'); - - twig_escape_filter(new Environment($this->createMock('\Twig\Loader\LoaderInterface')), 'foo', 'bar'); - } - - /** - * @dataProvider provideTwigFirstCases - */ - public function testTwigFirst($expected, $input) - { - $twig = new Environment($this->createMock('\Twig\Loader\LoaderInterface')); - $this->assertSame($expected, twig_first($twig, $input)); - } - - public function provideTwigFirstCases() - { - $i = [1 => 'a', 2 => 'b', 3 => 'c']; - - return [ - ['a', 'abc'], - [1, [1, 2, 3]], - ['', null], - ['', ''], - ['a', new CoreTestIterator($i, array_keys($i), true, 3)], - ]; - } - - /** - * @dataProvider provideTwigLastCases - */ - public function testTwigLast($expected, $input) - { - $twig = new Environment($this->createMock('\Twig\Loader\LoaderInterface')); - $this->assertSame($expected, twig_last($twig, $input)); - } - - public function provideTwigLastCases() - { - $i = [1 => 'a', 2 => 'b', 3 => 'c']; - - return [ - ['c', 'abc'], - [3, [1, 2, 3]], - ['', null], - ['', ''], - ['c', new CoreTestIterator($i, array_keys($i), true)], - ]; - } - - /** - * @dataProvider provideArrayKeyCases - */ - public function testArrayKeysFilter(array $expected, $input) - { - $this->assertSame($expected, twig_get_array_keys_filter($input)); - } - - public function provideArrayKeyCases() - { - $array = ['a' => 'a1', 'b' => 'b1', 'c' => 'c1']; - $keys = array_keys($array); - - return [ - [$keys, $array], - [$keys, new CoreTestIterator($array, $keys)], - [$keys, new CoreTestIteratorAggregate($array, $keys)], - [$keys, new CoreTestIteratorAggregateAggregate($array, $keys)], - [[], null], - [['a'], new \SimpleXMLElement('')], - ]; - } - - /** - * @dataProvider provideInFilterCases - */ - public function testInFilter($expected, $value, $compare) - { - $this->assertSame($expected, twig_in_filter($value, $compare)); - } - - public function provideInFilterCases() - { - $array = [1, 2, 'a' => 3, 5, 6, 7]; - $keys = array_keys($array); - - return [ - [true, 1, $array], - [true, '3', $array], - [true, '3', 'abc3def'], - [true, 1, new CoreTestIterator($array, $keys, true, 1)], - [true, '3', new CoreTestIterator($array, $keys, true, 3)], - [true, '3', new CoreTestIteratorAggregateAggregate($array, $keys, true, 3)], - [false, 4, $array], - [false, 4, new CoreTestIterator($array, $keys, true)], - [false, 4, new CoreTestIteratorAggregateAggregate($array, $keys, true)], - [false, 1, 1], - [true, 'b', new \SimpleXMLElement('b')], - ]; - } - - /** - * @dataProvider provideSliceFilterCases - */ - public function testSliceFilter($expected, $input, $start, $length = null, $preserveKeys = false) - { - $twig = new Environment($this->createMock('\Twig\Loader\LoaderInterface')); - $this->assertSame($expected, twig_slice($twig, $input, $start, $length, $preserveKeys)); - } - - public function provideSliceFilterCases() - { - $i = ['a' => 1, 'b' => 2, 'c' => 3, 'd' => 4]; - $keys = array_keys($i); - - return [ - [['a' => 1], $i, 0, 1, true], - [['a' => 1], $i, 0, 1, false], - [['b' => 2, 'c' => 3], $i, 1, 2], - [[1], [1, 2, 3, 4], 0, 1], - [[2, 3], [1, 2, 3, 4], 1, 2], - [[2, 3], new CoreTestIterator($i, $keys, true), 1, 2], - [['c' => 3, 'd' => 4], new CoreTestIteratorAggregate($i, $keys, true), 2, null, true], - [$i, new CoreTestIterator($i, $keys, true), 0, \count($keys) + 10, true], - [[], new CoreTestIterator($i, $keys, true), \count($keys) + 10], - ['de', 'abcdef', 3, 2], - [[], new \SimpleXMLElement('12'), 3], - [[], new \ArrayIterator([1, 2]), 3], - ]; - } -} - -function foo_escaper_for_test(Environment $env, $string, $charset) -{ - return $string.$charset; -} - -final class CoreTestIteratorAggregate implements \IteratorAggregate -{ - private $iterator; - - public function __construct(array $array, array $keys, $allowAccess = false, $maxPosition = false) - { - $this->iterator = new CoreTestIterator($array, $keys, $allowAccess, $maxPosition); - } - - public function getIterator() - { - return $this->iterator; - } -} - -final class CoreTestIteratorAggregateAggregate implements \IteratorAggregate -{ - private $iterator; - - public function __construct(array $array, array $keys, $allowValueAccess = false, $maxPosition = false) - { - $this->iterator = new CoreTestIteratorAggregate($array, $keys, $allowValueAccess, $maxPosition); - } - - public function getIterator() - { - return $this->iterator; - } -} - -final class CoreTestIterator implements \Iterator -{ - private $position; - private $array; - private $arrayKeys; - private $allowValueAccess; - private $maxPosition; - - public function __construct(array $values, array $keys, $allowValueAccess = false, $maxPosition = false) - { - $this->array = $values; - $this->arrayKeys = $keys; - $this->position = 0; - $this->allowValueAccess = $allowValueAccess; - $this->maxPosition = false === $maxPosition ? \count($values) + 1 : $maxPosition; - } - - public function rewind() - { - $this->position = 0; - } - - public function current() - { - if ($this->allowValueAccess) { - return $this->array[$this->key()]; - } - - throw new \LogicException('Code should only use the keys, not the values provided by iterator.'); - } - - public function key() - { - return $this->arrayKeys[$this->position]; - } - - public function next() - { - ++$this->position; - if ($this->position === $this->maxPosition) { - throw new \LogicException(sprintf('Code should not iterate beyond %d.', $this->maxPosition)); - } - } - - public function valid() - { - return isset($this->arrayKeys[$this->position]); - } -} diff --git a/vendor/twig/twig/tests/Extension/SandboxTest.php b/vendor/twig/twig/tests/Extension/SandboxTest.php deleted file mode 100644 index fe0f32f..0000000 --- a/vendor/twig/twig/tests/Extension/SandboxTest.php +++ /dev/null @@ -1,365 +0,0 @@ - 'Fabien', - 'obj' => new FooObject(), - 'arr' => ['obj' => new FooObject()], - ]; - - self::$templates = [ - '1_basic1' => '{{ obj.foo }}', - '1_basic2' => '{{ name|upper }}', - '1_basic3' => '{% if name %}foo{% endif %}', - '1_basic4' => '{{ obj.bar }}', - '1_basic5' => '{{ obj }}', - '1_basic7' => '{{ cycle(["foo","bar"], 1) }}', - '1_basic8' => '{{ obj.getfoobar }}{{ obj.getFooBar }}', - '1_basic9' => '{{ obj.foobar }}{{ obj.fooBar }}', - '1_basic' => '{% if obj.foo %}{{ obj.foo|upper }}{% endif %}', - '1_layout' => '{% block content %}{% endblock %}', - '1_child' => "{% extends \"1_layout\" %}\n{% block content %}\n{{ \"a\"|json_encode }}\n{% endblock %}", - '1_include' => '{{ include("1_basic1", sandboxed=true) }}', - '1_range_operator' => '{{ (1..2)[0] }}', - ]; - } - - public function testSandboxWithInheritance() - { - $this->expectException('\Twig\Sandbox\SecurityError'); - $this->expectExceptionMessage('Filter "json_encode" is not allowed in "1_child" at line 3.'); - - $twig = $this->getEnvironment(true, [], self::$templates, ['block']); - $twig->load('1_child')->render([]); - } - - public function testSandboxGloballySet() - { - $twig = $this->getEnvironment(false, [], self::$templates); - $this->assertEquals('FOO', $twig->load('1_basic')->render(self::$params), 'Sandbox does nothing if it is disabled globally'); - } - - public function testSandboxUnallowedMethodAccessor() - { - $twig = $this->getEnvironment(true, [], self::$templates); - try { - $twig->load('1_basic1')->render(self::$params); - $this->fail('Sandbox throws a SecurityError exception if an unallowed method is called'); - } catch (SecurityError $e) { - $this->assertInstanceOf('\Twig\Sandbox\SecurityNotAllowedMethodError', $e, 'Exception should be an instance of Twig_Sandbox_SecurityNotAllowedMethodError'); - $this->assertEquals('Twig\Tests\Extension\FooObject', $e->getClassName(), 'Exception should be raised on the "Twig\Tests\Extension\FooObject" class'); - $this->assertEquals('foo', $e->getMethodName(), 'Exception should be raised on the "foo" method'); - } - } - - public function testSandboxUnallowedFilter() - { - $twig = $this->getEnvironment(true, [], self::$templates); - try { - $twig->load('1_basic2')->render(self::$params); - $this->fail('Sandbox throws a SecurityError exception if an unallowed filter is called'); - } catch (SecurityError $e) { - $this->assertInstanceOf('\Twig\Sandbox\SecurityNotAllowedFilterError', $e, 'Exception should be an instance of Twig_Sandbox_SecurityNotAllowedFilterError'); - $this->assertEquals('upper', $e->getFilterName(), 'Exception should be raised on the "upper" filter'); - } - } - - public function testSandboxUnallowedTag() - { - $twig = $this->getEnvironment(true, [], self::$templates); - try { - $twig->load('1_basic3')->render(self::$params); - $this->fail('Sandbox throws a SecurityError exception if an unallowed tag is used in the template'); - } catch (SecurityError $e) { - $this->assertInstanceOf('\Twig\Sandbox\SecurityNotAllowedTagError', $e, 'Exception should be an instance of Twig_Sandbox_SecurityNotAllowedTagError'); - $this->assertEquals('if', $e->getTagName(), 'Exception should be raised on the "if" tag'); - } - } - - public function testSandboxUnallowedProperty() - { - $twig = $this->getEnvironment(true, [], self::$templates); - try { - $twig->load('1_basic4')->render(self::$params); - $this->fail('Sandbox throws a SecurityError exception if an unallowed property is called in the template'); - } catch (SecurityError $e) { - $this->assertInstanceOf('\Twig\Sandbox\SecurityNotAllowedPropertyError', $e, 'Exception should be an instance of Twig_Sandbox_SecurityNotAllowedPropertyError'); - $this->assertEquals('Twig\Tests\Extension\FooObject', $e->getClassName(), 'Exception should be raised on the "Twig\Tests\Extension\FooObject" class'); - $this->assertEquals('bar', $e->getPropertyName(), 'Exception should be raised on the "bar" property'); - } - } - - /** - * @dataProvider getSandboxUnallowedToStringTests - */ - public function testSandboxUnallowedToString($template) - { - $twig = $this->getEnvironment(true, [], ['index' => $template], [], ['upper'], ['Twig\Tests\Extension\FooObject' => 'getAnotherFooObject'], [], ['random']); - try { - $twig->load('index')->render(self::$params); - $this->fail('Sandbox throws a SecurityError exception if an unallowed method (__toString()) is called in the template'); - } catch (SecurityError $e) { - $this->assertInstanceOf('\Twig\Sandbox\SecurityNotAllowedMethodError', $e, 'Exception should be an instance of Twig_Sandbox_SecurityNotAllowedMethodError'); - $this->assertEquals('Twig\Tests\Extension\FooObject', $e->getClassName(), 'Exception should be raised on the "Twig\Tests\Extension\FooObject" class'); - $this->assertEquals('__tostring', $e->getMethodName(), 'Exception should be raised on the "__toString" method'); - } - } - - public function getSandboxUnallowedToStringTests() - { - return [ - 'simple' => ['{{ obj }}'], - 'object_from_array' => ['{{ arr.obj }}'], - 'object_chain' => ['{{ obj.anotherFooObject }}'], - 'filter' => ['{{ obj|upper }}'], - 'filter_from_array' => ['{{ arr.obj|upper }}'], - 'function' => ['{{ random(obj) }}'], - 'function_from_array' => ['{{ random(arr.obj) }}'], - 'function_and_filter' => ['{{ random(obj|upper) }}'], - 'function_and_filter_from_array' => ['{{ random(arr.obj|upper) }}'], - 'object_chain_and_filter' => ['{{ obj.anotherFooObject|upper }}'], - 'object_chain_and_function' => ['{{ random(obj.anotherFooObject) }}'], - 'concat' => ['{{ obj ~ "" }}'], - 'concat_again' => ['{{ "" ~ obj }}'], - ]; - } - - /** - * @dataProvider getSandboxAllowedToStringTests - */ - public function testSandboxAllowedToString($template, $output) - { - $twig = $this->getEnvironment(true, [], ['index' => $template], ['set'], [], ['Twig\Tests\Extension\FooObject' => ['foo', 'getAnotherFooObject']]); - $this->assertEquals($output, $twig->load('index')->render(self::$params)); - } - - public function getSandboxAllowedToStringTests() - { - return [ - 'constant_test' => ['{{ obj is constant("PHP_INT_MAX") }}', ''], - 'set_object' => ['{% set a = obj.anotherFooObject %}{{ a.foo }}', 'foo'], - 'is_defined' => ['{{ obj.anotherFooObject is defined }}', '1'], - 'is_null' => ['{{ obj is null }}', ''], - 'is_sameas' => ['{{ obj is same as(obj) }}', '1'], - 'is_sameas_from_array' => ['{{ arr.obj is same as(arr.obj) }}', '1'], - 'is_sameas_from_another_method' => ['{{ obj.anotherFooObject is same as(obj.anotherFooObject) }}', ''], - ]; - } - - public function testSandboxAllowMethodToString() - { - $twig = $this->getEnvironment(true, [], self::$templates, [], [], ['Twig\Tests\Extension\FooObject' => '__toString']); - FooObject::reset(); - $this->assertEquals('foo', $twig->load('1_basic5')->render(self::$params), 'Sandbox allow some methods'); - $this->assertEquals(1, FooObject::$called['__toString'], 'Sandbox only calls method once'); - } - - public function testSandboxAllowMethodToStringDisabled() - { - $twig = $this->getEnvironment(false, [], self::$templates); - FooObject::reset(); - $this->assertEquals('foo', $twig->load('1_basic5')->render(self::$params), 'Sandbox allows __toString when sandbox disabled'); - $this->assertEquals(1, FooObject::$called['__toString'], 'Sandbox only calls method once'); - } - - public function testSandboxUnallowedFunction() - { - $twig = $this->getEnvironment(true, [], self::$templates); - try { - $twig->load('1_basic7')->render(self::$params); - $this->fail('Sandbox throws a SecurityError exception if an unallowed function is called in the template'); - } catch (SecurityError $e) { - $this->assertInstanceOf('\Twig\Sandbox\SecurityNotAllowedFunctionError', $e, 'Exception should be an instance of Twig_Sandbox_SecurityNotAllowedFunctionError'); - $this->assertEquals('cycle', $e->getFunctionName(), 'Exception should be raised on the "cycle" function'); - } - } - - public function testSandboxUnallowedRangeOperator() - { - $twig = $this->getEnvironment(true, [], self::$templates); - try { - $twig->load('1_range_operator')->render(self::$params); - $this->fail('Sandbox throws a SecurityError exception if the unallowed range operator is called'); - } catch (SecurityError $e) { - $this->assertInstanceOf('\Twig\Sandbox\SecurityNotAllowedFunctionError', $e, 'Exception should be an instance of Twig_Sandbox_SecurityNotAllowedFunctionError'); - $this->assertEquals('range', $e->getFunctionName(), 'Exception should be raised on the "range" function'); - } - } - - public function testSandboxAllowMethodFoo() - { - $twig = $this->getEnvironment(true, [], self::$templates, [], [], ['Twig\Tests\Extension\FooObject' => 'foo']); - FooObject::reset(); - $this->assertEquals('foo', $twig->load('1_basic1')->render(self::$params), 'Sandbox allow some methods'); - $this->assertEquals(1, FooObject::$called['foo'], 'Sandbox only calls method once'); - } - - public function testSandboxAllowFilter() - { - $twig = $this->getEnvironment(true, [], self::$templates, [], ['upper']); - $this->assertEquals('FABIEN', $twig->load('1_basic2')->render(self::$params), 'Sandbox allow some filters'); - } - - public function testSandboxAllowTag() - { - $twig = $this->getEnvironment(true, [], self::$templates, ['if']); - $this->assertEquals('foo', $twig->load('1_basic3')->render(self::$params), 'Sandbox allow some tags'); - } - - public function testSandboxAllowProperty() - { - $twig = $this->getEnvironment(true, [], self::$templates, [], [], [], ['Twig\Tests\Extension\FooObject' => 'bar']); - $this->assertEquals('bar', $twig->load('1_basic4')->render(self::$params), 'Sandbox allow some properties'); - } - - public function testSandboxAllowFunction() - { - $twig = $this->getEnvironment(true, [], self::$templates, [], [], [], [], ['cycle']); - $this->assertEquals('bar', $twig->load('1_basic7')->render(self::$params), 'Sandbox allow some functions'); - } - - public function testSandboxAllowRangeOperator() - { - $twig = $this->getEnvironment(true, [], self::$templates, [], [], [], [], ['range']); - $this->assertEquals('1', $twig->load('1_range_operator')->render(self::$params), 'Sandbox allow the range operator'); - } - - public function testSandboxAllowFunctionsCaseInsensitive() - { - foreach (['getfoobar', 'getFoobar', 'getFooBar'] as $name) { - $twig = $this->getEnvironment(true, [], self::$templates, [], [], ['Twig\Tests\Extension\FooObject' => $name]); - FooObject::reset(); - $this->assertEquals('foobarfoobar', $twig->load('1_basic8')->render(self::$params), 'Sandbox allow methods in a case-insensitive way'); - $this->assertEquals(2, FooObject::$called['getFooBar'], 'Sandbox only calls method once'); - - $this->assertEquals('foobarfoobar', $twig->load('1_basic9')->render(self::$params), 'Sandbox allow methods via shortcut names (ie. without get/set)'); - } - } - - public function testSandboxLocallySetForAnInclude() - { - self::$templates = [ - '2_basic' => '{{ obj.foo }}{% include "2_included" %}{{ obj.foo }}', - '2_included' => '{% if obj.foo %}{{ obj.foo|upper }}{% endif %}', - ]; - - $twig = $this->getEnvironment(false, [], self::$templates); - $this->assertEquals('fooFOOfoo', $twig->load('2_basic')->render(self::$params), 'Sandbox does nothing if disabled globally and sandboxed not used for the include'); - - self::$templates = [ - '3_basic' => '{{ obj.foo }}{% sandbox %}{% include "3_included" %}{% endsandbox %}{{ obj.foo }}', - '3_included' => '{% if obj.foo %}{{ obj.foo|upper }}{% endif %}', - ]; - - $twig = $this->getEnvironment(true, [], self::$templates); - try { - $twig->load('3_basic')->render(self::$params); - $this->fail('Sandbox throws a SecurityError exception when the included file is sandboxed'); - } catch (SecurityError $e) { - $this->assertInstanceOf('\Twig\Sandbox\SecurityNotAllowedTagError', $e, 'Exception should be an instance of Twig_Sandbox_SecurityNotAllowedTagError'); - $this->assertEquals('sandbox', $e->getTagName()); - } - } - - public function testMacrosInASandbox() - { - $twig = $this->getEnvironment(true, ['autoescape' => 'html'], ['index' => <<{{ text }}

{% endmacro %} - -{{- macros.test('username') }} -EOF - ], ['macro', 'import'], ['escape']); - - $this->assertEquals('

username

', $twig->load('index')->render([])); - } - - public function testSandboxDisabledAfterIncludeFunctionError() - { - $twig = $this->getEnvironment(false, [], self::$templates); - - $e = null; - try { - $twig->load('1_include')->render(self::$params); - } catch (\Throwable $e) { - } catch (\Exception $e) { - } - if (null === $e) { - $this->fail('An exception should be thrown for this test to be valid.'); - } - - $this->assertFalse($twig->getExtension('\Twig\Extension\SandboxExtension')->isSandboxed(), 'Sandboxed include() function call should not leave Sandbox enabled when an error occurs.'); - } - - protected function getEnvironment($sandboxed, $options, $templates, $tags = [], $filters = [], $methods = [], $properties = [], $functions = []) - { - $loader = new ArrayLoader($templates); - $twig = new Environment($loader, array_merge(['debug' => true, 'cache' => false, 'autoescape' => false], $options)); - $policy = new SecurityPolicy($tags, $filters, $methods, $properties, $functions); - $twig->addExtension(new SandboxExtension($policy, $sandboxed)); - - return $twig; - } -} - -class FooObject -{ - public static $called = ['__toString' => 0, 'foo' => 0, 'getFooBar' => 0]; - - public $bar = 'bar'; - - public static function reset() - { - self::$called = ['__toString' => 0, 'foo' => 0, 'getFooBar' => 0]; - } - - public function __toString() - { - ++self::$called['__toString']; - - return 'foo'; - } - - public function foo() - { - ++self::$called['foo']; - - return 'foo'; - } - - public function getFooBar() - { - ++self::$called['getFooBar']; - - return 'foobar'; - } - - public function getAnotherFooObject() - { - return new self(); - } -} diff --git a/vendor/twig/twig/tests/FactoryRuntimeLoaderTest.php b/vendor/twig/twig/tests/FactoryRuntimeLoaderTest.php deleted file mode 100644 index 32e61d1..0000000 --- a/vendor/twig/twig/tests/FactoryRuntimeLoaderTest.php +++ /dev/null @@ -1,36 +0,0 @@ - '\Twig\Tests\getRuntime']); - - $this->assertInstanceOf('stdClass', $loader->load('stdClass')); - } - - public function testLoadReturnsNullForUnmappedRuntime() - { - $loader = new FactoryRuntimeLoader(); - - $this->assertNull($loader->load('stdClass')); - } -} - -function getRuntime() -{ - return new \stdClass(); -} diff --git a/vendor/twig/twig/tests/FileCachingTest.php b/vendor/twig/twig/tests/FileCachingTest.php deleted file mode 100644 index e1fa3a4..0000000 --- a/vendor/twig/twig/tests/FileCachingTest.php +++ /dev/null @@ -1,66 +0,0 @@ -tmpDir = sys_get_temp_dir().'/TwigTests'; - if (!file_exists($this->tmpDir)) { - @mkdir($this->tmpDir, 0777, true); - } - - if (!is_writable($this->tmpDir)) { - $this->markTestSkipped(sprintf('Unable to run the tests as "%s" is not writable.', $this->tmpDir)); - } - - $this->env = new Environment(new ArrayLoader(['index' => 'index', 'index2' => 'index2']), ['cache' => $this->tmpDir]); - } - - protected function tearDown() - { - FilesystemHelper::removeDir($this->tmpDir); - } - - /** - * @group legacy - */ - public function testWritingCacheFiles() - { - $name = 'index'; - $this->env->load($name); - $cacheFileName = $this->env->getCacheFilename($name); - - $this->assertFileExists($cacheFileName, 'Cache file does not exist.'); - } - - /** - * @group legacy - */ - public function testClearingCacheFiles() - { - $name = 'index2'; - $this->env->load($name); - $cacheFileName = $this->env->getCacheFilename($name); - - $this->assertFileExists($cacheFileName, 'Cache file does not exist.'); - $this->env->clearCacheFiles(); - $this->assertFileNotExists($cacheFileName, 'Cache file was not cleared.'); - } -} diff --git a/vendor/twig/twig/tests/FileExtensionEscapingStrategyTest.php b/vendor/twig/twig/tests/FileExtensionEscapingStrategyTest.php deleted file mode 100644 index 26e1413..0000000 --- a/vendor/twig/twig/tests/FileExtensionEscapingStrategyTest.php +++ /dev/null @@ -1,55 +0,0 @@ -assertSame($strategy, FileExtensionEscapingStrategy::guess($filename)); - } - - public function getGuessData() - { - return [ - // default - ['html', 'foo.html'], - ['html', 'foo.html.twig'], - ['html', 'foo'], - ['html', 'foo.bar.twig'], - ['html', 'foo.txt/foo'], - ['html', 'foo.txt/foo.js/'], - - // css - ['css', 'foo.css'], - ['css', 'foo.css.twig'], - ['css', 'foo.twig.css'], - ['css', 'foo.js.css'], - ['css', 'foo.js.css.twig'], - - // js - ['js', 'foo.js'], - ['js', 'foo.js.twig'], - ['js', 'foo.txt/foo.js'], - ['js', 'foo.txt.twig/foo.js'], - - // txt - [false, 'foo.txt'], - [false, 'foo.txt.twig'], - ]; - } -} diff --git a/vendor/twig/twig/tests/FilesystemHelper.php b/vendor/twig/twig/tests/FilesystemHelper.php deleted file mode 100644 index 76f75af..0000000 --- a/vendor/twig/twig/tests/FilesystemHelper.php +++ /dev/null @@ -1,32 +0,0 @@ - $fileInfo) { - if ($iterator->isDot()) { - continue; - } - - if ($fileInfo->isDir()) { - rmdir($filename); - } else { - unlink($filename); - } - } - rmdir($dir); - } -} diff --git a/vendor/twig/twig/tests/Fixtures/autoescape/block.test b/vendor/twig/twig/tests/Fixtures/autoescape/block.test deleted file mode 100644 index a80b80c..0000000 --- a/vendor/twig/twig/tests/Fixtures/autoescape/block.test +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -blocks and autoescape ---TEMPLATE-- -{{ include('unrelated.txt.twig') -}} -{{ include('template.html.twig') -}} ---TEMPLATE(unrelated.txt.twig)-- -{% block content %}{% endblock %} ---TEMPLATE(template.html.twig)-- -{% extends 'parent.html.twig' %} -{% block content %} -{{ br -}} -{% endblock %} ---TEMPLATE(parent.html.twig)-- -{% set _content = block('content')|raw %} -{{ _content|raw }} ---DATA-- -return ['br' => '
'] ---CONFIG-- -return ['autoescape' => 'name'] ---EXPECT-- -<br /> diff --git a/vendor/twig/twig/tests/Fixtures/autoescape/name.test b/vendor/twig/twig/tests/Fixtures/autoescape/name.test deleted file mode 100644 index 5ad573c..0000000 --- a/vendor/twig/twig/tests/Fixtures/autoescape/name.test +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -"name" autoescape strategy ---TEMPLATE-- -{{ br -}} -{{ include('index.js.twig') -}} -{{ include('index.html.twig') -}} -{{ include('index.txt.twig') -}} ---TEMPLATE(index.js.twig)-- -{{ br -}} ---TEMPLATE(index.html.twig)-- -{{ br -}} ---TEMPLATE(index.txt.twig)-- -{{ br -}} ---DATA-- -return ['br' => '
'] ---CONFIG-- -return ['autoescape' => 'name'] ---EXPECT-- -<br /> -\u003Cbr\u0020\/\u003E -<br /> -
diff --git a/vendor/twig/twig/tests/Fixtures/errors/base.html b/vendor/twig/twig/tests/Fixtures/errors/base.html deleted file mode 100644 index cb0dbe4..0000000 --- a/vendor/twig/twig/tests/Fixtures/errors/base.html +++ /dev/null @@ -1 +0,0 @@ -{% block content %}{% endblock %} diff --git a/vendor/twig/twig/tests/Fixtures/errors/index.html b/vendor/twig/twig/tests/Fixtures/errors/index.html deleted file mode 100644 index df57c82..0000000 --- a/vendor/twig/twig/tests/Fixtures/errors/index.html +++ /dev/null @@ -1,7 +0,0 @@ -{% extends 'base.html' %} -{% block content %} - {{ foo.bar }} -{% endblock %} -{% block foo %} - {{ foo.bar }} -{% endblock %} diff --git a/vendor/twig/twig/tests/Fixtures/errors/leak-output.php b/vendor/twig/twig/tests/Fixtures/errors/leak-output.php deleted file mode 100644 index 985c39a..0000000 --- a/vendor/twig/twig/tests/Fixtures/errors/leak-output.php +++ /dev/null @@ -1,33 +0,0 @@ - 'Hello {{ "world"|broken }}', -]); -$twig = new Environment($loader, ['debug' => isset($argv[1])]); -$twig->addExtension(new BrokenExtension()); - -echo $twig->render('index.html.twig'); diff --git a/vendor/twig/twig/tests/Fixtures/exceptions/child_contents_outside_blocks.test b/vendor/twig/twig/tests/Fixtures/exceptions/child_contents_outside_blocks.test deleted file mode 100644 index 74a1cc2..0000000 --- a/vendor/twig/twig/tests/Fixtures/exceptions/child_contents_outside_blocks.test +++ /dev/null @@ -1,15 +0,0 @@ ---TEST-- -Exception for child templates defining content outside blocks defined by parent ---TEMPLATE-- -{% extends 'base.twig' %} - -Content outside a block. - -{% block sidebar %} - Content inside a block. -{% endblock %} ---TEMPLATE(base.twig)-- -{% block sidebar %} -{% endblock %} ---EXCEPTION-- -Twig\Error\SyntaxError: A template that extends another one cannot include content outside Twig blocks. Did you forget to put the content inside a {% block %} tag in "index.twig" at line 3? diff --git a/vendor/twig/twig/tests/Fixtures/exceptions/exception_in_extension_extends.test b/vendor/twig/twig/tests/Fixtures/exceptions/exception_in_extension_extends.test deleted file mode 100644 index 2ab2980..0000000 --- a/vendor/twig/twig/tests/Fixtures/exceptions/exception_in_extension_extends.test +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -Exception thrown from a child for an extension error ---TEMPLATE-- -{% extends 'base.twig' %} ---TEMPLATE(base.twig)-- - - -{{ random([]) }} ---DATA-- -return [] ---EXCEPTION-- -Twig\Error\RuntimeError: The random function cannot pick from an empty array in "base.twig" at line 4. diff --git a/vendor/twig/twig/tests/Fixtures/exceptions/exception_in_extension_include.test b/vendor/twig/twig/tests/Fixtures/exceptions/exception_in_extension_include.test deleted file mode 100644 index e2281b2..0000000 --- a/vendor/twig/twig/tests/Fixtures/exceptions/exception_in_extension_include.test +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -Exception thrown from an include for an extension error ---TEMPLATE-- -{% include 'content.twig' %} ---TEMPLATE(content.twig)-- - - -{{ random([]) }} ---DATA-- -return [] ---EXCEPTION-- -Twig\Error\RuntimeError: The random function cannot pick from an empty array in "content.twig" at line 4. diff --git a/vendor/twig/twig/tests/Fixtures/exceptions/multiline_array_with_undefined_variable.test b/vendor/twig/twig/tests/Fixtures/exceptions/multiline_array_with_undefined_variable.test deleted file mode 100644 index 6678429..0000000 --- a/vendor/twig/twig/tests/Fixtures/exceptions/multiline_array_with_undefined_variable.test +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -Exception for multiline array with undefined variable ---TEMPLATE-- -{% set foo = { - foo: 'foo', - bar: 'bar', - - - foobar: foobar, - - - - foo2: foo2, -} %} ---DATA-- -return ['foobar' => 'foobar'] ---EXCEPTION-- -Twig\Error\RuntimeError: Variable "foo2" does not exist in "index.twig" at line 11. diff --git a/vendor/twig/twig/tests/Fixtures/exceptions/multiline_array_with_undefined_variable_again.test b/vendor/twig/twig/tests/Fixtures/exceptions/multiline_array_with_undefined_variable_again.test deleted file mode 100644 index 7f5e96b..0000000 --- a/vendor/twig/twig/tests/Fixtures/exceptions/multiline_array_with_undefined_variable_again.test +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -Exception for multiline array with undefined variable ---TEMPLATE-- -{% set foo = { - foo: 'foo', - bar: 'bar', - - - foobar: foobar, - - - - foo2: foo2, -} %} ---DATA-- -return [] ---EXCEPTION-- -Twig\Error\RuntimeError: Variable "foobar" does not exist in "index.twig" at line 7. diff --git a/vendor/twig/twig/tests/Fixtures/exceptions/multiline_function_with_undefined_variable.test b/vendor/twig/twig/tests/Fixtures/exceptions/multiline_function_with_undefined_variable.test deleted file mode 100644 index 8bc524e..0000000 --- a/vendor/twig/twig/tests/Fixtures/exceptions/multiline_function_with_undefined_variable.test +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -Exception for multile function with undefined variable ---TEMPLATE-- -{{ include('foo', - with_context=with_context -) }} ---TEMPLATE(foo)-- -Foo ---DATA-- -return [] ---EXCEPTION-- -Twig\Error\RuntimeError: Variable "with_context" does not exist in "index.twig" at line 3. diff --git a/vendor/twig/twig/tests/Fixtures/exceptions/multiline_function_with_unknown_argument.test b/vendor/twig/twig/tests/Fixtures/exceptions/multiline_function_with_unknown_argument.test deleted file mode 100644 index 5f413d4..0000000 --- a/vendor/twig/twig/tests/Fixtures/exceptions/multiline_function_with_unknown_argument.test +++ /dev/null @@ -1,9 +0,0 @@ ---TEST-- -Exception for multiline function with unknown argument ---TEMPLATE-- -{{ include('foo', - with_context=True, - invalid=False -) }} ---EXCEPTION-- -Twig\Error\SyntaxError: Unknown argument "invalid" for function "include(template, variables, with_context, ignore_missing, sandboxed)" in "index.twig" at line 4. diff --git a/vendor/twig/twig/tests/Fixtures/exceptions/multiline_tag_with_undefined_variable.test b/vendor/twig/twig/tests/Fixtures/exceptions/multiline_tag_with_undefined_variable.test deleted file mode 100644 index 032ad83..0000000 --- a/vendor/twig/twig/tests/Fixtures/exceptions/multiline_tag_with_undefined_variable.test +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -Exception for multiline tag with undefined variable ---TEMPLATE-- -{% include 'foo' - with vars -%} ---TEMPLATE(foo)-- -Foo ---DATA-- -return [] ---EXCEPTION-- -Twig\Error\RuntimeError: Variable "vars" does not exist in "index.twig" at line 3. diff --git a/vendor/twig/twig/tests/Fixtures/exceptions/strict_comparison_operator.test b/vendor/twig/twig/tests/Fixtures/exceptions/strict_comparison_operator.test deleted file mode 100644 index e14beb6..0000000 --- a/vendor/twig/twig/tests/Fixtures/exceptions/strict_comparison_operator.test +++ /dev/null @@ -1,6 +0,0 @@ ---TEST-- -The PHP === strict comparison operator is not supported ---TEMPLATE-- -{{ 1 === 2 }} ---EXCEPTION-- -Twig\Error\SyntaxError: Unexpected operator of value "=". Did you try to use "===" or "!==" for strict comparison? Use "is same as(value)" instead in "index.twig" at line 2. diff --git a/vendor/twig/twig/tests/Fixtures/exceptions/syntax_error_in_reused_template.test b/vendor/twig/twig/tests/Fixtures/exceptions/syntax_error_in_reused_template.test deleted file mode 100644 index 4ce0685..0000000 --- a/vendor/twig/twig/tests/Fixtures/exceptions/syntax_error_in_reused_template.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -Exception for syntax error in reused template ---TEMPLATE-- -{% use 'foo.twig' %} ---TEMPLATE(foo.twig)-- -{% block bar %} - {% do node.data = 5 %} -{% endblock %} ---EXCEPTION-- -Twig\Error\SyntaxError: Unexpected token "operator" of value "=" ("end of statement block" expected) in "foo.twig" at line 3. diff --git a/vendor/twig/twig/tests/Fixtures/exceptions/unclosed_tag.test b/vendor/twig/twig/tests/Fixtures/exceptions/unclosed_tag.test deleted file mode 100644 index b4fc169..0000000 --- a/vendor/twig/twig/tests/Fixtures/exceptions/unclosed_tag.test +++ /dev/null @@ -1,20 +0,0 @@ ---TEST-- -Exception for an unclosed tag ---TEMPLATE-- -{% block foo %} - {% if foo %} - - - - - {% for i in fo %} - - - - {% endfor %} - - - -{% endblock %} ---EXCEPTION-- -Twig\Error\SyntaxError: Unexpected "endblock" tag (expecting closing tag for the "if" tag defined near line 4) in "index.twig" at line 16. diff --git a/vendor/twig/twig/tests/Fixtures/exceptions/undefined_parent.test b/vendor/twig/twig/tests/Fixtures/exceptions/undefined_parent.test deleted file mode 100644 index 07f855a..0000000 --- a/vendor/twig/twig/tests/Fixtures/exceptions/undefined_parent.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -Exception for an undefined parent ---TEMPLATE-- -{% extends 'foo.html' %} - -{% set foo = "foo" %} ---DATA-- -return [] ---EXCEPTION-- -Twig\Error\LoaderError: Template "foo.html" is not defined in "index.twig" at line 2. diff --git a/vendor/twig/twig/tests/Fixtures/exceptions/undefined_template_in_child_template.test b/vendor/twig/twig/tests/Fixtures/exceptions/undefined_template_in_child_template.test deleted file mode 100644 index 904faa5..0000000 --- a/vendor/twig/twig/tests/Fixtures/exceptions/undefined_template_in_child_template.test +++ /dev/null @@ -1,15 +0,0 @@ ---TEST-- -Exception for an undefined template in a child template ---TEMPLATE-- -{% extends 'base.twig' %} - -{% block sidebar %} - {{ include('include.twig') }} -{% endblock %} ---TEMPLATE(base.twig)-- -{% block sidebar %} -{% endblock %} ---DATA-- -return [] ---EXCEPTION-- -Twig\Error\LoaderError: Template "include.twig" is not defined in "index.twig" at line 5. diff --git a/vendor/twig/twig/tests/Fixtures/exceptions/undefined_trait.test b/vendor/twig/twig/tests/Fixtures/exceptions/undefined_trait.test deleted file mode 100644 index 5bfdd07..0000000 --- a/vendor/twig/twig/tests/Fixtures/exceptions/undefined_trait.test +++ /dev/null @@ -1,9 +0,0 @@ ---TEST-- -Exception for an undefined trait ---TEMPLATE-- -{% use 'foo' with foobar as bar %} ---TEMPLATE(foo)-- -{% block bar %} -{% endblock %} ---EXCEPTION-- -Twig\Error\RuntimeError: Block "foobar" is not defined in trait "foo" in "index.twig" at line 2. diff --git a/vendor/twig/twig/tests/Fixtures/expressions/_self.test b/vendor/twig/twig/tests/Fixtures/expressions/_self.test deleted file mode 100644 index fb88f4c..0000000 --- a/vendor/twig/twig/tests/Fixtures/expressions/_self.test +++ /dev/null @@ -1,8 +0,0 @@ ---TEST-- -_self returns the template name ---TEMPLATE-- -{{ _self }} ---DATA-- -return [] ---EXPECT-- -index.twig diff --git a/vendor/twig/twig/tests/Fixtures/expressions/array.test b/vendor/twig/twig/tests/Fixtures/expressions/array.test deleted file mode 100644 index bf60333..0000000 --- a/vendor/twig/twig/tests/Fixtures/expressions/array.test +++ /dev/null @@ -1,61 +0,0 @@ ---TEST-- -Twig supports array notation ---TEMPLATE-- -{# empty array #} -{{ []|join(',') }} - -{{ [1, 2]|join(',') }} -{{ ['foo', "bar"]|join(',') }} -{{ {0: 1, 'foo': 'bar'}|join(',') }} -{{ {0: 1, 'foo': 'bar'}|keys|join(',') }} - -{{ {0: 1, foo: 'bar'}|join(',') }} -{{ {0: 1, foo: 'bar'}|keys|join(',') }} - -{# nested arrays #} -{% set a = [1, 2, [1, 2], {'foo': {'foo': 'bar'}}] %} -{{ a[2]|join(',') }} -{{ a[3]["foo"]|join(',') }} - -{# works even if [] is used inside the array #} -{{ [foo[bar]]|join(',') }} - -{# elements can be any expression #} -{{ ['foo'|upper, bar|upper, bar == foo]|join(',') }} - -{# arrays can have a trailing , like in PHP #} -{{ - [ - 1, - 2, - ]|join(',') -}} - -{# keys can be any expression #} -{% set a = 1 %} -{% set b = "foo" %} -{% set ary = { (a): 'a', (b): 'b', 'c': 'c', (a ~ b): 'd' } %} -{{ ary|keys|join(',') }} -{{ ary|join(',') }} ---DATA-- -return ['bar' => 'bar', 'foo' => ['bar' => 'bar']] ---EXPECT-- -1,2 -foo,bar -1,bar -0,foo - -1,bar -0,foo - -1,2 -bar - -bar - -FOO,BAR, - -1,2 - -1,foo,c,1foo -a,b,c,d diff --git a/vendor/twig/twig/tests/Fixtures/expressions/array_call.test b/vendor/twig/twig/tests/Fixtures/expressions/array_call.test deleted file mode 100644 index 8c7a2ee..0000000 --- a/vendor/twig/twig/tests/Fixtures/expressions/array_call.test +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -Twig supports method calls ---TEMPLATE-- -{{ items.foo }} -{{ items['foo'] }} -{{ items[foo] }} -{{ items[items[foo]] }} ---DATA-- -return ['foo' => 'bar', 'items' => ['foo' => 'bar', 'bar' => 'foo']] ---EXPECT-- -bar -bar -foo -bar diff --git a/vendor/twig/twig/tests/Fixtures/expressions/binary.test b/vendor/twig/twig/tests/Fixtures/expressions/binary.test deleted file mode 100644 index b4e8be5..0000000 --- a/vendor/twig/twig/tests/Fixtures/expressions/binary.test +++ /dev/null @@ -1,46 +0,0 @@ ---TEST-- -Twig supports binary operations (+, -, *, /, ~, %, and, or) ---TEMPLATE-- -{{ 1 + 1 }} -{{ 2 - 1 }} -{{ 2 * 2 }} -{{ 2 / 2 }} -{{ 3 % 2 }} -{{ 1 and 1 }} -{{ 1 and 0 }} -{{ 0 and 1 }} -{{ 0 and 0 }} -{{ 1 or 1 }} -{{ 1 or 0 }} -{{ 0 or 1 }} -{{ 0 or 0 }} -{{ 0 or 1 and 0 }} -{{ 1 or 0 and 1 }} -{{ "foo" ~ "bar" }} -{{ foo ~ "bar" }} -{{ "foo" ~ bar }} -{{ foo ~ bar }} -{{ 20 // 7 }} ---DATA-- -return ['foo' => 'bar', 'bar' => 'foo'] ---EXPECT-- -2 -1 -4 -1 -1 -1 - - - -1 -1 -1 - - -1 -foobar -barbar -foofoo -barfoo -2 diff --git a/vendor/twig/twig/tests/Fixtures/expressions/bitwise.test b/vendor/twig/twig/tests/Fixtures/expressions/bitwise.test deleted file mode 100644 index c2bda1c..0000000 --- a/vendor/twig/twig/tests/Fixtures/expressions/bitwise.test +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -Twig supports bitwise operations ---TEMPLATE-- -{{ 1 b-and 5 }} -{{ 1 b-or 5 }} -{{ 1 b-xor 5 }} -{{ (1 and 0 b-or 0) is same as(1 and (0 b-or 0)) ? 'ok' : 'ko' }} ---DATA-- -return [] ---EXPECT-- -1 -5 -4 -ok diff --git a/vendor/twig/twig/tests/Fixtures/expressions/call_argument_defined_twice.test b/vendor/twig/twig/tests/Fixtures/expressions/call_argument_defined_twice.test deleted file mode 100644 index 36539a6..0000000 --- a/vendor/twig/twig/tests/Fixtures/expressions/call_argument_defined_twice.test +++ /dev/null @@ -1,8 +0,0 @@ ---TEST-- -Argument is defined twice in a call ---TEMPLATE-- -{{ date(987654, date = 123456) }} ---DATA-- -return [] ---EXCEPTION-- -Twig\Error\SyntaxError: Argument "date" is defined twice for function "date" in "index.twig" at line 2. diff --git a/vendor/twig/twig/tests/Fixtures/expressions/call_positional_arg_after_named_arg.test b/vendor/twig/twig/tests/Fixtures/expressions/call_positional_arg_after_named_arg.test deleted file mode 100644 index 729c674..0000000 --- a/vendor/twig/twig/tests/Fixtures/expressions/call_positional_arg_after_named_arg.test +++ /dev/null @@ -1,8 +0,0 @@ ---TEST-- -Positional arguments after named arguments in a call ---TEMPLATE-- -{{ date(date = 123456, 'Y-m-d') }} ---DATA-- -return [] ---EXCEPTION-- -Twig\Error\SyntaxError: Positional arguments cannot be used after named arguments for function "date" in "index.twig" at line 2. diff --git a/vendor/twig/twig/tests/Fixtures/expressions/comparison.test b/vendor/twig/twig/tests/Fixtures/expressions/comparison.test deleted file mode 100644 index 2811634..0000000 --- a/vendor/twig/twig/tests/Fixtures/expressions/comparison.test +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -Twig supports comparison operators (==, !=, <, >, >=, <=) ---TEMPLATE-- -{{ 1 > 2 }}/{{ 1 > 1 }}/{{ 1 >= 2 }}/{{ 1 >= 1 }} -{{ 1 < 2 }}/{{ 1 < 1 }}/{{ 1 <= 2 }}/{{ 1 <= 1 }} -{{ 1 == 1 }}/{{ 1 == 2 }} -{{ 1 != 1 }}/{{ 1 != 2 }} ---DATA-- -return [] ---EXPECT-- -///1 -1//1/1 -1/ -/1 diff --git a/vendor/twig/twig/tests/Fixtures/expressions/divisibleby.test b/vendor/twig/twig/tests/Fixtures/expressions/divisibleby.test deleted file mode 100644 index f1bf568..0000000 --- a/vendor/twig/twig/tests/Fixtures/expressions/divisibleby.test +++ /dev/null @@ -1,17 +0,0 @@ ---TEST-- -Twig supports the "divisible by" operator ---TEMPLATE-- -{{ 8 is divisible by(2) ? 'OK' }} -{{ 8 is not divisible by(3) ? 'OK' }} -{{ 8 is divisible by (2) ? 'OK' }} -{{ 8 is not - divisible - by - (3) ? 'OK' }} ---DATA-- -return [] ---EXPECT-- -OK -OK -OK -OK diff --git a/vendor/twig/twig/tests/Fixtures/expressions/dotdot.test b/vendor/twig/twig/tests/Fixtures/expressions/dotdot.test deleted file mode 100644 index 0efa930..0000000 --- a/vendor/twig/twig/tests/Fixtures/expressions/dotdot.test +++ /dev/null @@ -1,20 +0,0 @@ ---TEST-- -Twig supports the .. operator ---TEMPLATE-- -{% for i in 0..10 %}{{ i }} {% endfor %} - -{% for letter in 'a'..'z' %}{{ letter }} {% endfor %} - -{% for letter in 'a'|upper..'z'|upper %}{{ letter }} {% endfor %} - -{% for i in foo[0]..foo[1] %}{{ i }} {% endfor %} - -{% for i in 0 + 1 .. 10 - 1 %}{{ i }} {% endfor %} ---DATA-- -return ['foo' => [1, 10]] ---EXPECT-- -0 1 2 3 4 5 6 7 8 9 10 -a b c d e f g h i j k l m n o p q r s t u v w x y z -A B C D E F G H I J K L M N O P Q R S T U V W X Y Z -1 2 3 4 5 6 7 8 9 10 -1 2 3 4 5 6 7 8 9 diff --git a/vendor/twig/twig/tests/Fixtures/expressions/ends_with.test b/vendor/twig/twig/tests/Fixtures/expressions/ends_with.test deleted file mode 100644 index c8086d6..0000000 --- a/vendor/twig/twig/tests/Fixtures/expressions/ends_with.test +++ /dev/null @@ -1,26 +0,0 @@ ---TEST-- -Twig supports the "ends with" operator ---TEMPLATE-- -{{ 'foo' ends with 'o' ? 'OK' : 'KO' }} -{{ not ('foo' ends with 'f') ? 'OK' : 'KO' }} -{{ not ('foo' ends with 'foowaytoolong') ? 'OK' : 'KO' }} -{{ 'foo' ends with '' ? 'OK' : 'KO' }} -{{ '1' ends with true ? 'OK' : 'KO' }} -{{ 1 ends with true ? 'OK' : 'KO' }} -{{ 0 ends with false ? 'OK' : 'KO' }} -{{ '' ends with false ? 'OK' : 'KO' }} -{{ false ends with false ? 'OK' : 'KO' }} -{{ false ends with '' ? 'OK' : 'KO' }} ---DATA-- -return [] ---EXPECT-- -OK -OK -OK -OK -KO -KO -KO -KO -KO -KO diff --git a/vendor/twig/twig/tests/Fixtures/expressions/floats.test b/vendor/twig/twig/tests/Fixtures/expressions/floats.test deleted file mode 100644 index cdf871c..0000000 --- a/vendor/twig/twig/tests/Fixtures/expressions/floats.test +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -Twig compiles floats properly ---CONDITION-- -version_compare(phpversion(), '7.0.0', '>=') ---TEMPLATE-- -{% set val2 = 0.0 %} - -{{ val is same as (0.0) ? 'Yes' : 'No' }} -{{ val2 is same as (0.0) ? 'Yes' : 'No' }} -{{ val is same as (val2) ? 'Yes' : 'No' }} ---DATA-- -return ['val' => 0.0] ---EXPECT-- -Yes -Yes -Yes diff --git a/vendor/twig/twig/tests/Fixtures/expressions/grouping.test b/vendor/twig/twig/tests/Fixtures/expressions/grouping.test deleted file mode 100644 index 069ebf7..0000000 --- a/vendor/twig/twig/tests/Fixtures/expressions/grouping.test +++ /dev/null @@ -1,8 +0,0 @@ ---TEST-- -Twig supports grouping of expressions ---TEMPLATE-- -{{ (2 + 2) / 2 }} ---DATA-- -return [] ---EXPECT-- -2 diff --git a/vendor/twig/twig/tests/Fixtures/expressions/literals.test b/vendor/twig/twig/tests/Fixtures/expressions/literals.test deleted file mode 100644 index 308e8df..0000000 --- a/vendor/twig/twig/tests/Fixtures/expressions/literals.test +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -Twig supports literals ---TEMPLATE-- -1 {{ true }} -2 {{ TRUE }} -3 {{ false }} -4 {{ FALSE }} -5 {{ none }} -6 {{ NONE }} -7 {{ null }} -8 {{ NULL }} ---DATA-- -return [] ---EXPECT-- -1 1 -2 1 -3 -4 -5 -6 -7 -8 diff --git a/vendor/twig/twig/tests/Fixtures/expressions/magic_call.test b/vendor/twig/twig/tests/Fixtures/expressions/magic_call.test deleted file mode 100644 index 60417e0..0000000 --- a/vendor/twig/twig/tests/Fixtures/expressions/magic_call.test +++ /dev/null @@ -1,27 +0,0 @@ ---TEST-- -Twig supports __call() for attributes ---TEMPLATE-- -{{ foo.foo }} -{{ foo.bar }} ---DATA-- -class TestClassForMagicCallAttributes -{ - public function getBar() - { - return 'bar_from_getbar'; - } - - public function __call($method, $arguments) - { - if ('foo' === $method) { - return 'foo_from_call'; - } - - return false; - } -} - -return ['foo' => new TestClassForMagicCallAttributes()] ---EXPECT-- -foo_from_call -bar_from_getbar diff --git a/vendor/twig/twig/tests/Fixtures/expressions/matches.test b/vendor/twig/twig/tests/Fixtures/expressions/matches.test deleted file mode 100644 index 95459c3..0000000 --- a/vendor/twig/twig/tests/Fixtures/expressions/matches.test +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -Twig supports the "matches" operator ---TEMPLATE-- -{{ 'foo' matches '/o/' ? 'OK' : 'KO' }} -{{ 'foo' matches '/^fo/' ? 'OK' : 'KO' }} -{{ 'foo' matches '/O/i' ? 'OK' : 'KO' }} ---DATA-- -return [] ---EXPECT-- -OK -OK -OK diff --git a/vendor/twig/twig/tests/Fixtures/expressions/method_call.test b/vendor/twig/twig/tests/Fixtures/expressions/method_call.test deleted file mode 100644 index bf49f38..0000000 --- a/vendor/twig/twig/tests/Fixtures/expressions/method_call.test +++ /dev/null @@ -1,28 +0,0 @@ ---TEST-- -Twig supports method calls ---TEMPLATE-- -{{ items.foo.foo }} -{{ items.foo.getFoo() }} -{{ items.foo.bar }} -{{ items.foo['bar'] }} -{{ items.foo.bar('a', 43) }} -{{ items.foo.bar(foo) }} -{{ items.foo.self.foo() }} -{{ items.foo.is }} -{{ items.foo.in }} -{{ items.foo.not }} ---DATA-- -return ['foo' => 'bar', 'items' => ['foo' => new Twig\Tests\TwigTestFoo(), 'bar' => 'foo']] ---CONFIG-- -return ['strict_variables' => false] ---EXPECT-- -foo -foo -bar - -bar_a-43 -bar_bar -foo -is -in -not diff --git a/vendor/twig/twig/tests/Fixtures/expressions/negative_numbers.test b/vendor/twig/twig/tests/Fixtures/expressions/negative_numbers.test deleted file mode 100644 index c2a6e34..0000000 --- a/vendor/twig/twig/tests/Fixtures/expressions/negative_numbers.test +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -Twig manages negative numbers correctly ---TEMPLATE-- -{{ -1 }} -{{ - 1 }} -{{ 5 - 1 }} -{{ 5-1 }} -{{ 5 + -1 }} -{{ 5 + - 1 }} ---DATA-- -return [] ---EXPECT-- --1 --1 -4 -4 -4 -4 diff --git a/vendor/twig/twig/tests/Fixtures/expressions/not_arrow_fn.test b/vendor/twig/twig/tests/Fixtures/expressions/not_arrow_fn.test deleted file mode 100644 index af82c47..0000000 --- a/vendor/twig/twig/tests/Fixtures/expressions/not_arrow_fn.test +++ /dev/null @@ -1,8 +0,0 @@ ---TEST-- -A string in parentheses cannot be confused with an arrow function ---TEMPLATE-- -{{ ["foo", "bar"]|join(("f")) }} ---DATA-- -return [] ---EXPECT-- -foofbar diff --git a/vendor/twig/twig/tests/Fixtures/expressions/operators_as_variables.test b/vendor/twig/twig/tests/Fixtures/expressions/operators_as_variables.test deleted file mode 100644 index fa9a843..0000000 --- a/vendor/twig/twig/tests/Fixtures/expressions/operators_as_variables.test +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -Twig allows to use named operators as variable names ---TEMPLATE-- -{% for match in matches %} - {{- match }} -{% endfor %} -{{ in }} -{{ is }} ---DATA-- -return ['matches' => [1, 2, 3], 'in' => 'in', 'is' => 'is'] ---EXPECT-- -1 -2 -3 -in -is diff --git a/vendor/twig/twig/tests/Fixtures/expressions/postfix.test b/vendor/twig/twig/tests/Fixtures/expressions/postfix.test deleted file mode 100644 index 276cbf1..0000000 --- a/vendor/twig/twig/tests/Fixtures/expressions/postfix.test +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -Twig parses postfix expressions ---TEMPLATE-- -{% import _self as macros %} - -{% macro foo() %}foo{% endmacro %} - -{{ 'a' }} -{{ 'a'|upper }} -{{ ('a')|upper }} -{{ -1|upper }} -{{ macros.foo() }} -{{ (macros).foo() }} ---DATA-- -return [] ---EXPECT-- -a -A -A --1 -foo -foo diff --git a/vendor/twig/twig/tests/Fixtures/expressions/power.test b/vendor/twig/twig/tests/Fixtures/expressions/power.test deleted file mode 100644 index 84fd236..0000000 --- a/vendor/twig/twig/tests/Fixtures/expressions/power.test +++ /dev/null @@ -1,20 +0,0 @@ ---TEST-- -Twig parses power expressions ---TEMPLATE-- -{{ 2**3 }} -{{ (-2)**3 }} -{{ (-2)**(-3) }} -{{ a ** a }} -{{ a ** b }} -{{ b ** a }} -{{ b ** b }} ---DATA-- -return ['a' => 4, 'b' => -2] ---EXPECT-- -8 --8 --0.125 -256 -0.0625 -16 -0.25 diff --git a/vendor/twig/twig/tests/Fixtures/expressions/sameas.test b/vendor/twig/twig/tests/Fixtures/expressions/sameas.test deleted file mode 100644 index 83f3691..0000000 --- a/vendor/twig/twig/tests/Fixtures/expressions/sameas.test +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -Twig supports the "same as" operator ---TEMPLATE-- -{{ 1 is same as(1) ? 'OK' }} -{{ 1 is not same as(true) ? 'OK' }} -{{ 1 is same as(1) ? 'OK' }} -{{ 1 is not same as(true) ? 'OK' }} -{{ 1 is same as (1) ? 'OK' }} -{{ 1 is not - same - as - (true) ? 'OK' }} ---DATA-- -return [] ---EXPECT-- -OK -OK -OK -OK -OK -OK diff --git a/vendor/twig/twig/tests/Fixtures/expressions/starts_with.test b/vendor/twig/twig/tests/Fixtures/expressions/starts_with.test deleted file mode 100644 index a78ff1e..0000000 --- a/vendor/twig/twig/tests/Fixtures/expressions/starts_with.test +++ /dev/null @@ -1,27 +0,0 @@ ---TEST-- -Twig supports the "starts with" operator ---TEMPLATE-- -{{ 'foo' starts with 'f' ? 'OK' : 'KO' }} -{{ not ('foo' starts with 'oo') ? 'OK' : 'KO' }} -{{ not ('foo' starts with 'foowaytoolong') ? 'OK' : 'KO' }} -{{ 'foo' starts with 'f' ? 'OK' : 'KO' }} -{{ 'foo' starts -with 'f' ? 'OK' : 'KO' }} -{{ 'foo' starts with '' ? 'OK' : 'KO' }} -{{ '1' starts with true ? 'OK' : 'KO' }} -{{ '' starts with false ? 'OK' : 'KO' }} -{{ 'a' starts with false ? 'OK' : 'KO' }} -{{ false starts with '' ? 'OK' : 'KO' }} ---DATA-- -return [] ---EXPECT-- -OK -OK -OK -OK -OK -OK -KO -KO -KO -KO diff --git a/vendor/twig/twig/tests/Fixtures/expressions/string_operator_as_var_assignment.test b/vendor/twig/twig/tests/Fixtures/expressions/string_operator_as_var_assignment.test deleted file mode 100644 index 478d4eb..0000000 --- a/vendor/twig/twig/tests/Fixtures/expressions/string_operator_as_var_assignment.test +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -Twig supports the string operators as variable names in assignments ---TEMPLATE-- -{% for matches in [1, 2] %} - {{- matches }} -{% endfor %} - -{% set matches = [1, 2] %} - -OK ---DATA-- -return [] ---EXPECT-- -1 -2 - - -OK diff --git a/vendor/twig/twig/tests/Fixtures/expressions/strings.test b/vendor/twig/twig/tests/Fixtures/expressions/strings.test deleted file mode 100644 index f402c89..0000000 --- a/vendor/twig/twig/tests/Fixtures/expressions/strings.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -Twig supports string interpolation ---TEMPLATE-- -{{ "foo #{"foo #{bar} baz"} baz" }} -{{ "foo #{bar}#{bar} baz" }} ---DATA-- -return ['bar' => 'BAR'] ---EXPECT-- -foo foo BAR baz baz -foo BARBAR baz diff --git a/vendor/twig/twig/tests/Fixtures/expressions/ternary_operator.test b/vendor/twig/twig/tests/Fixtures/expressions/ternary_operator.test deleted file mode 100644 index 37eccc0..0000000 --- a/vendor/twig/twig/tests/Fixtures/expressions/ternary_operator.test +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -Twig supports the ternary operator ---TEMPLATE-- -{{ 1 ? 'YES' : 'NO' }} -{{ 0 ? 'YES' : 'NO' }} -{{ 0 ? 'YES' : (1 ? 'YES1' : 'NO1') }} -{{ 0 ? 'YES' : (0 ? 'YES1' : 'NO1') }} -{{ 1 == 1 ? 'foo
':'' }} -{{ foo ~ (bar ? ('-' ~ bar) : '') }} ---DATA-- -return ['foo' => 'foo', 'bar' => 'bar'] ---EXPECT-- -YES -NO -YES1 -NO1 -foo
-foo-bar diff --git a/vendor/twig/twig/tests/Fixtures/expressions/ternary_operator_noelse.test b/vendor/twig/twig/tests/Fixtures/expressions/ternary_operator_noelse.test deleted file mode 100644 index 8b0f728..0000000 --- a/vendor/twig/twig/tests/Fixtures/expressions/ternary_operator_noelse.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -Twig supports the ternary operator ---TEMPLATE-- -{{ 1 ? 'YES' }} -{{ 0 ? 'YES' }} ---DATA-- -return [] ---EXPECT-- -YES - diff --git a/vendor/twig/twig/tests/Fixtures/expressions/ternary_operator_nothen.test b/vendor/twig/twig/tests/Fixtures/expressions/ternary_operator_nothen.test deleted file mode 100644 index ecd6b75..0000000 --- a/vendor/twig/twig/tests/Fixtures/expressions/ternary_operator_nothen.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -Twig supports the ternary operator ---TEMPLATE-- -{{ 'YES' ?: 'NO' }} -{{ 0 ?: 'NO' }} ---DATA-- -return [] ---EXPECT-- -YES -NO diff --git a/vendor/twig/twig/tests/Fixtures/expressions/two_word_operators_as_variables.test b/vendor/twig/twig/tests/Fixtures/expressions/two_word_operators_as_variables.test deleted file mode 100644 index eca3b28..0000000 --- a/vendor/twig/twig/tests/Fixtures/expressions/two_word_operators_as_variables.test +++ /dev/null @@ -1,8 +0,0 @@ ---TEST-- -Twig does not allow to use two-word named operators as variable names ---TEMPLATE-- -{{ starts with }} ---DATA-- -return [] ---EXCEPTION-- -Twig\Error\SyntaxError: Unexpected token "operator" of value "starts with" in "index.twig" at line 2. diff --git a/vendor/twig/twig/tests/Fixtures/expressions/unary.test b/vendor/twig/twig/tests/Fixtures/expressions/unary.test deleted file mode 100644 index 5422531..0000000 --- a/vendor/twig/twig/tests/Fixtures/expressions/unary.test +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -Twig supports unary operators (not, -, +) ---TEMPLATE-- -{{ not 1 }}/{{ not 0 }} -{{ +1 + 1 }}/{{ -1 - 1 }} -{{ not (false or true) }} ---DATA-- -return [] ---EXPECT-- -/1 -2/-2 - diff --git a/vendor/twig/twig/tests/Fixtures/expressions/unary_macro_arguments.test b/vendor/twig/twig/tests/Fixtures/expressions/unary_macro_arguments.test deleted file mode 100644 index 27deba3..0000000 --- a/vendor/twig/twig/tests/Fixtures/expressions/unary_macro_arguments.test +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -Twig manages negative numbers as default parameters ---TEMPLATE-- -{% import _self as macros %} -{{ macros.negative_number1() }} -{{ macros.negative_number2() }} -{{ macros.negative_number3() }} -{{ macros.positive_number1() }} -{{ macros.positive_number2() }} -{% macro negative_number1(nb=-1) %}{{ nb }}{% endmacro %} -{% macro negative_number2(nb = --1) %}{{ nb }}{% endmacro %} -{% macro negative_number3(nb = - 1) %}{{ nb }}{% endmacro %} -{% macro positive_number1(nb = +1) %}{{ nb }}{% endmacro %} -{% macro positive_number2(nb = ++1) %}{{ nb }}{% endmacro %} ---DATA-- -return [] ---EXPECT-- --1 -1 --1 -1 -1 diff --git a/vendor/twig/twig/tests/Fixtures/expressions/unary_precedence.test b/vendor/twig/twig/tests/Fixtures/expressions/unary_precedence.test deleted file mode 100644 index 9c56ab1..0000000 --- a/vendor/twig/twig/tests/Fixtures/expressions/unary_precedence.test +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -Twig unary operators precedence ---TEMPLATE-- -{{ -1 - 1 }} -{{ -1 - -1 }} -{{ -1 * -1 }} -{{ 4 / -1 * 5 }} ---DATA-- -return [] ---EXPECT-- --2 -0 -1 --20 diff --git a/vendor/twig/twig/tests/Fixtures/filters/abs.test b/vendor/twig/twig/tests/Fixtures/filters/abs.test deleted file mode 100644 index 7518769..0000000 --- a/vendor/twig/twig/tests/Fixtures/filters/abs.test +++ /dev/null @@ -1,30 +0,0 @@ ---TEST-- -"abs" filter ---TEMPLATE-- -{{ (-5.5)|abs }} -{{ (-5)|abs }} -{{ (-0)|abs }} -{{ 0|abs }} -{{ 5|abs }} -{{ 5.5|abs }} -{{ number1|abs }} -{{ number2|abs }} -{{ number3|abs }} -{{ number4|abs }} -{{ number5|abs }} -{{ number6|abs }} ---DATA-- -return ['number1' => -5.5, 'number2' => -5, 'number3' => -0, 'number4' => 0, 'number5' => 5, 'number6' => 5.5] ---EXPECT-- -5.5 -5 -0 -0 -5 -5.5 -5.5 -5 -0 -0 -5 -5.5 diff --git a/vendor/twig/twig/tests/Fixtures/filters/batch.test b/vendor/twig/twig/tests/Fixtures/filters/batch.test deleted file mode 100644 index 0acf25b..0000000 --- a/vendor/twig/twig/tests/Fixtures/filters/batch.test +++ /dev/null @@ -1,31 +0,0 @@ ---TEST-- -"batch" filter ---TEMPLATE-- -{% for row in items|batch(3) %} -
- {% for column in row %} -
{{ column }}
- {% endfor %} -
-{% endfor %} ---DATA-- -return ['items' => ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j']] ---EXPECT-- -
-
a
-
b
-
c
-
-
-
d
-
e
-
f
-
-
-
g
-
h
-
i
-
-
-
j
-
diff --git a/vendor/twig/twig/tests/Fixtures/filters/batch_float.test b/vendor/twig/twig/tests/Fixtures/filters/batch_float.test deleted file mode 100644 index dad004e..0000000 --- a/vendor/twig/twig/tests/Fixtures/filters/batch_float.test +++ /dev/null @@ -1,29 +0,0 @@ ---TEST-- -"batch" filter ---TEMPLATE-- -{% for row in items|batch(3.1) %} -
- {% for column in row %} -
{{ column }}
- {% endfor %} -
-{% endfor %} ---DATA-- -return ['items' => ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j']] ---EXPECT-- -
-
a
-
b
-
c
-
d
-
-
-
e
-
f
-
g
-
h
-
-
-
i
-
j
-
diff --git a/vendor/twig/twig/tests/Fixtures/filters/batch_with_empty_fill.test b/vendor/twig/twig/tests/Fixtures/filters/batch_with_empty_fill.test deleted file mode 100644 index 411b4fc..0000000 --- a/vendor/twig/twig/tests/Fixtures/filters/batch_with_empty_fill.test +++ /dev/null @@ -1,37 +0,0 @@ ---TEST-- -"batch" filter ---TEMPLATE-- - -{% for row in items|batch(3, '') %} - - {% for column in row %} - - {% endfor %} - -{% endfor %} -
{{ column }}
---DATA-- -return ['items' => ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j']] ---EXPECT-- - - - - - - - - - - - - - - - - - - - - - -
abc
def
ghi
j
diff --git a/vendor/twig/twig/tests/Fixtures/filters/batch_with_exact_elements.test b/vendor/twig/twig/tests/Fixtures/filters/batch_with_exact_elements.test deleted file mode 100644 index 750d155..0000000 --- a/vendor/twig/twig/tests/Fixtures/filters/batch_with_exact_elements.test +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -"batch" filter ---TEMPLATE-- -{% for row in items|batch(3, 'fill') %} -
- {% for column in row %} -
{{ column }}
- {% endfor %} -
-{% endfor %} ---DATA-- -return ['items' => ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l']] ---EXPECT-- -
-
a
-
b
-
c
-
-
-
d
-
e
-
f
-
-
-
g
-
h
-
i
-
-
-
j
-
k
-
l
-
diff --git a/vendor/twig/twig/tests/Fixtures/filters/batch_with_fill.test b/vendor/twig/twig/tests/Fixtures/filters/batch_with_fill.test deleted file mode 100644 index 5d470d0..0000000 --- a/vendor/twig/twig/tests/Fixtures/filters/batch_with_fill.test +++ /dev/null @@ -1,37 +0,0 @@ ---TEST-- -"batch" filter ---TEMPLATE-- - -{% for row in items|batch(3, 'fill') %} - - {% for column in row %} - - {% endfor %} - -{% endfor %} -
{{ column }}
---DATA-- -return ['items' => ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j']] ---EXPECT-- - - - - - - - - - - - - - - - - - - - - - -
abc
def
ghi
jfillfill
diff --git a/vendor/twig/twig/tests/Fixtures/filters/batch_with_keys.test b/vendor/twig/twig/tests/Fixtures/filters/batch_with_keys.test deleted file mode 100644 index e56cd79..0000000 --- a/vendor/twig/twig/tests/Fixtures/filters/batch_with_keys.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -"batch" filter preserves array keys ---TEMPLATE-- -{{ {'foo': 'bar', 'key': 'value'}|batch(4)|first|keys|join(',') }} -{{ {'foo': 'bar', 'key': 'value'}|batch(4, 'fill')|first|keys|join(',') }} ---DATA-- -return [] ---EXPECT-- -foo,key -foo,key,0,1 diff --git a/vendor/twig/twig/tests/Fixtures/filters/batch_with_more_elements.test b/vendor/twig/twig/tests/Fixtures/filters/batch_with_more_elements.test deleted file mode 100644 index 90f4de6..0000000 --- a/vendor/twig/twig/tests/Fixtures/filters/batch_with_more_elements.test +++ /dev/null @@ -1,23 +0,0 @@ ---TEST-- -"batch" filter ---TEMPLATE-- -{% for row in items|batch(3, 'fill') %} -
- {% for key, column in row %} -
{{ column }}
- {% endfor %} -
-{% endfor %} ---DATA-- -return ['items' => ['a' => 'a', 'b' => 'b', 'c' => 'c', 'd' => 'd', '123' => 'e']] ---EXPECT-- -
-
a
-
b
-
c
-
-
-
d
-
e
-
fill
-
diff --git a/vendor/twig/twig/tests/Fixtures/filters/batch_with_zero_elements.test b/vendor/twig/twig/tests/Fixtures/filters/batch_with_zero_elements.test deleted file mode 100644 index bc303da..0000000 --- a/vendor/twig/twig/tests/Fixtures/filters/batch_with_zero_elements.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -"batch" filter with zero elements ---TEMPLATE-- -{{ []|batch(3)|length }} -{{ []|batch(3, 'fill')|length }} ---DATA-- -return [] ---EXPECT-- -0 -0 diff --git a/vendor/twig/twig/tests/Fixtures/filters/convert_encoding.test b/vendor/twig/twig/tests/Fixtures/filters/convert_encoding.test deleted file mode 100644 index db8aced..0000000 --- a/vendor/twig/twig/tests/Fixtures/filters/convert_encoding.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -"convert_encoding" filter ---CONDITION-- -function_exists('iconv') || function_exists('mb_convert_encoding') ---TEMPLATE-- -{{ "愛していますか?"|convert_encoding('ISO-2022-JP', 'UTF-8')|convert_encoding('UTF-8', 'ISO-2022-JP') }} ---DATA-- -return [] ---EXPECT-- -愛していますか? diff --git a/vendor/twig/twig/tests/Fixtures/filters/date.test b/vendor/twig/twig/tests/Fixtures/filters/date.test deleted file mode 100644 index 16816aa..0000000 --- a/vendor/twig/twig/tests/Fixtures/filters/date.test +++ /dev/null @@ -1,90 +0,0 @@ ---TEST-- -"date" filter ---TEMPLATE-- -{{ date1|date }} -{{ date1|date('d/m/Y') }} -{{ date1|date('d/m/Y H:i:s', 'Asia/Hong_Kong') }} -{{ date1|date('d/m/Y H:i:s P', 'Asia/Hong_Kong') }} -{{ date1|date('d/m/Y H:i:s P', 'America/Chicago') }} -{{ date1|date('e') }} -{{ date1|date('d/m/Y H:i:s') }} - -{{ date2|date }} -{{ date2|date('d/m/Y') }} -{{ date2|date('d/m/Y H:i:s', 'Asia/Hong_Kong') }} -{{ date2|date('d/m/Y H:i:s', timezone1) }} -{{ date2|date('d/m/Y H:i:s') }} - -{{ date3|date }} -{{ date3|date('d/m/Y') }} - -{{ date4|date }} -{{ date4|date('d/m/Y') }} - -{{ date5|date }} -{{ date5|date('d/m/Y') }} - -{{ date6|date('d/m/Y H:i:s P', 'Europe/Paris') }} -{{ date6|date('d/m/Y H:i:s P', 'Asia/Hong_Kong') }} -{{ date6|date('d/m/Y H:i:s P', false) }} -{{ date6|date('e', 'Europe/Paris') }} -{{ date6|date('e', false) }} - -{{ date7|date }} -{{ date7|date(timezone='Europe/Paris') }} -{{ date7|date(timezone='Asia/Hong_Kong') }} -{{ date7|date(timezone=false) }} -{{ date7|date(timezone='Indian/Mauritius') }} - -{{ '2010-01-28 15:00:00'|date(timezone="Europe/Paris") }} -{{ '2010-01-28 15:00:00'|date(timezone="Asia/Hong_Kong") }} ---DATA-- -date_default_timezone_set('Europe/Paris'); -return [ - 'date1' => mktime(13, 45, 0, 10, 4, 2010), - 'date2' => new \DateTime('2010-10-04 13:45'), - 'date3' => '2010-10-04 13:45', - 'date4' => 1286199900, // \DateTime::createFromFormat('Y-m-d H:i', '2010-10-04 13:45', new \DateTimeZone('UTC'))->getTimestamp() -- A unixtimestamp is always GMT - 'date5' => -189291360, // \DateTime::createFromFormat('Y-m-d H:i', '1964-01-02 03:04', new \DateTimeZone('UTC'))->getTimestamp(), - 'date6' => new \DateTime('2010-10-04 13:45', new \DateTimeZone('America/New_York')), - 'date7' => '2010-01-28T15:00:00+04:00', - 'timezone1' => new \DateTimeZone('America/New_York'), -] ---EXPECT-- -October 4, 2010 13:45 -04/10/2010 -04/10/2010 19:45:00 -04/10/2010 19:45:00 +08:00 -04/10/2010 06:45:00 -05:00 -Europe/Paris -04/10/2010 13:45:00 - -October 4, 2010 13:45 -04/10/2010 -04/10/2010 19:45:00 -04/10/2010 07:45:00 -04/10/2010 13:45:00 - -October 4, 2010 13:45 -04/10/2010 - -October 4, 2010 15:45 -04/10/2010 - -January 2, 1964 04:04 -02/01/1964 - -04/10/2010 19:45:00 +02:00 -05/10/2010 01:45:00 +08:00 -04/10/2010 13:45:00 -04:00 -Europe/Paris -America/New_York - -January 28, 2010 12:00 -January 28, 2010 12:00 -January 28, 2010 19:00 -January 28, 2010 15:00 -January 28, 2010 15:00 - -January 28, 2010 15:00 -January 28, 2010 22:00 diff --git a/vendor/twig/twig/tests/Fixtures/filters/date_default_format.test b/vendor/twig/twig/tests/Fixtures/filters/date_default_format.test deleted file mode 100644 index c6e8130..0000000 --- a/vendor/twig/twig/tests/Fixtures/filters/date_default_format.test +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -"date" filter ---TEMPLATE-- -{{ date1|date }} -{{ date1|date('d/m/Y') }} ---DATA-- -date_default_timezone_set('UTC'); -$twig->getExtension('\Twig\Extension\CoreExtension')->setDateFormat('Y-m-d', '%d days %h hours'); -return [ - 'date1' => mktime(13, 45, 0, 10, 4, 2010), -] ---EXPECT-- -2010-10-04 -04/10/2010 diff --git a/vendor/twig/twig/tests/Fixtures/filters/date_default_format_interval.test b/vendor/twig/twig/tests/Fixtures/filters/date_default_format_interval.test deleted file mode 100644 index a72fb81..0000000 --- a/vendor/twig/twig/tests/Fixtures/filters/date_default_format_interval.test +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -"date" filter (interval support as of PHP 5.3) ---CONDITION-- -version_compare(phpversion(), '5.3.0', '>=') ---TEMPLATE-- -{{ date2|date }} -{{ date2|date('%d days') }} ---DATA-- -date_default_timezone_set('UTC'); -$twig->getExtension('\Twig\Extension\CoreExtension')->setDateFormat('Y-m-d', '%d days %h hours'); -return [ - 'date2' => new \DateInterval('P2D'), -] ---EXPECT-- -2 days 0 hours -2 days diff --git a/vendor/twig/twig/tests/Fixtures/filters/date_immutable.test b/vendor/twig/twig/tests/Fixtures/filters/date_immutable.test deleted file mode 100644 index 2414db5..0000000 --- a/vendor/twig/twig/tests/Fixtures/filters/date_immutable.test +++ /dev/null @@ -1,37 +0,0 @@ ---TEST-- -"date" filter ---CONDITION-- -version_compare(phpversion(), '5.5.0', '>=') ---TEMPLATE-- -{{ date1|date }} -{{ date1|date('d/m/Y') }} -{{ date1|date('d/m/Y H:i:s', 'Asia/Hong_Kong') }} -{{ date1|date('d/m/Y H:i:s', timezone1) }} -{{ date1|date('d/m/Y H:i:s') }} -{{ date1|date_modify('+1 hour')|date('d/m/Y H:i:s') }} - -{{ date2|date('d/m/Y H:i:s P', 'Europe/Paris') }} -{{ date2|date('d/m/Y H:i:s P', 'Asia/Hong_Kong') }} -{{ date2|date('d/m/Y H:i:s P', false) }} -{{ date2|date('e', 'Europe/Paris') }} -{{ date2|date('e', false) }} ---DATA-- -date_default_timezone_set('Europe/Paris'); -return [ - 'date1' => new \DateTimeImmutable('2010-10-04 13:45'), - 'date2' => new \DateTimeImmutable('2010-10-04 13:45', new \DateTimeZone('America/New_York')), - 'timezone1' => new \DateTimeZone('America/New_York'), -] ---EXPECT-- -October 4, 2010 13:45 -04/10/2010 -04/10/2010 19:45:00 -04/10/2010 07:45:00 -04/10/2010 13:45:00 -04/10/2010 14:45:00 - -04/10/2010 19:45:00 +02:00 -05/10/2010 01:45:00 +08:00 -04/10/2010 13:45:00 -04:00 -Europe/Paris -America/New_York diff --git a/vendor/twig/twig/tests/Fixtures/filters/date_interval.test b/vendor/twig/twig/tests/Fixtures/filters/date_interval.test deleted file mode 100644 index c3333f5..0000000 --- a/vendor/twig/twig/tests/Fixtures/filters/date_interval.test +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -"date" filter (interval support as of PHP 5.3) ---CONDITION-- -version_compare(phpversion(), '5.3.0', '>=') ---TEMPLATE-- -{{ date1|date }} -{{ date1|date('%d days %h hours') }} -{{ date1|date('%d days %h hours', timezone1) }} ---DATA-- -date_default_timezone_set('UTC'); -return [ - 'date1' => new \DateInterval('P2D'), - // This should have no effect on \DateInterval formatting - 'timezone1' => new \DateTimeZone('America/New_York'), -] ---EXPECT-- -2 days -2 days 0 hours -2 days 0 hours diff --git a/vendor/twig/twig/tests/Fixtures/filters/date_modify.test b/vendor/twig/twig/tests/Fixtures/filters/date_modify.test deleted file mode 100644 index d7f8fdf..0000000 --- a/vendor/twig/twig/tests/Fixtures/filters/date_modify.test +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -"date_modify" filter ---TEMPLATE-- -{{ date1|date_modify('-1day')|date('Y-m-d H:i:s') }} -{{ date2|date_modify('-1day')|date('Y-m-d H:i:s') }} ---DATA-- -date_default_timezone_set('UTC'); -return [ - 'date1' => '2010-10-04 13:45', - 'date2' => new \DateTime('2010-10-04 13:45'), -] ---EXPECT-- -2010-10-03 13:45:00 -2010-10-03 13:45:00 diff --git a/vendor/twig/twig/tests/Fixtures/filters/date_namedargs.test b/vendor/twig/twig/tests/Fixtures/filters/date_namedargs.test deleted file mode 100644 index 2d1aa13..0000000 --- a/vendor/twig/twig/tests/Fixtures/filters/date_namedargs.test +++ /dev/null @@ -1,13 +0,0 @@ ---TEST-- -"date" filter ---TEMPLATE-- -{{ date|date(format='d/m/Y H:i:s P', timezone='America/Chicago') }} -{{ date|date(timezone='America/Chicago', format='d/m/Y H:i:s P') }} -{{ date|date('d/m/Y H:i:s P', timezone='America/Chicago') }} ---DATA-- -date_default_timezone_set('UTC'); -return ['date' => mktime(13, 45, 0, 10, 4, 2010)] ---EXPECT-- -04/10/2010 08:45:00 -05:00 -04/10/2010 08:45:00 -05:00 -04/10/2010 08:45:00 -05:00 diff --git a/vendor/twig/twig/tests/Fixtures/filters/default.test b/vendor/twig/twig/tests/Fixtures/filters/default.test deleted file mode 100644 index b01a62d..0000000 --- a/vendor/twig/twig/tests/Fixtures/filters/default.test +++ /dev/null @@ -1,150 +0,0 @@ ---TEST-- -"default" filter ---TEMPLATE-- -Variable: -{{ definedVar |default('default') is same as('default') ? 'ko' : 'ok' }} -{{ zeroVar |default('default') is same as('default') ? 'ko' : 'ok' }} -{{ emptyVar |default('default') is same as('default') ? 'ok' : 'ko' }} -{{ nullVar |default('default') is same as('default') ? 'ok' : 'ko' }} -{{ undefinedVar |default('default') is same as('default') ? 'ok' : 'ko' }} -Array access: -{{ nested.definedVar |default('default') is same as('default') ? 'ko' : 'ok' }} -{{ nested['definedVar'] |default('default') is same as('default') ? 'ko' : 'ok' }} -{{ nested.zeroVar |default('default') is same as('default') ? 'ko' : 'ok' }} -{{ nested.emptyVar |default('default') is same as('default') ? 'ok' : 'ko' }} -{{ nested.nullVar |default('default') is same as('default') ? 'ok' : 'ko' }} -{{ nested.undefinedVar |default('default') is same as('default') ? 'ok' : 'ko' }} -{{ nested['undefinedVar'] |default('default') is same as('default') ? 'ok' : 'ko' }} -{{ undefinedVar.foo |default('default') is same as('default') ? 'ok' : 'ko' }} -Plain values: -{{ 'defined' |default('default') is same as('default') ? 'ko' : 'ok' }} -{{ 0 |default('default') is same as('default') ? 'ko' : 'ok' }} -{{ '' |default('default') is same as('default') ? 'ok' : 'ko' }} -{{ null |default('default') is same as('default') ? 'ok' : 'ko' }} -Precedence: -{{ 'o' ~ nullVar |default('k') }} -{{ 'o' ~ nested.nullVar |default('k') }} -Object methods: -{{ object.foo |default('default') is same as('default') ? 'ko' : 'ok' }} -{{ object.undefinedMethod |default('default') is same as('default') ? 'ok' : 'ko' }} -{{ object.getFoo() |default('default') is same as('default') ? 'ko' : 'ok' }} -{{ object.getFoo('a') |default('default') is same as('default') ? 'ko' : 'ok' }} -{{ object.undefinedMethod() |default('default') is same as('default') ? 'ok' : 'ko' }} -{{ object.undefinedMethod('a') |default('default') is same as('default') ? 'ok' : 'ko' }} -Deep nested: -{{ nested.undefinedVar.foo.bar |default('default') is same as('default') ? 'ok' : 'ko' }} -{{ nested.definedArray.0 |default('default') is same as('default') ? 'ko' : 'ok' }} -{{ nested['definedArray'][0] |default('default') is same as('default') ? 'ko' : 'ok' }} -{{ object.self.foo |default('default') is same as('default') ? 'ko' : 'ok' }} -{{ object.self.undefinedMethod |default('default') is same as('default') ? 'ok' : 'ko' }} -{{ object.undefinedMethod.self |default('default') is same as('default') ? 'ok' : 'ko' }} ---DATA-- -return [ - 'definedVar' => 'defined', - 'zeroVar' => 0, - 'emptyVar' => '', - 'nullVar' => null, - 'nested' => [ - 'definedVar' => 'defined', - 'zeroVar' => 0, - 'emptyVar' => '', - 'nullVar' => null, - 'definedArray' => [0], - ], - 'object' => new Twig\Tests\TwigTestFoo(), -] ---CONFIG-- -return ['strict_variables' => false] ---EXPECT-- -Variable: -ok -ok -ok -ok -ok -Array access: -ok -ok -ok -ok -ok -ok -ok -ok -Plain values: -ok -ok -ok -ok -Precedence: -ok -ok -Object methods: -ok -ok -ok -ok -ok -ok -Deep nested: -ok -ok -ok -ok -ok -ok ---DATA-- -return [ - 'definedVar' => 'defined', - 'zeroVar' => 0, - 'emptyVar' => '', - 'nullVar' => null, - 'nested' => [ - 'definedVar' => 'defined', - 'zeroVar' => 0, - 'emptyVar' => '', - 'nullVar' => null, - 'definedArray' => [0], - ], - 'object' => new Twig\Tests\TwigTestFoo(), -] ---CONFIG-- -return ['strict_variables' => true] ---EXPECT-- -Variable: -ok -ok -ok -ok -ok -Array access: -ok -ok -ok -ok -ok -ok -ok -ok -Plain values: -ok -ok -ok -ok -Precedence: -ok -ok -Object methods: -ok -ok -ok -ok -ok -ok -Deep nested: -ok -ok -ok -ok -ok -ok diff --git a/vendor/twig/twig/tests/Fixtures/filters/dynamic_filter.test b/vendor/twig/twig/tests/Fixtures/filters/dynamic_filter.test deleted file mode 100644 index 27dc878..0000000 --- a/vendor/twig/twig/tests/Fixtures/filters/dynamic_filter.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -dynamic filter ---TEMPLATE-- -{{ 'bar'|foo_path }} -{{ 'bar'|a_foo_b_bar }} ---DATA-- -return [] ---EXPECT-- -foo/bar -a/b/bar diff --git a/vendor/twig/twig/tests/Fixtures/filters/escape.test b/vendor/twig/twig/tests/Fixtures/filters/escape.test deleted file mode 100644 index 131f5b4..0000000 --- a/vendor/twig/twig/tests/Fixtures/filters/escape.test +++ /dev/null @@ -1,8 +0,0 @@ ---TEST-- -"escape" filter ---TEMPLATE-- -{{ "foo
"|e }} ---DATA-- -return [] ---EXPECT-- -foo <br /> diff --git a/vendor/twig/twig/tests/Fixtures/filters/escape_html_attr.test b/vendor/twig/twig/tests/Fixtures/filters/escape_html_attr.test deleted file mode 100644 index 10e3275..0000000 --- a/vendor/twig/twig/tests/Fixtures/filters/escape_html_attr.test +++ /dev/null @@ -1,8 +0,0 @@ ---TEST-- -"escape" filter does not escape with the html strategy when using the html_attr strategy ---TEMPLATE-- -{{ '
'|escape('html_attr') }} ---DATA-- -return [] ---EXPECT-- -<br /> diff --git a/vendor/twig/twig/tests/Fixtures/filters/escape_javascript.test b/vendor/twig/twig/tests/Fixtures/filters/escape_javascript.test deleted file mode 100644 index 4c2fb7a..0000000 --- a/vendor/twig/twig/tests/Fixtures/filters/escape_javascript.test +++ /dev/null @@ -1,8 +0,0 @@ ---TEST-- -"escape" filter ---TEMPLATE-- -{{ "é ♜ 𝌆"|e('js') }} ---DATA-- -return [] ---EXPECT-- -\u00E9\u0020\u265C\u0020\uD834\uDF06 diff --git a/vendor/twig/twig/tests/Fixtures/filters/escape_non_supported_charset.test b/vendor/twig/twig/tests/Fixtures/filters/escape_non_supported_charset.test deleted file mode 100644 index 93f3429..0000000 --- a/vendor/twig/twig/tests/Fixtures/filters/escape_non_supported_charset.test +++ /dev/null @@ -1,8 +0,0 @@ ---TEST-- -"escape" filter ---TEMPLATE-- -{{ "愛していますか?
"|e }} ---DATA-- -return [] ---EXPECT-- -愛していますか? <br /> diff --git a/vendor/twig/twig/tests/Fixtures/filters/filter.test b/vendor/twig/twig/tests/Fixtures/filters/filter.test deleted file mode 100644 index fe44d80..0000000 --- a/vendor/twig/twig/tests/Fixtures/filters/filter.test +++ /dev/null @@ -1,46 +0,0 @@ ---TEST-- -"filter" filter ---TEMPLATE-- -{% set offset = 3 %} - -{% for k, v in [1, 5, 3, 4, 5]|filter((v) => v > offset) -%} - {{ k }} = {{ v }} -{% endfor %} - -{% for k, v in {a: 1, b: 2, c: 5, d: 8}|filter(v => v > offset) -%} - {{ k }} = {{ v }} -{% endfor %} - -{% for k, v in [1, 5, 3, 4, 5]|filter(v => v > offset) -%} - {{ k }} = {{ v }} -{% endfor %} - -{% for k, v in it|filter((v) => v > offset) -%} - {{ k }} = {{ v }} -{% endfor %} - -{% for k, v in ita|filter(v => v > offset) -%} - {{ k }} = {{ v }} -{% endfor %} ---DATA-- -return [ - 'it' => new \ArrayIterator(['a' => 1, 'b' => 2, 'c' => 5, 'd' => 8]), - 'ita' => new Twig\Tests\IteratorAggregateStub(['a' => 1, 'b' => 2, 'c' => 5, 'd' => 8]), -] ---EXPECT-- -1 = 5 -3 = 4 -4 = 5 - -c = 5 -d = 8 - -1 = 5 -3 = 4 -4 = 5 - -c = 5 -d = 8 - -c = 5 -d = 8 diff --git a/vendor/twig/twig/tests/Fixtures/filters/filter_php_55.test b/vendor/twig/twig/tests/Fixtures/filters/filter_php_55.test deleted file mode 100644 index 6684139..0000000 --- a/vendor/twig/twig/tests/Fixtures/filters/filter_php_55.test +++ /dev/null @@ -1,23 +0,0 @@ ---TEST-- -"filter" filter (PHP 5.5 required) ---CONDITION-- -version_compare(phpversion(), '5.5.0', '>=') ---TEMPLATE-- -{% for k, v in xml|filter(x => true) %} -{{ k }}/{{ v }} -{% endfor %} - -{# we can iterate more than once #} -{% for k, v in xml|filter(x => true) %} -{{ k }}/{{ v }} -{% endfor %} ---DATA-- -return ['xml' => new \SimpleXMLElement('foobarbaz')] ---EXPECT-- -elem/foo -elem/bar -elem/baz - -elem/foo -elem/bar -elem/baz diff --git a/vendor/twig/twig/tests/Fixtures/filters/filter_php_56.test b/vendor/twig/twig/tests/Fixtures/filters/filter_php_56.test deleted file mode 100644 index 0daf408..0000000 --- a/vendor/twig/twig/tests/Fixtures/filters/filter_php_56.test +++ /dev/null @@ -1,27 +0,0 @@ ---TEST-- -"filter" filter (PHP 5.6 required) ---CONDITION-- -version_compare(phpversion(), '5.6.0', '>=') ---TEMPLATE-- -{% set offset = 3 %} - -{% for k, v in {a: 1, b: 2, c: 5, d: 8}|filter((v, k) => (v > offset) and (k != "d")) -%} - {{ k }} = {{ v }} -{% endfor %} - -{% for k, v in it|filter((v, k) => (v > offset) and (k != "d")) -%} - {{ k }} = {{ v }} -{% endfor %} - -{# we can iterate more than once #} -{% for k, v in it|filter((v, k) => (v > offset) and (k != "d")) -%} - {{ k }} = {{ v }} -{% endfor %} ---DATA-- -return ['it' => new \ArrayIterator(['a' => 1, 'b' => 2, 'c' => 5, 'd' => 8])] ---EXPECT-- -c = 5 - -c = 5 - -c = 5 diff --git a/vendor/twig/twig/tests/Fixtures/filters/first.test b/vendor/twig/twig/tests/Fixtures/filters/first.test deleted file mode 100644 index b19f2ee..0000000 --- a/vendor/twig/twig/tests/Fixtures/filters/first.test +++ /dev/null @@ -1,17 +0,0 @@ ---TEST-- -"first" filter ---TEMPLATE-- -{{ [1, 2, 3, 4]|first }} -{{ {a: 1, b: 2, c: 3, d: 4}|first }} -{{ '1234'|first }} -{{ arr|first }} -{{ 'Ä€é'|first }} -{{ ''|first }} ---DATA-- -return ['arr' => new \ArrayObject([1, 2, 3, 4])] ---EXPECT-- -1 -1 -1 -1 -Ä diff --git a/vendor/twig/twig/tests/Fixtures/filters/force_escape.test b/vendor/twig/twig/tests/Fixtures/filters/force_escape.test deleted file mode 100644 index 7efbe32..0000000 --- a/vendor/twig/twig/tests/Fixtures/filters/force_escape.test +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -"escape" filter ---TEMPLATE-- -{% set foo %} - foo
-{% endset %} - -{{ foo|e('html') -}} -{{ foo|e('js') }} -{% autoescape true %} - {{ foo }} -{% endautoescape %} ---DATA-- -return [] ---EXPECT-- - foo<br /> -\u0020\u0020\u0020\u0020foo\u003Cbr\u0020\/\u003E\n - foo
diff --git a/vendor/twig/twig/tests/Fixtures/filters/format.test b/vendor/twig/twig/tests/Fixtures/filters/format.test deleted file mode 100644 index efaf831..0000000 --- a/vendor/twig/twig/tests/Fixtures/filters/format.test +++ /dev/null @@ -1,8 +0,0 @@ ---TEST-- -"format" filter ---TEMPLATE-- -{{ string|format(foo, 3) }} ---DATA-- -return ['string' => '%s/%d', 'foo' => 'bar'] ---EXPECT-- -bar/3 diff --git a/vendor/twig/twig/tests/Fixtures/filters/join.test b/vendor/twig/twig/tests/Fixtures/filters/join.test deleted file mode 100644 index 3127ea1..0000000 --- a/vendor/twig/twig/tests/Fixtures/filters/join.test +++ /dev/null @@ -1,38 +0,0 @@ ---TEST-- -"join" filter ---TEMPLATE-- -{{ ["foo", "bar"]|join(', ') }} -{{ foo|join(', ') }} -{{ bar|join(', ') }} - -{{ ["foo", "bar"]|join(', ', ' and ') }} -{{ foo|join(', ', ' and ') }} -{{ bar|join(', ', ' and ') }} -{{ ["one", "two", "three"]|join(', ', ' and ') }} -{{ ["a", "b", "c"]|join('','-') }} -{{ ["a", "b", "c"]|join('-','-') }} -{{ ["a", "b", "c"]|join('-','') }} -{{ ["hello"]|join('|','-') }} - -{{ {"a": "w", "b": "x", "c": "y", "d": "z"}|join }} -{{ {"a": "w", "b": "x", "c": "y", "d": "z"}|join(',') }} -{{ {"a": "w", "b": "x", "c": "y", "d": "z"}|join(',','-') }} ---DATA-- -return ['foo' => new Twig\Tests\TwigTestFoo(), 'bar' => new \ArrayObject([3, 4])] ---EXPECT-- -foo, bar -1, 2 -3, 4 - -foo and bar -1 and 2 -3 and 4 -one, two and three -ab-c -a-b-c -a-bc -hello - -wxyz -w,x,y,z -w,x,y-z diff --git a/vendor/twig/twig/tests/Fixtures/filters/json_encode.test b/vendor/twig/twig/tests/Fixtures/filters/json_encode.test deleted file mode 100644 index 902f90b..0000000 --- a/vendor/twig/twig/tests/Fixtures/filters/json_encode.test +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -"json_encode" filter ---TEMPLATE-- -{{ "foo"|json_encode|raw }} -{{ foo|json_encode|raw }} -{{ [foo, "foo"]|json_encode|raw }} ---DATA-- -return ['foo' => new \Twig\Markup('foo', 'UTF-8')] ---EXPECT-- -"foo" -"foo" -["foo","foo"] diff --git a/vendor/twig/twig/tests/Fixtures/filters/last.test b/vendor/twig/twig/tests/Fixtures/filters/last.test deleted file mode 100644 index f71896c..0000000 --- a/vendor/twig/twig/tests/Fixtures/filters/last.test +++ /dev/null @@ -1,17 +0,0 @@ ---TEST-- -"last" filter ---TEMPLATE-- -{{ [1, 2, 3, 4]|last }} -{{ {a: 1, b: 2, c: 3, d: 4}|last }} -{{ '1234'|last }} -{{ arr|last }} -{{ 'Ä€é'|last }} -{{ ''|last }} ---DATA-- -return ['arr' => new \ArrayObject([1, 2, 3, 4])] ---EXPECT-- -4 -4 -4 -4 -é diff --git a/vendor/twig/twig/tests/Fixtures/filters/length.test b/vendor/twig/twig/tests/Fixtures/filters/length.test deleted file mode 100644 index eb3f023..0000000 --- a/vendor/twig/twig/tests/Fixtures/filters/length.test +++ /dev/null @@ -1,40 +0,0 @@ ---TEST-- -"length" filter ---TEMPLATE-- -{{ array|length }} -{{ string|length }} -{{ number|length }} -{{ to_string_able|length }} -{{ countable|length }} -{{ iterator_aggregate|length }} -{{ null|length }} -{{ magic|length }} -{{ non_countable|length }} -{{ simple_xml_element|length }} -{{ iterator|length }} ---DATA-- -return [ - 'array' => [1, 4], - 'string' => 'foo', - 'number' => 1000, - 'to_string_able' => new Twig\Tests\ToStringStub('foobar'), - 'countable' => new Twig\Tests\CountableStub(42), /* also asserts we do *not* call __toString() */ - 'iterator_aggregate' => new Twig\Tests\IteratorAggregateStub(['a', 'b', 'c']), /* also asserts we do *not* call __toString() */ - 'null' => null, - 'magic' => new Twig\Tests\MagicCallStub(), /* used to assert we do *not* call __call */ - 'non_countable' => new \StdClass(), - 'simple_xml_element' => new \SimpleXMLElement(''), - 'iterator' => new Twig\Tests\SimpleIteratorForTesting() -] ---EXPECT-- -2 -3 -4 -6 -42 -3 -0 -1 -1 -2 -7 diff --git a/vendor/twig/twig/tests/Fixtures/filters/length_utf8.test b/vendor/twig/twig/tests/Fixtures/filters/length_utf8.test deleted file mode 100644 index b1e9681..0000000 --- a/vendor/twig/twig/tests/Fixtures/filters/length_utf8.test +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -"length" filter ---CONDITION-- -function_exists('mb_get_info') ---TEMPLATE-- -{{ string|length }} -{{ markup|length }} ---DATA-- -return ['string' => 'été', 'markup' => new \Twig\Markup('foo', 'UTF-8')] ---EXPECT-- -3 -3 diff --git a/vendor/twig/twig/tests/Fixtures/filters/map.test b/vendor/twig/twig/tests/Fixtures/filters/map.test deleted file mode 100644 index 5552f81..0000000 --- a/vendor/twig/twig/tests/Fixtures/filters/map.test +++ /dev/null @@ -1,41 +0,0 @@ ---TEST-- -"map" filter ---TEMPLATE-- -{% set offset = 3 %} - -{% for k, v in [1, 2]|map((item) => item + 2 ) -%} - {{ k }} = {{ v }} -{% endfor %} - -{% for k, v in {a: 1, b: 2}|map((item) => item ~ "*" ) -%} - {{ k }} = {{ v }} -{% endfor %} - -{% for k, v in {a: 1, b: 2}|map((item, k) => item ~ "*" ~ k ) -%} - {{ k }} = {{ v }} -{% endfor %} - -{% for k, v in [1, 2]|map(item => item + 2 ) -%} - {{ k }} = {{ v }} -{% endfor %} - -{% for k, v in it|map(item => item + 2 ) -%} - {{ k }} = {{ v }} -{% endfor %} ---DATA-- -return ['it' => new \ArrayIterator([1, 2])] ---EXPECT-- -0 = 3 -1 = 4 - -a = 1* -b = 2* - -a = 1*a -b = 2*b - -0 = 3 -1 = 4 - -0 = 3 -1 = 4 diff --git a/vendor/twig/twig/tests/Fixtures/filters/merge.test b/vendor/twig/twig/tests/Fixtures/filters/merge.test deleted file mode 100644 index 8877501..0000000 --- a/vendor/twig/twig/tests/Fixtures/filters/merge.test +++ /dev/null @@ -1,25 +0,0 @@ ---TEST-- -"merge" filter ---TEMPLATE-- -{{ items|merge({'bar': 'foo'})|join }} -{{ items|merge({'bar': 'foo'})|keys|join }} -{{ {'bar': 'foo'}|merge(items)|join }} -{{ {'bar': 'foo'}|merge(items)|keys|join }} -{{ numerics|merge([4, 5, 6])|join }} -{{ traversable.a|merge(traversable.b)|join }} ---DATA-- -return [ - 'items' => ['foo' => 'bar'], - 'numerics' => [1, 2, 3], - 'traversable' => [ - 'a' => new \ArrayObject([0 => 1, 1 => 2, 2 => 3]), - 'b' => new \ArrayObject(['a' => 'b']) - ] -] ---EXPECT-- -barfoo -foobar -foobar -barfoo -123456 -123b diff --git a/vendor/twig/twig/tests/Fixtures/filters/nl2br.test b/vendor/twig/twig/tests/Fixtures/filters/nl2br.test deleted file mode 100644 index 524ec45..0000000 --- a/vendor/twig/twig/tests/Fixtures/filters/nl2br.test +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -"nl2br" filter ---TEMPLATE-- -{{ "I like Twig.\nYou will like it too.\n\nEverybody like it!"|nl2br }} -{{ text|nl2br }} ---DATA-- -return ['text' => "If you have some HTML\nit will be escaped."] ---EXPECT-- -I like Twig.
-You will like it too.
-
-Everybody like it! -If you have some <strong>HTML</strong>
-it will be escaped. diff --git a/vendor/twig/twig/tests/Fixtures/filters/number_format.test b/vendor/twig/twig/tests/Fixtures/filters/number_format.test deleted file mode 100644 index 7f1e2e1..0000000 --- a/vendor/twig/twig/tests/Fixtures/filters/number_format.test +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -"number_format" filter ---TEMPLATE-- -{{ 20|number_format }} -{{ 20.25|number_format }} -{{ 20.25|number_format(2) }} -{{ 20.25|number_format(2, ',') }} -{{ 1020.25|number_format(2, ',') }} -{{ 1020.25|number_format(2, ',', '.') }} ---DATA-- -return [] ---EXPECT-- -20 -20 -20.25 -20,25 -1,020,25 -1.020,25 diff --git a/vendor/twig/twig/tests/Fixtures/filters/number_format_default.test b/vendor/twig/twig/tests/Fixtures/filters/number_format_default.test deleted file mode 100644 index beedd90..0000000 --- a/vendor/twig/twig/tests/Fixtures/filters/number_format_default.test +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -"number_format" filter with defaults. ---TEMPLATE-- -{{ 20|number_format }} -{{ 20.25|number_format }} -{{ 20.25|number_format(1) }} -{{ 20.25|number_format(2, ',') }} -{{ 1020.25|number_format }} -{{ 1020.25|number_format(2, ',') }} -{{ 1020.25|number_format(2, ',', '.') }} ---DATA-- -$twig->getExtension('\Twig\Extension\CoreExtension')->setNumberFormat(2, '!', '='); -return [] ---EXPECT-- -20!00 -20!25 -20!3 -20,25 -1=020!25 -1=020,25 -1.020,25 diff --git a/vendor/twig/twig/tests/Fixtures/filters/reduce.test b/vendor/twig/twig/tests/Fixtures/filters/reduce.test deleted file mode 100644 index 73cad41..0000000 --- a/vendor/twig/twig/tests/Fixtures/filters/reduce.test +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -"reduce" filter ---TEMPLATE-- -{% set offset = 3 %} - -{{ [1, -1, 4]|reduce((carry, item) => carry + item + offset, 10) }} - -{{ it|reduce((carry, item) => carry + item + offset, 10) }} ---DATA-- -return ['it' => new \ArrayIterator([1, -1, 4])] ---EXPECT-- -23 - -23 diff --git a/vendor/twig/twig/tests/Fixtures/filters/replace.test b/vendor/twig/twig/tests/Fixtures/filters/replace.test deleted file mode 100644 index 1b9670a..0000000 --- a/vendor/twig/twig/tests/Fixtures/filters/replace.test +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -"replace" filter ---TEMPLATE-- -{{ "I liké %this% and %that%."|replace({'%this%': "foo", '%that%': "bar"}) }} -{{ 'I like single replace operation only %that%'|replace({'%that%' : '%that%1'}) }} -{{ 'I like %this% and %that%.'|replace(traversable) }} ---DATA-- -return ['traversable' => new \ArrayObject(['%this%' => 'foo', '%that%' => 'bar'])] ---EXPECT-- -I liké foo and bar. -I like single replace operation only %that%1 -I like foo and bar. diff --git a/vendor/twig/twig/tests/Fixtures/filters/replace_invalid_arg.test b/vendor/twig/twig/tests/Fixtures/filters/replace_invalid_arg.test deleted file mode 100644 index ba6fea4..0000000 --- a/vendor/twig/twig/tests/Fixtures/filters/replace_invalid_arg.test +++ /dev/null @@ -1,8 +0,0 @@ ---TEST-- -Exception for invalid argument type in replace call ---TEMPLATE-- -{{ 'test %foo%'|replace(stdClass) }} ---DATA-- -return ['stdClass' => new \stdClass()] ---EXCEPTION-- -Twig\Error\RuntimeError: The "replace" filter expects an array or "Traversable" as replace values, got "stdClass" in "index.twig" at line 2. diff --git a/vendor/twig/twig/tests/Fixtures/filters/reverse.test b/vendor/twig/twig/tests/Fixtures/filters/reverse.test deleted file mode 100644 index 904e583..0000000 --- a/vendor/twig/twig/tests/Fixtures/filters/reverse.test +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -"reverse" filter ---TEMPLATE-- -{{ [1, 2, 3, 4]|reverse|join('') }} -{{ '1234évènement'|reverse }} -{{ arr|reverse|join('') }} -{{ {'a': 'c', 'b': 'a'}|reverse()|join(',') }} -{{ {'a': 'c', 'b': 'a'}|reverse(preserveKeys=true)|join(glue=',') }} -{{ {'a': 'c', 'b': 'a'}|reverse(preserve_keys=true)|join(glue=',') }} ---DATA-- -return ['arr' => new \ArrayObject([1, 2, 3, 4])] ---EXPECT-- -4321 -tnemenèvé4321 -4321 -a,c -a,c -a,c diff --git a/vendor/twig/twig/tests/Fixtures/filters/round.test b/vendor/twig/twig/tests/Fixtures/filters/round.test deleted file mode 100644 index 7092375..0000000 --- a/vendor/twig/twig/tests/Fixtures/filters/round.test +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -"round" filter ---TEMPLATE-- -{{ 2.7|round }} -{{ 2.1|round }} -{{ 2.1234|round(3, 'floor') }} -{{ 2.1|round(0, 'ceil') }} - -{{ 21.3|round(-1)}} -{{ 21.3|round(-1, 'ceil')}} -{{ 21.3|round(-1, 'floor')}} ---DATA-- -return [] ---EXPECT-- -3 -2 -2.123 -3 - -20 -30 -20 diff --git a/vendor/twig/twig/tests/Fixtures/filters/slice.test b/vendor/twig/twig/tests/Fixtures/filters/slice.test deleted file mode 100644 index fc975d7..0000000 --- a/vendor/twig/twig/tests/Fixtures/filters/slice.test +++ /dev/null @@ -1,54 +0,0 @@ ---TEST-- -"slice" filter ---TEMPLATE-- -{{ [1, 2, 3, 4][1:2]|join('') }} -{{ {a: 1, b: 2, c: 3, d: 4}[1:2]|join('') }} -{{ [1, 2, 3, 4][start:length]|join('') }} -{{ [1, 2, 3, 4]|slice(1, 2)|join('') }} -{{ [1, 2, 3, 4]|slice(1, 2)|keys|join('') }} -{{ [1, 2, 3, 4]|slice(1, 2, true)|keys|join('') }} -{{ {a: 1, b: 2, c: 3, d: 4}|slice(1, 2)|join('') }} -{{ {a: 1, b: 2, c: 3, d: 4}|slice(1, 2)|keys|join('') }} -{{ '1234'|slice(1, 2) }} -{{ '1234'[1:2] }} -{{ arr|slice(1, 2)|join('') }} -{{ arr[1:2]|join('') }} -{{ arr[4:1]|join('') }} -{{ arr[3:2]|join('') }} - -{{ [1, 2, 3, 4]|slice(1)|join('') }} -{{ [1, 2, 3, 4][1:]|join('') }} -{{ '1234'|slice(1) }} -{{ '1234'[1:] }} -{{ '1234'[:1] }} - -{{ arr|slice(3)|join('') }} -{{ arr[2:]|join('') }} -{{ xml|slice(1)|join('')}} ---DATA-- -return ['start' => 1, 'length' => 2, 'arr' => new \ArrayObject([1, 2, 3, 4]), 'xml' => new \SimpleXMLElement('12')] ---EXPECT-- -23 -23 -23 -23 -01 -12 -23 -bc -23 -23 -23 -23 - -4 - -234 -234 -234 -234 -1 - -4 -34 -2 diff --git a/vendor/twig/twig/tests/Fixtures/filters/sort.test b/vendor/twig/twig/tests/Fixtures/filters/sort.test deleted file mode 100644 index c3b2c70..0000000 --- a/vendor/twig/twig/tests/Fixtures/filters/sort.test +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -"sort" filter ---TEMPLATE-- -{{ array1|sort|join }} -{{ array2|sort|join }} -{{ traversable|sort|join }} ---DATA-- -return ['array1' => [4, 1], 'array2' => ['foo', 'bar'], 'traversable' => new \ArrayObject([0 => 3, 1 => 2, 2 => 1])] ---EXPECT-- -14 -barfoo -123 diff --git a/vendor/twig/twig/tests/Fixtures/filters/spaceless.test b/vendor/twig/twig/tests/Fixtures/filters/spaceless.test deleted file mode 100644 index eadc1d4..0000000 --- a/vendor/twig/twig/tests/Fixtures/filters/spaceless.test +++ /dev/null @@ -1,8 +0,0 @@ ---TEST-- -"spaceless" filter ---TEMPLATE-- -{{ "
foo
"|spaceless }} ---DATA-- -return [] ---EXPECT-- -
foo
diff --git a/vendor/twig/twig/tests/Fixtures/filters/special_chars.test b/vendor/twig/twig/tests/Fixtures/filters/special_chars.test deleted file mode 100644 index 9869ec9..0000000 --- a/vendor/twig/twig/tests/Fixtures/filters/special_chars.test +++ /dev/null @@ -1,8 +0,0 @@ ---TEST-- -"§" custom filter ---TEMPLATE-- -{{ 'foo'|§ }} ---DATA-- -return [] ---EXPECT-- -§foo§ diff --git a/vendor/twig/twig/tests/Fixtures/filters/split.test b/vendor/twig/twig/tests/Fixtures/filters/split.test deleted file mode 100644 index 2bd46af..0000000 --- a/vendor/twig/twig/tests/Fixtures/filters/split.test +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -"split" filter ---TEMPLATE-- -{{ "one,two,three,four,five"|split(',')|join('-') }} -{{ foo|split(',')|join('-') }} -{{ foo|split(',', 3)|join('-') }} -{{ baz|split('')|join('-') }} -{{ baz|split('', 1)|join('-') }} -{{ baz|split('', 2)|join('-') }} -{{ foo|split(',', -2)|join('-') }} -{{ "hello0world"|split('0')|join('-') }} ---DATA-- -return ['foo' => "one,two,three,four,five", 'baz' => '12345',] ---EXPECT-- -one-two-three-four-five -one-two-three-four-five -one-two-three,four,five -1-2-3-4-5 -1-2-3-4-5 -12-34-5 -one-two-three -hello-world \ No newline at end of file diff --git a/vendor/twig/twig/tests/Fixtures/filters/split_utf8.test b/vendor/twig/twig/tests/Fixtures/filters/split_utf8.test deleted file mode 100644 index bf52e6d..0000000 --- a/vendor/twig/twig/tests/Fixtures/filters/split_utf8.test +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -"split" filter ---CONDITION-- -function_exists('mb_get_info') ---TEMPLATE-- -{{ "é"|split('', 10)|join('-') }} -{{ foo|split(',')|join('-') }} -{{ foo|split(',', 1)|join('-') }} -{{ foo|split(',', 2)|join('-') }} -{{ foo|split(',', 3)|join('-') }} -{{ baz|split('')|join('-') }} -{{ baz|split('', 1)|join('-') }} -{{ baz|split('', 2)|join('-') }} ---DATA-- -return ['foo' => 'Ä,é,Äほ', 'baz' => 'éÄßごa',] ---EXPECT-- -é -Ä-é-Äほ -Ä,é,Äほ -Ä-é,Äほ -Ä-é-Äほ -é-Ä-ß-ご-a -é-Ä-ß-ご-a -éÄ-ßご-a \ No newline at end of file diff --git a/vendor/twig/twig/tests/Fixtures/filters/static_calls.test b/vendor/twig/twig/tests/Fixtures/filters/static_calls.test deleted file mode 100644 index 1626db0..0000000 --- a/vendor/twig/twig/tests/Fixtures/filters/static_calls.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -Filters as static method calls ---TEMPLATE-- -{{ 'foo'|static_call_string }} -{{ 'foo'|static_call_array }} ---DATA-- -return ['foo' => 'foo'] ---EXPECT-- -*foo* -*foo* diff --git a/vendor/twig/twig/tests/Fixtures/filters/trim.test b/vendor/twig/twig/tests/Fixtures/filters/trim.test deleted file mode 100644 index 432989f..0000000 --- a/vendor/twig/twig/tests/Fixtures/filters/trim.test +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -"trim" filter ---TEMPLATE-- -{{ " I like Twig. "|trim }} -{{ text|trim }} -{{ " foo/"|trim("/") }} -{{ "xxxI like Twig.xxx"|trim(character_mask="x", side="left") }} -{{ "xxxI like Twig.xxx"|trim(side="right", character_mask="x") }} -{{ "xxxI like Twig.xxx"|trim("x", "right") }} -{{ "/ foo/"|trim("/", "left") }} -{{ "/ foo/"|trim(character_mask="/", side="left") }} -{{ " do nothing. "|trim("", "right") }} ---DATA-- -return ['text' => " If you have some HTML it will be escaped. "] ---EXPECT-- -I like Twig. -If you have some <strong>HTML</strong> it will be escaped. - foo -I like Twig.xxx -xxxI like Twig. -xxxI like Twig. - foo/ - foo/ - do nothing. diff --git a/vendor/twig/twig/tests/Fixtures/filters/urlencode.test b/vendor/twig/twig/tests/Fixtures/filters/urlencode.test deleted file mode 100644 index 66a682d..0000000 --- a/vendor/twig/twig/tests/Fixtures/filters/urlencode.test +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -"url_encode" filter ---CONDITION-- -defined('PHP_QUERY_RFC3986') ---TEMPLATE-- -{{ {foo: "bar", number: 3, "spéßi%l": "e%c0d@d", "spa ce": ""}|url_encode }} -{{ {foo: "bar", number: 3, "spéßi%l": "e%c0d@d", "spa ce": ""}|url_encode|raw }} -{{ {}|url_encode|default("default") }} -{{ 'spéßi%le%c0d@dspa ce'|url_encode }} ---DATA-- -return [] ---EXPECT-- -foo=bar&number=3&sp%C3%A9%C3%9Fi%25l=e%25c0d%40d&spa%20ce= -foo=bar&number=3&sp%C3%A9%C3%9Fi%25l=e%25c0d%40d&spa%20ce= -default -sp%C3%A9%C3%9Fi%25le%25c0d%40dspa%20ce diff --git a/vendor/twig/twig/tests/Fixtures/filters/urlencode_deprecated.test b/vendor/twig/twig/tests/Fixtures/filters/urlencode_deprecated.test deleted file mode 100644 index 38d7264..0000000 --- a/vendor/twig/twig/tests/Fixtures/filters/urlencode_deprecated.test +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -"url_encode" filter for PHP < 5.4 ---CONDITION-- -defined('PHP_QUERY_RFC3986') ---TEMPLATE-- -{{ {foo: "bar", number: 3, "spéßi%l": "e%c0d@d", "spa ce": ""}|url_encode }} -{{ {foo: "bar", number: 3, "spéßi%l": "e%c0d@d", "spa ce": ""}|url_encode|raw }} -{{ {}|url_encode|default("default") }} -{{ 'spéßi%le%c0d@dspa ce'|url_encode }} ---DATA-- -return [] ---EXPECT-- -foo=bar&number=3&sp%C3%A9%C3%9Fi%25l=e%25c0d%40d&spa%20ce= -foo=bar&number=3&sp%C3%A9%C3%9Fi%25l=e%25c0d%40d&spa%20ce= -default -sp%C3%A9%C3%9Fi%25le%25c0d%40dspa%20ce diff --git a/vendor/twig/twig/tests/Fixtures/functions/attribute.test b/vendor/twig/twig/tests/Fixtures/functions/attribute.test deleted file mode 100644 index 4499ad4..0000000 --- a/vendor/twig/twig/tests/Fixtures/functions/attribute.test +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -"attribute" function ---TEMPLATE-- -{{ attribute(obj, method) }} -{{ attribute(array, item) }} -{{ attribute(obj, "bar", ["a", "b"]) }} -{{ attribute(obj, "bar", arguments) }} -{{ attribute(obj, method) is defined ? 'ok' : 'ko' }} -{{ attribute(obj, nonmethod) is defined ? 'ok' : 'ko' }} ---DATA-- -return ['obj' => new Twig\Tests\TwigTestFoo(), 'method' => 'foo', 'array' => ['foo' => 'bar'], 'item' => 'foo', 'nonmethod' => 'xxx', 'arguments' => ['a', 'b']] ---EXPECT-- -foo -bar -bar_a-b -bar_a-b -ok -ko diff --git a/vendor/twig/twig/tests/Fixtures/functions/block.test b/vendor/twig/twig/tests/Fixtures/functions/block.test deleted file mode 100644 index 1a4fd54..0000000 --- a/vendor/twig/twig/tests/Fixtures/functions/block.test +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -"block" function ---TEMPLATE-- -{% extends 'base.twig' %} -{% block bar %}BAR{% endblock %} ---TEMPLATE(base.twig)-- -{% block foo %}{{ block('bar') }}{% endblock %} -{% block bar %}BAR_BASE{% endblock %} ---DATA-- -return [] ---EXPECT-- -BARBAR diff --git a/vendor/twig/twig/tests/Fixtures/functions/block_with_template.test b/vendor/twig/twig/tests/Fixtures/functions/block_with_template.test deleted file mode 100644 index 37cb7a4..0000000 --- a/vendor/twig/twig/tests/Fixtures/functions/block_with_template.test +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -"block" function with a template argument ---TEMPLATE-- -{{ block('foo', 'included.twig') }} -{{ block('foo', included_loaded) }} -{{ block('foo', included_loaded_internal) }} -{% set output = block('foo', 'included.twig') %} -{{ output }} -{% block foo %}NOT FOO{% endblock %} ---TEMPLATE(included.twig)-- -{% block foo %}FOO{% endblock %} ---DATA-- -return [ - 'included_loaded' => $twig->load('included.twig'), - 'included_loaded_internal' => $twig->load('included.twig'), -] ---EXPECT-- -FOO -FOO -FOO -FOO -NOT FOO diff --git a/vendor/twig/twig/tests/Fixtures/functions/block_without_name.test b/vendor/twig/twig/tests/Fixtures/functions/block_without_name.test deleted file mode 100644 index 236df94..0000000 --- a/vendor/twig/twig/tests/Fixtures/functions/block_without_name.test +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -"block" function without arguments ---TEMPLATE-- -{% extends 'base.twig' %} -{% block bar %}BAR{% endblock %} ---TEMPLATE(base.twig)-- -{% block foo %}{{ block() }}{% endblock %} -{% block bar %}BAR_BASE{% endblock %} ---DATA-- -return [] ---EXCEPTION-- -Twig\Error\SyntaxError: The "block" function takes one argument (the block name) in "base.twig" at line 2. diff --git a/vendor/twig/twig/tests/Fixtures/functions/constant.test b/vendor/twig/twig/tests/Fixtures/functions/constant.test deleted file mode 100644 index fd6dd06..0000000 --- a/vendor/twig/twig/tests/Fixtures/functions/constant.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -"constant" function ---TEMPLATE-- -{{ constant('DATE_W3C') == expect ? 'true' : 'false' }} -{{ constant('ARRAY_AS_PROPS', object) }} ---DATA-- -return ['expect' => DATE_W3C, 'object' => new \ArrayObject(['hi'])] ---EXPECT-- -true -2 diff --git a/vendor/twig/twig/tests/Fixtures/functions/cycle.test b/vendor/twig/twig/tests/Fixtures/functions/cycle.test deleted file mode 100644 index 0ac6dcc..0000000 --- a/vendor/twig/twig/tests/Fixtures/functions/cycle.test +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -"cycle" function ---TEMPLATE-- -{% for i in 0..6 %} -{{ cycle(array1, i) }}-{{ cycle(array2, i) }} -{% endfor %} ---DATA-- -return ['array1' => ['odd', 'even'], 'array2' => ['apple', 'orange', 'citrus']] ---EXPECT-- -odd-apple -even-orange -odd-citrus -even-apple -odd-orange -even-citrus -odd-apple diff --git a/vendor/twig/twig/tests/Fixtures/functions/date.test b/vendor/twig/twig/tests/Fixtures/functions/date.test deleted file mode 100644 index c879da3..0000000 --- a/vendor/twig/twig/tests/Fixtures/functions/date.test +++ /dev/null @@ -1,27 +0,0 @@ ---TEST-- -"date" function ---TEMPLATE-- -{{ date().format('r') == date('now').format('r') ? 'OK' : 'KO' }} -{{ date(date1) == date('2010-10-04 13:45') ? 'OK' : 'KO' }} -{{ date(date2) == date('2010-10-04 13:45') ? 'OK' : 'KO' }} -{{ date(date3) == date('2010-10-04 13:45') ? 'OK' : 'KO' }} -{{ date(date4) == date('2010-10-04 13:45') ? 'OK' : 'KO' }} -{{ date(date5) == date('1964-01-02 03:04') ? 'OK' : 'KO' }} -{{ date() > date('-1day') ? 'OK' : 'KO' }} ---DATA-- -date_default_timezone_set('UTC'); -return [ - 'date1' => mktime(13, 45, 0, 10, 4, 2010), - 'date2' => new \DateTime('2010-10-04 13:45'), - 'date3' => '2010-10-04 13:45', - 'date4' => 1286199900, // \DateTime::createFromFormat('Y-m-d H:i', '2010-10-04 13:45', new \DateTimeZone('UTC'))->getTimestamp() -- A unixtimestamp is always GMT - 'date5' => -189291360, // \DateTime::createFromFormat('Y-m-d H:i', '1964-01-02 03:04', new \DateTimeZone('UTC'))->getTimestamp(), -] ---EXPECT-- -OK -OK -OK -OK -OK -OK -OK diff --git a/vendor/twig/twig/tests/Fixtures/functions/date_namedargs.test b/vendor/twig/twig/tests/Fixtures/functions/date_namedargs.test deleted file mode 100644 index 11f60ee..0000000 --- a/vendor/twig/twig/tests/Fixtures/functions/date_namedargs.test +++ /dev/null @@ -1,11 +0,0 @@ ---TEST-- -"date" function ---TEMPLATE-- -{{ date(date, "America/New_York")|date('d/m/Y H:i:s P', false) }} -{{ date(timezone="America/New_York", date=date)|date('d/m/Y H:i:s P', false) }} ---DATA-- -date_default_timezone_set('UTC'); -return ['date' => mktime(13, 45, 0, 10, 4, 2010)] ---EXPECT-- -04/10/2010 09:45:00 -04:00 -04/10/2010 09:45:00 -04:00 diff --git a/vendor/twig/twig/tests/Fixtures/functions/dump.test b/vendor/twig/twig/tests/Fixtures/functions/dump.test deleted file mode 100644 index 691a3ab..0000000 --- a/vendor/twig/twig/tests/Fixtures/functions/dump.test +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -"dump" function ---CONDITION-- -!extension_loaded('xdebug') ---TEMPLATE-- -{{ dump('foo') }} -{{ dump('foo', 'bar') }} ---DATA-- -return ['foo' => 'foo', 'bar' => 'bar'] ---CONFIG-- -return ['debug' => true, 'autoescape' => false] ---EXPECT-- -string(3) "foo" - -string(3) "foo" -string(3) "bar" diff --git a/vendor/twig/twig/tests/Fixtures/functions/dump_array.test b/vendor/twig/twig/tests/Fixtures/functions/dump_array.test deleted file mode 100644 index 5fd9383..0000000 --- a/vendor/twig/twig/tests/Fixtures/functions/dump_array.test +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -"dump" function, xdebug is not loaded or xdebug <2.2-dev is loaded ---CONDITION-- -!extension_loaded('xdebug') || (($r = new \ReflectionExtension('xdebug')) && version_compare($r->getVersion(), '2.2-dev', '<')) ---TEMPLATE-- -{{ dump() }} ---DATA-- -return ['foo' => 'foo', 'bar' => 'bar'] ---CONFIG-- -return ['debug' => true, 'autoescape' => false] ---EXPECT-- -array(3) { - ["foo"]=> - string(3) "foo" - ["bar"]=> - string(3) "bar" - ["global"]=> - string(6) "global" -} diff --git a/vendor/twig/twig/tests/Fixtures/functions/dynamic_function.test b/vendor/twig/twig/tests/Fixtures/functions/dynamic_function.test deleted file mode 100644 index c7b3539..0000000 --- a/vendor/twig/twig/tests/Fixtures/functions/dynamic_function.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -dynamic function ---TEMPLATE-- -{{ foo_path('bar') }} -{{ a_foo_b_bar('bar') }} ---DATA-- -return [] ---EXPECT-- -foo/bar -a/b/bar diff --git a/vendor/twig/twig/tests/Fixtures/functions/include/assignment.test b/vendor/twig/twig/tests/Fixtures/functions/include/assignment.test deleted file mode 100644 index c9ce812..0000000 --- a/vendor/twig/twig/tests/Fixtures/functions/include/assignment.test +++ /dev/null @@ -1,13 +0,0 @@ ---TEST-- -"include" function ---TEMPLATE-- -{% set tmp = include("foo.twig") %} - -FOO{{ tmp }}BAR ---TEMPLATE(foo.twig)-- -FOOBAR ---DATA-- -return [] ---EXPECT-- -FOO -FOOBARBAR diff --git a/vendor/twig/twig/tests/Fixtures/functions/include/autoescaping.test b/vendor/twig/twig/tests/Fixtures/functions/include/autoescaping.test deleted file mode 100644 index a366626..0000000 --- a/vendor/twig/twig/tests/Fixtures/functions/include/autoescaping.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -"include" function is safe for auto-escaping ---TEMPLATE-- -{{ include("foo.twig") }} ---TEMPLATE(foo.twig)-- -

Test

---DATA-- -return [] ---EXPECT-- -

Test

diff --git a/vendor/twig/twig/tests/Fixtures/functions/include/basic.test b/vendor/twig/twig/tests/Fixtures/functions/include/basic.test deleted file mode 100644 index f90983c..0000000 --- a/vendor/twig/twig/tests/Fixtures/functions/include/basic.test +++ /dev/null @@ -1,17 +0,0 @@ ---TEST-- -"include" function ---TEMPLATE-- -FOO -{{ include("foo.twig") }} - -BAR ---TEMPLATE(foo.twig)-- -FOOBAR ---DATA-- -return [] ---EXPECT-- -FOO - -FOOBAR - -BAR diff --git a/vendor/twig/twig/tests/Fixtures/functions/include/expression.test b/vendor/twig/twig/tests/Fixtures/functions/include/expression.test deleted file mode 100644 index c6d3d1c..0000000 --- a/vendor/twig/twig/tests/Fixtures/functions/include/expression.test +++ /dev/null @@ -1,17 +0,0 @@ ---TEST-- -"include" function allows expressions for the template to include ---TEMPLATE-- -FOO -{{ include(foo) }} - -BAR ---TEMPLATE(foo.twig)-- -FOOBAR ---DATA-- -return ['foo' => 'foo.twig'] ---EXPECT-- -FOO - -FOOBAR - -BAR diff --git a/vendor/twig/twig/tests/Fixtures/functions/include/ignore_missing.test b/vendor/twig/twig/tests/Fixtures/functions/include/ignore_missing.test deleted file mode 100644 index c05b43e..0000000 --- a/vendor/twig/twig/tests/Fixtures/functions/include/ignore_missing.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -"include" function ---TEMPLATE-- -{{ include(["foo.twig", "bar.twig"], ignore_missing = true) }} -{{ include("foo.twig", ignore_missing = true) }} -{{ include("foo.twig", ignore_missing = true, variables = {}) }} -{{ include("foo.twig", ignore_missing = true, variables = {}, with_context = true) }} ---DATA-- -return [] ---EXPECT-- diff --git a/vendor/twig/twig/tests/Fixtures/functions/include/ignore_missing_exists.test b/vendor/twig/twig/tests/Fixtures/functions/include/ignore_missing_exists.test deleted file mode 100644 index fc2d211..0000000 --- a/vendor/twig/twig/tests/Fixtures/functions/include/ignore_missing_exists.test +++ /dev/null @@ -1,11 +0,0 @@ ---TEST-- -"include" function ---TEMPLATE-- -{{ include("included.twig", ignore_missing = true) }} -NOT DISPLAYED ---TEMPLATE(included.twig)-- -{{ include("DOES NOT EXIST") }} ---DATA-- -return [] ---EXCEPTION-- -Twig\Error\LoaderError: Template "DOES NOT EXIST" is not defined in "included.twig" at line 2. diff --git a/vendor/twig/twig/tests/Fixtures/functions/include/include_missing_extends.test b/vendor/twig/twig/tests/Fixtures/functions/include/include_missing_extends.test deleted file mode 100644 index 810ae82..0000000 --- a/vendor/twig/twig/tests/Fixtures/functions/include/include_missing_extends.test +++ /dev/null @@ -1,13 +0,0 @@ ---TEST-- -"include" function ---TEMPLATE-- -{{ include(['bad.twig', 'good.twig'], ignore_missing = true) }} -NOT DISPLAYED ---TEMPLATE(bad.twig)-- -{% extends 'DOES NOT EXIST' %} ---TEMPLATE(good.twig)-- -NOT DISPLAYED ---DATA-- -return [] ---EXCEPTION-- -Twig\Error\LoaderError: Template "DOES NOT EXIST" is not defined in "bad.twig" at line 2. diff --git a/vendor/twig/twig/tests/Fixtures/functions/include/missing.test b/vendor/twig/twig/tests/Fixtures/functions/include/missing.test deleted file mode 100644 index 1d50f7a..0000000 --- a/vendor/twig/twig/tests/Fixtures/functions/include/missing.test +++ /dev/null @@ -1,8 +0,0 @@ ---TEST-- -"include" function ---TEMPLATE-- -{{ include("foo.twig") }} ---DATA-- -return [] ---EXCEPTION-- -Twig\Error\LoaderError: Template "foo.twig" is not defined in "index.twig" at line 2. diff --git a/vendor/twig/twig/tests/Fixtures/functions/include/missing_nested.test b/vendor/twig/twig/tests/Fixtures/functions/include/missing_nested.test deleted file mode 100644 index 9ae8c9e..0000000 --- a/vendor/twig/twig/tests/Fixtures/functions/include/missing_nested.test +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -"include" function ---TEMPLATE-- -{% extends "base.twig" %} - -{% block content %} - {{ parent() }} -{% endblock %} ---TEMPLATE(base.twig)-- -{% block content %} - {{ include("foo.twig") }} -{% endblock %} ---DATA-- -return [] ---EXCEPTION-- -Twig\Error\LoaderError: Template "foo.twig" is not defined in "base.twig" at line 3. diff --git a/vendor/twig/twig/tests/Fixtures/functions/include/sandbox.test b/vendor/twig/twig/tests/Fixtures/functions/include/sandbox.test deleted file mode 100644 index ebfdb1e..0000000 --- a/vendor/twig/twig/tests/Fixtures/functions/include/sandbox.test +++ /dev/null @@ -1,13 +0,0 @@ ---TEST-- -"include" tag sandboxed ---TEMPLATE-- -{{ include("foo.twig", sandboxed = true) }} ---TEMPLATE(foo.twig)-- - - -{{ foo|e }} -{{ foo|e }} ---DATA-- -return [] ---EXCEPTION-- -Twig\Sandbox\SecurityNotAllowedFilterError: Filter "e" is not allowed in "foo.twig" at line 4. diff --git a/vendor/twig/twig/tests/Fixtures/functions/include/sandbox_disabling.test b/vendor/twig/twig/tests/Fixtures/functions/include/sandbox_disabling.test deleted file mode 100644 index 1206b67..0000000 --- a/vendor/twig/twig/tests/Fixtures/functions/include/sandbox_disabling.test +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -"include" tag sandboxed ---TEMPLATE-- -{{ include("foo.twig", sandboxed = true) }} -{{ include("bar.twig") }} ---TEMPLATE(foo.twig)-- -foo ---TEMPLATE(bar.twig)-- -{{ foo|e }} ---DATA-- -return ['foo' => 'bar
'] ---EXPECT-- -foo - - -bar<br /> diff --git a/vendor/twig/twig/tests/Fixtures/functions/include/sandbox_disabling_ignore_missing.test b/vendor/twig/twig/tests/Fixtures/functions/include/sandbox_disabling_ignore_missing.test deleted file mode 100644 index c5be008..0000000 --- a/vendor/twig/twig/tests/Fixtures/functions/include/sandbox_disabling_ignore_missing.test +++ /dev/null @@ -1,13 +0,0 @@ ---TEST-- -"include" tag sandboxed ---TEMPLATE-- -{{ include("unknown.twig", sandboxed = true, ignore_missing = true) }} -{{ include("bar.twig") }} ---TEMPLATE(bar.twig)-- -{{ foo|e }} ---DATA-- -return ['foo' => 'bar
'] ---EXPECT-- - - -bar<br /> diff --git a/vendor/twig/twig/tests/Fixtures/functions/include/template_instance.test b/vendor/twig/twig/tests/Fixtures/functions/include/template_instance.test deleted file mode 100644 index 4c8b450..0000000 --- a/vendor/twig/twig/tests/Fixtures/functions/include/template_instance.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -"include" function accepts Twig_Template instance ---TEMPLATE-- -{{ include(foo) }} FOO ---TEMPLATE(foo.twig)-- -BAR ---DATA-- -return ['foo' => $twig->load('foo.twig')] ---EXPECT-- -BAR FOO diff --git a/vendor/twig/twig/tests/Fixtures/functions/include/templates_as_array.test b/vendor/twig/twig/tests/Fixtures/functions/include/templates_as_array.test deleted file mode 100644 index 21e5bb2..0000000 --- a/vendor/twig/twig/tests/Fixtures/functions/include/templates_as_array.test +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -"include" function ---TEMPLATE-- -{{ include(["foo.twig", "bar.twig"]) }} -{{- include(["bar.twig", "foo.twig"]) }} ---TEMPLATE(foo.twig)-- -foo ---DATA-- -return [] ---EXPECT-- -foo -foo diff --git a/vendor/twig/twig/tests/Fixtures/functions/include/with_context.test b/vendor/twig/twig/tests/Fixtures/functions/include/with_context.test deleted file mode 100644 index 46ac8c7..0000000 --- a/vendor/twig/twig/tests/Fixtures/functions/include/with_context.test +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -"include" function accept variables and with_context ---TEMPLATE-- -{{ include("foo.twig") }} -{{- include("foo.twig", with_context = false) }} -{{- include("foo.twig", {'foo1': 'bar'}) }} -{{- include("foo.twig", {'foo1': 'bar'}, with_context = false) }} ---TEMPLATE(foo.twig)-- -{% for k, v in _context %}{{ k }},{% endfor %} ---DATA-- -return ['foo' => 'bar'] ---EXPECT-- -foo,global,_parent, -global,_parent, -foo,global,foo1,_parent, -foo1,global,_parent, diff --git a/vendor/twig/twig/tests/Fixtures/functions/include/with_variables.test b/vendor/twig/twig/tests/Fixtures/functions/include/with_variables.test deleted file mode 100644 index 0ed98fe..0000000 --- a/vendor/twig/twig/tests/Fixtures/functions/include/with_variables.test +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -"include" function accept variables ---TEMPLATE-- -{{ include("foo.twig", {'foo': 'bar'}) }} -{{- include("foo.twig", vars) }} ---TEMPLATE(foo.twig)-- -{{ foo }} ---DATA-- -return ['vars' => ['foo' => 'bar']] ---EXPECT-- -bar -bar diff --git a/vendor/twig/twig/tests/Fixtures/functions/include_template_from_string.test b/vendor/twig/twig/tests/Fixtures/functions/include_template_from_string.test deleted file mode 100644 index 8d9ba60..0000000 --- a/vendor/twig/twig/tests/Fixtures/functions/include_template_from_string.test +++ /dev/null @@ -1,11 +0,0 @@ ---TEST-- -"template_from_string" function works in an "include" ---TEMPLATE-- -{% set embed = '{% embed "embed.twig" %}{% endembed %}' %} -{{ include(template_from_string(embed)) }} ---TEMPLATE(embed.twig)-- -Cool ---DATA-- -return [] ---EXPECT-- -Cool diff --git a/vendor/twig/twig/tests/Fixtures/functions/magic_call.test b/vendor/twig/twig/tests/Fixtures/functions/magic_call.test deleted file mode 100644 index 4dd5e27..0000000 --- a/vendor/twig/twig/tests/Fixtures/functions/magic_call.test +++ /dev/null @@ -1,8 +0,0 @@ ---TEST-- -__call calls ---TEMPLATE-- -{{ 'foo'|magic_call }} ---DATA-- -return [] ---EXPECT-- -magic_foo diff --git a/vendor/twig/twig/tests/Fixtures/functions/magic_call53.test b/vendor/twig/twig/tests/Fixtures/functions/magic_call53.test deleted file mode 100644 index a7c65bf..0000000 --- a/vendor/twig/twig/tests/Fixtures/functions/magic_call53.test +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -__staticCall calls ---CONDITION-- -version_compare(phpversion(), '5.3.0', '>=') ---TEMPLATE-- -{{ 'foo'|magic_call_string }} -{{ 'foo'|magic_call_array }} ---DATA-- -return [] ---EXPECT-- -static_magic_foo -static_magic_foo diff --git a/vendor/twig/twig/tests/Fixtures/functions/max.test b/vendor/twig/twig/tests/Fixtures/functions/max.test deleted file mode 100644 index 6d2de00..0000000 --- a/vendor/twig/twig/tests/Fixtures/functions/max.test +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -"max" function ---TEMPLATE-- -{{ max([2, 1, 3, 5, 4]) }} -{{ max(2, 1, 3, 5, 4) }} -{{ max({2:"two", 1:"one", 3:"three", 5:"five", 4:"for"}) }} ---DATA-- -return [] ---EXPECT-- -5 -5 -two diff --git a/vendor/twig/twig/tests/Fixtures/functions/min.test b/vendor/twig/twig/tests/Fixtures/functions/min.test deleted file mode 100644 index 1fe5446..0000000 --- a/vendor/twig/twig/tests/Fixtures/functions/min.test +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -"min" function ---TEMPLATE-- -{{ min(2, 1, 3, 5, 4) }} -{{ min([2, 1, 3, 5, 4]) }} -{{ min({2:"two", 1:"one", 3:"three", 5:"five", 4:"for"}) }} ---DATA-- -return [] ---EXPECT-- -1 -1 -five diff --git a/vendor/twig/twig/tests/Fixtures/functions/range.test b/vendor/twig/twig/tests/Fixtures/functions/range.test deleted file mode 100644 index 2927333..0000000 --- a/vendor/twig/twig/tests/Fixtures/functions/range.test +++ /dev/null @@ -1,8 +0,0 @@ ---TEST-- -"range" function ---TEMPLATE-- -{{ range(low=0+1, high=10+0, step=2)|join(',') }} ---DATA-- -return [] ---EXPECT-- -1,3,5,7,9 diff --git a/vendor/twig/twig/tests/Fixtures/functions/recursive_block_with_inheritance.test b/vendor/twig/twig/tests/Fixtures/functions/recursive_block_with_inheritance.test deleted file mode 100644 index 1c3fffb..0000000 --- a/vendor/twig/twig/tests/Fixtures/functions/recursive_block_with_inheritance.test +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -"block" function recursively called in a parent template ---TEMPLATE-- -{% extends "ordered_menu.twig" %} -{% block label %}"{{ parent() }}"{% endblock %} -{% block list %}{% set class = 'b' %}{{ parent() }}{% endblock %} ---TEMPLATE(ordered_menu.twig)-- -{% extends "menu.twig" %} -{% block list %}{% set class = class|default('a') %}
    {{ block('children') }}
{% endblock %} ---TEMPLATE(menu.twig)-- -{% extends "base.twig" %} -{% block list %}
    {{ block('children') }}
{% endblock %} -{% block children %}{% set currentItem = item %}{% for item in currentItem %}{{ block('item') }}{% endfor %}{% set item = currentItem %}{% endblock %} -{% block item %}
  • {% if item is not iterable %}{{ block('label') }}{% else %}{{ block('list') }}{% endif %}
  • {% endblock %} -{% block label %}{{ item }}{% endblock %} ---TEMPLATE(base.twig)-- -{{ block('list') }} ---DATA-- -return ['item' => ['1', '2', ['3.1', ['3.2.1', '3.2.2'], '3.4']]] ---EXPECT-- -
    1. "1"
    2. "2"
      1. "3.1"
        1. "3.2.1"
        2. "3.2.2"
      2. "3.4"
    diff --git a/vendor/twig/twig/tests/Fixtures/functions/source.test b/vendor/twig/twig/tests/Fixtures/functions/source.test deleted file mode 100644 index b691ce7..0000000 --- a/vendor/twig/twig/tests/Fixtures/functions/source.test +++ /dev/null @@ -1,17 +0,0 @@ ---TEST-- -"source" function ---TEMPLATE-- -FOO -{{ source("foo.twig") }} - -BAR ---TEMPLATE(foo.twig)-- -{{ foo }}
    ---DATA-- -return [] ---EXPECT-- -FOO - -{{ foo }}
    - -BAR diff --git a/vendor/twig/twig/tests/Fixtures/functions/special_chars.test b/vendor/twig/twig/tests/Fixtures/functions/special_chars.test deleted file mode 100644 index 9c9e249..0000000 --- a/vendor/twig/twig/tests/Fixtures/functions/special_chars.test +++ /dev/null @@ -1,8 +0,0 @@ ---TEST-- -"§" custom function ---TEMPLATE-- -{{ §('foo') }} ---DATA-- -return [] ---EXPECT-- -§foo§ diff --git a/vendor/twig/twig/tests/Fixtures/functions/static_calls.test b/vendor/twig/twig/tests/Fixtures/functions/static_calls.test deleted file mode 100644 index dd13abb..0000000 --- a/vendor/twig/twig/tests/Fixtures/functions/static_calls.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -Functions as static method calls ---TEMPLATE-- -{{ static_call_string('foo') }} -{{ static_call_array('foo') }} ---DATA-- -return ['foo' => 'foo'] ---EXPECT-- -*foo* -*foo* diff --git a/vendor/twig/twig/tests/Fixtures/functions/template_from_string.test b/vendor/twig/twig/tests/Fixtures/functions/template_from_string.test deleted file mode 100644 index 33b0e40..0000000 --- a/vendor/twig/twig/tests/Fixtures/functions/template_from_string.test +++ /dev/null @@ -1,15 +0,0 @@ ---TEST-- -"template_from_string" function ---TEMPLATE-- -{% include template_from_string(template) %} - -{% include template_from_string("Hello {{ name }}") %} -{% include template_from_string('{% extends "parent.twig" %}{% block content %}Hello {{ name }}{% endblock %}') %} ---TEMPLATE(parent.twig)-- -{% block content %}{% endblock %} ---DATA-- -return ['name' => 'Fabien', 'template' => "Hello {{ name }}"] ---EXPECT-- -Hello Fabien -Hello Fabien -Hello Fabien diff --git a/vendor/twig/twig/tests/Fixtures/functions/template_from_string_error.test b/vendor/twig/twig/tests/Fixtures/functions/template_from_string_error.test deleted file mode 100644 index 900d238..0000000 --- a/vendor/twig/twig/tests/Fixtures/functions/template_from_string_error.test +++ /dev/null @@ -1,8 +0,0 @@ ---TEST-- -"template_from_string" function ---TEMPLATE-- -{% include template_from_string("{{ not a Twig template ", "foo.twig") %} ---DATA-- -return [] ---EXCEPTION-- -Twig\Error\SyntaxError: Unclosed "variable" in "foo.twig (string template 4900163d56b1af4b704c6b0afee7f98ba53418ce7a93d37a3af1882735baf9cd)" at line 1. diff --git a/vendor/twig/twig/tests/Fixtures/macros/default_values.test b/vendor/twig/twig/tests/Fixtures/macros/default_values.test deleted file mode 100644 index 18bba52..0000000 --- a/vendor/twig/twig/tests/Fixtures/macros/default_values.test +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -macro ---TEMPLATE-- -{% from _self import test %} - -{% macro test(a, b = 'bar') -%} -{{ a }}{{ b }} -{%- endmacro %} - -{{ test('foo') }} -{{ test('bar', 'foo') }} ---DATA-- -return [] ---EXPECT-- -foobar -barfoo diff --git a/vendor/twig/twig/tests/Fixtures/macros/nested_calls.test b/vendor/twig/twig/tests/Fixtures/macros/nested_calls.test deleted file mode 100644 index 4577286..0000000 --- a/vendor/twig/twig/tests/Fixtures/macros/nested_calls.test +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -macro ---TEMPLATE-- -{% import _self as macros %} - -{% macro foo(data) %} - {{ data }} -{% endmacro %} - -{% macro bar() %} -
    -{% endmacro %} - -{{ macros.foo(macros.bar()) }} ---DATA-- -return [] ---EXPECT-- -
    diff --git a/vendor/twig/twig/tests/Fixtures/macros/reserved_variables.test b/vendor/twig/twig/tests/Fixtures/macros/reserved_variables.test deleted file mode 100644 index 05dd921..0000000 --- a/vendor/twig/twig/tests/Fixtures/macros/reserved_variables.test +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -macro ---TEMPLATE-- -{% from _self import test %} - -{% macro test(this) -%} - {{ this }} -{%- endmacro %} - -{{ test(this) }} ---DATA-- -return ['this' => 'foo'] ---EXPECT-- -foo diff --git a/vendor/twig/twig/tests/Fixtures/macros/simple.test b/vendor/twig/twig/tests/Fixtures/macros/simple.test deleted file mode 100644 index 8fc6b47..0000000 --- a/vendor/twig/twig/tests/Fixtures/macros/simple.test +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -macro ---TEMPLATE-- -{% import _self as test %} -{% from _self import test %} - -{% macro test(a, b) -%} - {{ a|default('a') }}
    - {{- b|default('b') }}
    -{%- endmacro %} - -{{ test.test() }} -{{ test() }} -{{ test.test(1, "c") }} -{{ test(1, "c") }} ---DATA-- -return [] ---EXPECT-- -a
    b
    -a
    b
    -1
    c
    -1
    c
    diff --git a/vendor/twig/twig/tests/Fixtures/macros/varargs.test b/vendor/twig/twig/tests/Fixtures/macros/varargs.test deleted file mode 100644 index dd4b5c9..0000000 --- a/vendor/twig/twig/tests/Fixtures/macros/varargs.test +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -macro with arbitrary arguments ---TEMPLATE-- -{% from _self import test1, test2 %} - -{% macro test1(var) %} - {{- var }}: {{ varargs|join(", ") }} -{% endmacro %} - -{% macro test2() %} - {{- varargs|join(", ") }} -{% endmacro %} - -{{ test1("foo", "bar", "foobar") }} -{{ test2("foo", "bar", "foobar") }} ---DATA-- -return [] ---EXPECT-- -foo: bar, foobar - -foo, bar, foobar diff --git a/vendor/twig/twig/tests/Fixtures/macros/varargs_argument.test b/vendor/twig/twig/tests/Fixtures/macros/varargs_argument.test deleted file mode 100644 index 1ad368b..0000000 --- a/vendor/twig/twig/tests/Fixtures/macros/varargs_argument.test +++ /dev/null @@ -1,7 +0,0 @@ ---TEST-- -macro with varargs argument ---TEMPLATE-- -{% macro test(varargs) %} -{% endmacro %} ---EXCEPTION-- -Twig\Error\SyntaxError: The argument "varargs" in macro "test" cannot be defined because the variable "varargs" is reserved for arbitrary arguments in "index.twig" at line 2. diff --git a/vendor/twig/twig/tests/Fixtures/macros/with_filters.test b/vendor/twig/twig/tests/Fixtures/macros/with_filters.test deleted file mode 100644 index 96064ba..0000000 --- a/vendor/twig/twig/tests/Fixtures/macros/with_filters.test +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -macro with a filter ---TEMPLATE-- -{% import _self as test %} - -{% macro test() %} - {% filter escape %}foo
    {% endfilter %} -{% endmacro %} - -{{ test.test() }} ---DATA-- -return [] ---EXPECT-- -foo<br /> diff --git a/vendor/twig/twig/tests/Fixtures/regression/block_names_unicity.test b/vendor/twig/twig/tests/Fixtures/regression/block_names_unicity.test deleted file mode 100644 index df07470..0000000 --- a/vendor/twig/twig/tests/Fixtures/regression/block_names_unicity.test +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -Block names are unique per template ---TEMPLATE-- -{% extends 'layout' %} -{% block content -%} - {% filter title -%} - second - {% endfilter %} -{% endblock %} ---TEMPLATE(layout)-- -{% filter title -%} - first -{% endfilter %} -{% block content %}{% endblock %} ---DATA-- -return [] ---EXPECT-- -First -Second diff --git a/vendor/twig/twig/tests/Fixtures/regression/combined_debug_info.test b/vendor/twig/twig/tests/Fixtures/regression/combined_debug_info.test deleted file mode 100644 index 6426d2c..0000000 --- a/vendor/twig/twig/tests/Fixtures/regression/combined_debug_info.test +++ /dev/null @@ -1,15 +0,0 @@ ---TEST-- -Exception with bad line number ---TEMPLATE-- -{% block content %} - {{ foo }} - {{ include("foo") }} -{% endblock %} -index ---TEMPLATE(foo)-- -foo -{{ foo.bar }} ---DATA-- -return ['foo' => 'foo'] ---EXCEPTION-- -Twig\Error\RuntimeError: Impossible to access an attribute ("bar") on a string variable ("foo") in "foo" at line 3. diff --git a/vendor/twig/twig/tests/Fixtures/regression/empty_token.test b/vendor/twig/twig/tests/Fixtures/regression/empty_token.test deleted file mode 100644 index 25bdc9e..0000000 --- a/vendor/twig/twig/tests/Fixtures/regression/empty_token.test +++ /dev/null @@ -1,8 +0,0 @@ ---TEST-- -Twig outputs 0 nodes correctly ---TEMPLATE-- -{{ foo }}0{{ foo }} ---DATA-- -return ['foo' => 'foo'] ---EXPECT-- -foo0foo diff --git a/vendor/twig/twig/tests/Fixtures/regression/issue_1143.test b/vendor/twig/twig/tests/Fixtures/regression/issue_1143.test deleted file mode 100644 index e2ab950..0000000 --- a/vendor/twig/twig/tests/Fixtures/regression/issue_1143.test +++ /dev/null @@ -1,23 +0,0 @@ ---TEST-- -error in twig extension ---TEMPLATE-- -{{ object.region is not null ? object.regionChoices[object.region] }} ---DATA-- -class House -{ - const REGION_S = 1; - const REGION_P = 2; - - public static $regionChoices = [self::REGION_S => 'house.region.s', self::REGION_P => 'house.region.p']; - - public function getRegionChoices() - { - return self::$regionChoices; - } -} - -$object = new House(); -$object->region = 1; -return ['object' => $object] ---EXPECT-- -house.region.s diff --git a/vendor/twig/twig/tests/Fixtures/regression/multi_word_tests.test b/vendor/twig/twig/tests/Fixtures/regression/multi_word_tests.test deleted file mode 100644 index 96ca551..0000000 --- a/vendor/twig/twig/tests/Fixtures/regression/multi_word_tests.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -Twig allows multi-word tests without a custom node class ---TEMPLATE-- -{{ 'foo' is multi word ? 'yes' : 'no' }} -{{ 'foo bar' is multi word ? 'yes' : 'no' }} ---DATA-- -return [] ---EXPECT-- -no -yes diff --git a/vendor/twig/twig/tests/Fixtures/regression/simple_xml_element.test b/vendor/twig/twig/tests/Fixtures/regression/simple_xml_element.test deleted file mode 100644 index b6e62c8..0000000 --- a/vendor/twig/twig/tests/Fixtures/regression/simple_xml_element.test +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -Twig is able to deal with SimpleXMLElement instances as variables ---CONDITION-- -version_compare(phpversion(), '5.3.0', '>=') ---TEMPLATE-- -Hello '{{ images.image.0.group }}'! -{{ images.image.0.group.attributes.myattr }} -{{ images.children().image.count() }} -{% for image in images %} - - {{ image.group }} -{% endfor %} ---DATA-- -return ['images' => new \SimpleXMLElement('foobar')] ---EXPECT-- -Hello 'foo'! -example -2 - - foo - - bar diff --git a/vendor/twig/twig/tests/Fixtures/regression/strings_like_numbers.test b/vendor/twig/twig/tests/Fixtures/regression/strings_like_numbers.test deleted file mode 100644 index 62fe884..0000000 --- a/vendor/twig/twig/tests/Fixtures/regression/strings_like_numbers.test +++ /dev/null @@ -1,8 +0,0 @@ ---TEST-- -Twig does not confuse strings with integers in getAttribute() ---TEMPLATE-- -{{ hash['2e2'] }} ---DATA-- -return ['hash' => ['2e2' => 'works']] ---EXPECT-- -works diff --git a/vendor/twig/twig/tests/Fixtures/tags/apply/basic.test b/vendor/twig/twig/tests/Fixtures/tags/apply/basic.test deleted file mode 100644 index 4848ee0..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/apply/basic.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -"apply" tag applies a filter on its children ---TEMPLATE-- -{% apply upper %} -Some text with a {{ var }} -{% endapply %} ---DATA-- -return ['var' => 'var'] ---EXPECT-- -SOME TEXT WITH A VAR diff --git a/vendor/twig/twig/tests/Fixtures/tags/apply/json_encode.test b/vendor/twig/twig/tests/Fixtures/tags/apply/json_encode.test deleted file mode 100644 index 8a590b4..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/apply/json_encode.test +++ /dev/null @@ -1,8 +0,0 @@ ---TEST-- -"apply" tag applies a filter on its children ---TEMPLATE-- -{% apply json_encode|raw %}test{% endapply %} ---DATA-- -return [] ---EXPECT-- -"test" diff --git a/vendor/twig/twig/tests/Fixtures/tags/apply/multiple.test b/vendor/twig/twig/tests/Fixtures/tags/apply/multiple.test deleted file mode 100644 index e16998a..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/apply/multiple.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -"apply" tags accept multiple chained filters ---TEMPLATE-- -{% apply lower|title %} - {{ var }} -{% endapply %} ---DATA-- -return ['var' => 'VAR'] ---EXPECT-- - Var diff --git a/vendor/twig/twig/tests/Fixtures/tags/apply/nested.test b/vendor/twig/twig/tests/Fixtures/tags/apply/nested.test deleted file mode 100644 index b64a691..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/apply/nested.test +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -"apply" tags can be nested at will ---TEMPLATE-- -{% apply lower|title %} - {{ var }} - {% apply upper %} - {{ var }} - {% endapply %} - {{ var }} -{% endapply %} ---DATA-- -return ['var' => 'var'] ---EXPECT-- - Var - Var - Var diff --git a/vendor/twig/twig/tests/Fixtures/tags/apply/scope.test b/vendor/twig/twig/tests/Fixtures/tags/apply/scope.test deleted file mode 100644 index a87ff91..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/apply/scope.test +++ /dev/null @@ -1,15 +0,0 @@ ---TEST-- -"apply" tag does not create a new scope ---TEMPLATE-- -{% set foo = 'baz' %} -{% apply spaceless %} - {% set foo = 'foo' %} - {% set bar = 'bar' %} -{% endapply %} -{{ 'foo' == foo ? 'OK ' ~ foo : 'KO' }} -{{ 'bar' == bar ? 'OK ' ~ bar : 'KO' }} ---DATA-- -return [] ---EXPECT-- -OK foo -OK bar diff --git a/vendor/twig/twig/tests/Fixtures/tags/apply/with_for_tag.test b/vendor/twig/twig/tests/Fixtures/tags/apply/with_for_tag.test deleted file mode 100644 index 4453880..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/apply/with_for_tag.test +++ /dev/null @@ -1,13 +0,0 @@ ---TEST-- -"apply" tag applies the filter on "for" tags ---TEMPLATE-- -{% apply upper %} -{% for item in items %} -{{ item }} -{% endfor %} -{% endapply %} ---DATA-- -return ['items' => ['a', 'b']] ---EXPECT-- -A -B diff --git a/vendor/twig/twig/tests/Fixtures/tags/apply/with_if_tag.test b/vendor/twig/twig/tests/Fixtures/tags/apply/with_if_tag.test deleted file mode 100644 index ca7a592..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/apply/with_if_tag.test +++ /dev/null @@ -1,29 +0,0 @@ ---TEST-- -"apply" tag applies the filter on "if" tags ---TEMPLATE-- -{% apply upper %} -{% if items %} -{{ items|join(', ') }} -{% endif %} - -{% if items.3 is defined %} -FOO -{% else %} -{{ items.1 }} -{% endif %} - -{% if items.3 is defined %} -FOO -{% elseif items.1 %} -{{ items.0 }} -{% endif %} - -{% endapply %} ---DATA-- -return ['items' => ['a', 'b']] ---EXPECT-- -A, B - -B - -A diff --git a/vendor/twig/twig/tests/Fixtures/tags/autoescape/basic.test b/vendor/twig/twig/tests/Fixtures/tags/autoescape/basic.test deleted file mode 100644 index 5979725..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/autoescape/basic.test +++ /dev/null @@ -1,26 +0,0 @@ ---TEST-- -"autoescape" tag applies escaping on its children ---TEMPLATE-- -{% autoescape %} -{{ var }}
    -{% endautoescape %} -{% autoescape 'html' %} -{{ var }}
    -{% endautoescape %} -{% autoescape false %} -{{ var }}
    -{% endautoescape %} -{% autoescape true %} -{{ var }}
    -{% endautoescape %} -{% autoescape false %} -{{ var }}
    -{% endautoescape %} ---DATA-- -return ['var' => '
    '] ---EXPECT-- -<br />
    -<br />
    -

    -<br />
    -

    diff --git a/vendor/twig/twig/tests/Fixtures/tags/autoescape/blocks.test b/vendor/twig/twig/tests/Fixtures/tags/autoescape/blocks.test deleted file mode 100644 index 292e1b4..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/autoescape/blocks.test +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -"autoescape" tag applies escaping on embedded blocks ---TEMPLATE-- -{% autoescape 'html' %} - {% block foo %} - {{ var }} - {% endblock %} -{% endautoescape %} ---DATA-- -return ['var' => '
    '] ---EXPECT-- -<br /> diff --git a/vendor/twig/twig/tests/Fixtures/tags/autoescape/double_escaping.test b/vendor/twig/twig/tests/Fixtures/tags/autoescape/double_escaping.test deleted file mode 100644 index 1724b48..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/autoescape/double_escaping.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -"autoescape" tag does not double-escape ---TEMPLATE-- -{% autoescape 'html' %} -{{ var|escape }} -{% endautoescape %} ---DATA-- -return ['var' => '
    '] ---EXPECT-- -<br /> diff --git a/vendor/twig/twig/tests/Fixtures/tags/autoescape/functions.test b/vendor/twig/twig/tests/Fixtures/tags/autoescape/functions.test deleted file mode 100644 index 170e707..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/autoescape/functions.test +++ /dev/null @@ -1,83 +0,0 @@ ---TEST-- -"autoescape" tag applies escaping after calling functions ---TEMPLATE-- - -autoescape false -{% autoescape false %} - -safe_br -{{ safe_br() }} - -unsafe_br -{{ unsafe_br() }} - -{% endautoescape %} - -autoescape 'html' -{% autoescape 'html' %} - -safe_br -{{ safe_br() }} - -unsafe_br -{{ unsafe_br() }} - -unsafe_br()|raw -{{ (unsafe_br())|raw }} - -safe_br()|escape -{{ (safe_br())|escape }} - -safe_br()|raw -{{ (safe_br())|raw }} - -unsafe_br()|escape -{{ (unsafe_br())|escape }} - -{% endautoescape %} - -autoescape js -{% autoescape 'js' %} - -safe_br -{{ safe_br() }} - -{% endautoescape %} ---DATA-- -return [] ---EXPECT-- - -autoescape false - -safe_br -
    - -unsafe_br -
    - - -autoescape 'html' - -safe_br -
    - -unsafe_br -<br /> - -unsafe_br()|raw -
    - -safe_br()|escape -<br /> - -safe_br()|raw -
    - -unsafe_br()|escape -<br /> - - -autoescape js - -safe_br -\u003Cbr\u0020\/\u003E diff --git a/vendor/twig/twig/tests/Fixtures/tags/autoescape/literal.test b/vendor/twig/twig/tests/Fixtures/tags/autoescape/literal.test deleted file mode 100644 index 3d8d4f8..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/autoescape/literal.test +++ /dev/null @@ -1,87 +0,0 @@ ---TEST-- -"autoescape" tag does not apply escaping on literals ---TEMPLATE-- -{% autoescape 'html' %} - -1. Simple literal -{{ "
    " }} - -2. Conditional expression with only literals -{{ true ? "
    " : "
    " }} - -3. Conditional expression with a variable -{{ true ? "
    " : someVar }} -{{ false ? "
    " : someVar }} -{{ true ? someVar : "
    " }} -{{ false ? someVar : "
    " }} - -4. Nested conditionals with only literals -{{ true ? (true ? "
    " : "
    ") : "\n" }} - -5. Nested conditionals with a variable -{{ true ? (true ? "
    " : someVar) : "\n" }} -{{ true ? (false ? "
    " : someVar) : "\n" }} -{{ true ? (true ? someVar : "
    ") : "\n" }} -{{ true ? (false ? someVar : "
    ") : "\n" }} -{{ false ? "\n" : (true ? someVar : "
    ") }} -{{ false ? "\n" : (false ? someVar : "
    ") }} - -6. Nested conditionals with a variable marked safe -{{ true ? (true ? "
    " : someVar|raw) : "\n" }} -{{ true ? (false ? "
    " : someVar|raw) : "\n" }} -{{ true ? (true ? someVar|raw : "
    ") : "\n" }} -{{ true ? (false ? someVar|raw : "
    ") : "\n" }} -{{ false ? "\n" : (true ? someVar|raw : "
    ") }} -{{ false ? "\n" : (false ? someVar|raw : "
    ") }} - -7. Without then clause -{{ "
    " ?: someVar }} -{{ someFalseVar ?: "
    " }} - -8. NullCoalesce -{{ aaaa ?? "
    " }} -{{ "
    " ?? someVar }} - -{% endautoescape %} ---DATA-- -return ['someVar' => '
    ', 'someFalseVar' => false] ---EXPECT-- - -1. Simple literal -
    - -2. Conditional expression with only literals -
    - -3. Conditional expression with a variable -
    -<br /> -<br /> -
    - -4. Nested conditionals with only literals -
    - -5. Nested conditionals with a variable -
    -<br /> -<br /> -
    -<br /> -
    - -6. Nested conditionals with a variable marked safe -
    -
    -
    -
    -
    -
    - -7. Without then clause -
    -
    - -8. NullCoalesce -
    -
    diff --git a/vendor/twig/twig/tests/Fixtures/tags/autoescape/nested.test b/vendor/twig/twig/tests/Fixtures/tags/autoescape/nested.test deleted file mode 100644 index 0d88c7e..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/autoescape/nested.test +++ /dev/null @@ -1,26 +0,0 @@ ---TEST-- -"autoescape" tags can be nested at will ---TEMPLATE-- -{{ var }} -{% autoescape 'html' %} - {{ var }} - {% autoescape false %} - {{ var }} - {% autoescape 'html' %} - {{ var }} - {% endautoescape %} - {{ var }} - {% endautoescape %} - {{ var }} -{% endautoescape %} -{{ var }} ---DATA-- -return ['var' => '
    '] ---EXPECT-- -<br /> - <br /> -
    - <br /> -
    - <br /> -<br /> diff --git a/vendor/twig/twig/tests/Fixtures/tags/autoescape/objects.test b/vendor/twig/twig/tests/Fixtures/tags/autoescape/objects.test deleted file mode 100644 index 9d959b2..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/autoescape/objects.test +++ /dev/null @@ -1,26 +0,0 @@ ---TEST-- -"autoescape" tag applies escaping to object method calls ---TEMPLATE-- -{% autoescape 'html' %} -{{ user.name }} -{{ user.name|lower }} -{{ user }} -{% endautoescape %} ---DATA-- -class UserForAutoEscapeTest -{ - public function getName() - { - return 'Fabien
    '; - } - - public function __toString() - { - return 'Fabien
    '; - } -} -return ['user' => new UserForAutoEscapeTest()] ---EXPECT-- -Fabien<br /> -fabien<br /> -Fabien<br /> diff --git a/vendor/twig/twig/tests/Fixtures/tags/autoescape/raw.test b/vendor/twig/twig/tests/Fixtures/tags/autoescape/raw.test deleted file mode 100644 index 187327c..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/autoescape/raw.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -"autoescape" tag does not escape when raw is used as a filter ---TEMPLATE-- -{% autoescape 'html' %} -{{ var|raw }} -{% endautoescape %} ---DATA-- -return ['var' => '
    '] ---EXPECT-- -
    diff --git a/vendor/twig/twig/tests/Fixtures/tags/autoescape/strategy.legacy.test b/vendor/twig/twig/tests/Fixtures/tags/autoescape/strategy.legacy.test deleted file mode 100644 index 289f2b1..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/autoescape/strategy.legacy.test +++ /dev/null @@ -1,11 +0,0 @@ ---TEST-- -"autoescape" tag accepts an escaping strategy ---TEMPLATE-- -{% autoescape true js %}{{ var }}{% endautoescape %} - -{% autoescape true html %}{{ var }}{% endautoescape %} ---DATA-- -return ['var' => '
    "'] ---EXPECT-- -\u003Cbr\u0020\/\u003E\u0022 -<br />" diff --git a/vendor/twig/twig/tests/Fixtures/tags/autoescape/strategy.test b/vendor/twig/twig/tests/Fixtures/tags/autoescape/strategy.test deleted file mode 100644 index 9a0137e..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/autoescape/strategy.test +++ /dev/null @@ -1,11 +0,0 @@ ---TEST-- -"autoescape" tag accepts an escaping strategy ---TEMPLATE-- -{% autoescape 'js' %}{{ var }}{% endautoescape %} - -{% autoescape 'html' %}{{ var }}{% endautoescape %} ---DATA-- -return ['var' => '
    "'] ---EXPECT-- -\u003Cbr\u0020\/\u003E\u0022 -<br />" diff --git a/vendor/twig/twig/tests/Fixtures/tags/autoescape/type.test b/vendor/twig/twig/tests/Fixtures/tags/autoescape/type.test deleted file mode 100644 index 9ae8d7b..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/autoescape/type.test +++ /dev/null @@ -1,69 +0,0 @@ ---TEST-- -escape types ---TEMPLATE-- - -1. autoescape 'html' |escape('js') - -{% autoescape 'html' %} - -{% endautoescape %} - -2. autoescape 'html' |escape('js') - -{% autoescape 'html' %} - -{% endautoescape %} - -3. autoescape 'js' |escape('js') - -{% autoescape 'js' %} - -{% endautoescape %} - -4. no escape - -{% autoescape false %} - -{% endautoescape %} - -5. |escape('js')|escape('html') - -{% autoescape false %} - -{% endautoescape %} - -6. autoescape 'html' |escape('js')|escape('html') - -{% autoescape 'html' %} - -{% endautoescape %} - ---DATA-- -return ['msg' => "<>\n'\""] ---EXPECT-- - -1. autoescape 'html' |escape('js') - - - -2. autoescape 'html' |escape('js') - - - -3. autoescape 'js' |escape('js') - - - -4. no escape - - - -5. |escape('js')|escape('html') - - - -6. autoescape 'html' |escape('js')|escape('html') - - - diff --git a/vendor/twig/twig/tests/Fixtures/tags/autoescape/with_filters.test b/vendor/twig/twig/tests/Fixtures/tags/autoescape/with_filters.test deleted file mode 100644 index f97105b..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/autoescape/with_filters.test +++ /dev/null @@ -1,131 +0,0 @@ ---TEST-- -"autoescape" tag applies escaping after calling filters ---TEMPLATE-- -{% autoescape 'html' %} - -(escape_and_nl2br is an escaper filter) - -1. Don't escape escaper filter output -( var is escaped by |escape_and_nl2br, line-breaks are added, - the output is not escaped ) -{{ var|escape_and_nl2br }} - -2. Don't escape escaper filter output -( var is escaped by |escape_and_nl2br, line-breaks are added, - the output is not escaped, |raw is redundant ) -{{ var|escape_and_nl2br|raw }} - -3. Explicit escape -( var is escaped by |escape_and_nl2br, line-breaks are added, - the output is explicitly escaped by |escape ) -{{ var|escape_and_nl2br|escape }} - -4. Escape non-escaper filter output -( var is upper-cased by |upper, - the output is auto-escaped ) -{{ var|upper }} - -5. Escape if last filter is not an escaper -( var is escaped by |escape_and_nl2br, line-breaks are added, - the output is upper-cased by |upper, - the output is auto-escaped as |upper is not an escaper ) -{{ var|escape_and_nl2br|upper }} - -6. Don't escape escaper filter output -( var is upper cased by upper, - the output is escaped by |escape_and_nl2br, line-breaks are added, - the output is not escaped as |escape_and_nl2br is an escaper ) -{{ var|upper|escape_and_nl2br }} - -7. Escape if last filter is not an escaper -( the output of |format is "" ~ var ~ "", - the output is auto-escaped ) -{{ "%s"|format(var) }} - -8. Escape if last filter is not an escaper -( the output of |format is "" ~ var ~ "", - |raw is redundant, - the output is auto-escaped ) -{{ "%s"|raw|format(var) }} - -9. Don't escape escaper filter output -( the output of |format is "" ~ var ~ "", - the output is not escaped due to |raw filter at the end ) -{{ "%s"|format(var)|raw }} - -10. Don't escape escaper filter output -( the output of |format is "" ~ var ~ "", - the output is not escaped due to |raw filter at the end, - the |raw filter on var is redundant ) -{{ "%s"|format(var|raw)|raw }} - -{% endautoescape %} ---DATA-- -return ['var' => "\nTwig"] ---EXPECT-- - -(escape_and_nl2br is an escaper filter) - -1. Don't escape escaper filter output -( var is escaped by |escape_and_nl2br, line-breaks are added, - the output is not escaped ) -<Fabien>
    -Twig - -2. Don't escape escaper filter output -( var is escaped by |escape_and_nl2br, line-breaks are added, - the output is not escaped, |raw is redundant ) -<Fabien>
    -Twig - -3. Explicit escape -( var is escaped by |escape_and_nl2br, line-breaks are added, - the output is explicitly escaped by |escape ) -&lt;Fabien&gt;<br /> -Twig - -4. Escape non-escaper filter output -( var is upper-cased by |upper, - the output is auto-escaped ) -<FABIEN> -TWIG - -5. Escape if last filter is not an escaper -( var is escaped by |escape_and_nl2br, line-breaks are added, - the output is upper-cased by |upper, - the output is auto-escaped as |upper is not an escaper ) -&LT;FABIEN&GT;<BR /> -TWIG - -6. Don't escape escaper filter output -( var is upper cased by upper, - the output is escaped by |escape_and_nl2br, line-breaks are added, - the output is not escaped as |escape_and_nl2br is an escaper ) -<FABIEN>
    -TWIG - -7. Escape if last filter is not an escaper -( the output of |format is "" ~ var ~ "", - the output is auto-escaped ) -<b><Fabien> -Twig</b> - -8. Escape if last filter is not an escaper -( the output of |format is "" ~ var ~ "", - |raw is redundant, - the output is auto-escaped ) -<b><Fabien> -Twig</b> - -9. Don't escape escaper filter output -( the output of |format is "" ~ var ~ "", - the output is not escaped due to |raw filter at the end ) - -Twig - -10. Don't escape escaper filter output -( the output of |format is "" ~ var ~ "", - the output is not escaped due to |raw filter at the end, - the |raw filter on var is redundant ) - -Twig diff --git a/vendor/twig/twig/tests/Fixtures/tags/autoescape/with_filters_arguments.test b/vendor/twig/twig/tests/Fixtures/tags/autoescape/with_filters_arguments.test deleted file mode 100644 index 50f72d8..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/autoescape/with_filters_arguments.test +++ /dev/null @@ -1,23 +0,0 @@ ---TEST-- -"autoescape" tag do not applies escaping on filter arguments ---TEMPLATE-- -{% autoescape 'html' %} -{{ var|nl2br("
    ") }} -{{ var|nl2br("
    "|escape) }} -{{ var|nl2br(sep) }} -{{ var|nl2br(sep|raw) }} -{{ var|nl2br(sep|escape) }} -{% endautoescape %} ---DATA-- -return ['var' => "\nTwig", 'sep' => '
    '] ---EXPECT-- -<Fabien>
    -Twig -<Fabien><br /> -Twig -<Fabien>
    -Twig -<Fabien>
    -Twig -<Fabien><br /> -Twig diff --git a/vendor/twig/twig/tests/Fixtures/tags/autoescape/with_pre_escape_filters.test b/vendor/twig/twig/tests/Fixtures/tags/autoescape/with_pre_escape_filters.test deleted file mode 100644 index c9c7380..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/autoescape/with_pre_escape_filters.test +++ /dev/null @@ -1,68 +0,0 @@ ---TEST-- -"autoescape" tag applies escaping after calling filters, and before calling pre_escape filters ---TEMPLATE-- -{% autoescape 'html' %} - -(nl2br is pre_escaped for "html" and declared safe for "html") - -1. Pre-escape and don't post-escape -( var|escape|nl2br ) -{{ var|nl2br }} - -2. Don't double-pre-escape -( var|escape|nl2br ) -{{ var|escape|nl2br }} - -3. Don't escape safe values -( var|raw|nl2br ) -{{ var|raw|nl2br }} - -4. Don't escape safe values -( var|escape|nl2br|nl2br ) -{{ var|nl2br|nl2br }} - -5. Re-escape values that are escaped for an other contexts -( var|escape_something|escape|nl2br ) -{{ var|escape_something|nl2br }} - -6. Still escape when using filters not declared safe -( var|escape|nl2br|upper|escape ) -{{ var|nl2br|upper }} - -{% endautoescape %} ---DATA-- -return ['var' => "\nTwig"] ---EXPECT-- - -(nl2br is pre_escaped for "html" and declared safe for "html") - -1. Pre-escape and don't post-escape -( var|escape|nl2br ) -<Fabien>
    -Twig - -2. Don't double-pre-escape -( var|escape|nl2br ) -<Fabien>
    -Twig - -3. Don't escape safe values -( var|raw|nl2br ) -
    -Twig - -4. Don't escape safe values -( var|escape|nl2br|nl2br ) -<Fabien>

    -Twig - -5. Re-escape values that are escaped for an other contexts -( var|escape_something|escape|nl2br ) -<FABIEN>
    -TWIG - -6. Still escape when using filters not declared safe -( var|escape|nl2br|upper|escape ) -&LT;FABIEN&GT;<BR /> -TWIG - diff --git a/vendor/twig/twig/tests/Fixtures/tags/autoescape/with_preserves_safety_filters.test b/vendor/twig/twig/tests/Fixtures/tags/autoescape/with_preserves_safety_filters.test deleted file mode 100644 index c764d43..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/autoescape/with_preserves_safety_filters.test +++ /dev/null @@ -1,50 +0,0 @@ ---TEST-- -"autoescape" tag handles filters preserving the safety ---TEMPLATE-- -{% autoescape 'html' %} - -(preserves_safety is preserving safety for "html") - -1. Unsafe values are still unsafe -( var|preserves_safety|escape ) -{{ var|preserves_safety }} - -2. Safe values are still safe -( var|escape|preserves_safety ) -{{ var|escape|preserves_safety }} - -3. Re-escape values that are escaped for an other contexts -( var|escape_something|preserves_safety|escape ) -{{ var|escape_something|preserves_safety }} - -4. Still escape when using filters not declared safe -( var|escape|preserves_safety|replace({'FABIEN': 'FABPOT'})|escape ) -{{ var|escape|preserves_safety|replace({'FABIEN': 'FABPOT'}) }} - -{% endautoescape %} ---DATA-- -return ['var' => "\nTwig"] ---EXPECT-- - -(preserves_safety is preserving safety for "html") - -1. Unsafe values are still unsafe -( var|preserves_safety|escape ) -<FABIEN> -TWIG - -2. Safe values are still safe -( var|escape|preserves_safety ) -<FABIEN> -TWIG - -3. Re-escape values that are escaped for an other contexts -( var|escape_something|preserves_safety|escape ) -<FABIEN> -TWIG - -4. Still escape when using filters not declared safe -( var|escape|preserves_safety|replace({'FABIEN': 'FABPOT'})|escape ) -&LT;FABPOT&GT; -TWIG - diff --git a/vendor/twig/twig/tests/Fixtures/tags/block/basic.test b/vendor/twig/twig/tests/Fixtures/tags/block/basic.test deleted file mode 100644 index 988b09c..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/block/basic.test +++ /dev/null @@ -1,11 +0,0 @@ ---TEST-- -"block" tag ---TEMPLATE-- -{% block title1 %}FOO{% endblock %} -{% block title2 foo|lower %} ---TEMPLATE(foo.twig)-- -{% block content %}{% endblock %} ---DATA-- -return ['foo' => 'bar'] ---EXPECT-- -FOObar diff --git a/vendor/twig/twig/tests/Fixtures/tags/block/block_unique_name.test b/vendor/twig/twig/tests/Fixtures/tags/block/block_unique_name.test deleted file mode 100644 index 3009f8b..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/block/block_unique_name.test +++ /dev/null @@ -1,11 +0,0 @@ ---TEST-- -"block" tag ---TEMPLATE-- -{% block content %} - {% block content %} - {% endblock %} -{% endblock %} ---DATA-- -return [] ---EXCEPTION-- -Twig\Error\SyntaxError: The block 'content' has already been defined line 2 in "index.twig" at line 3. diff --git a/vendor/twig/twig/tests/Fixtures/tags/block/special_chars.test b/vendor/twig/twig/tests/Fixtures/tags/block/special_chars.test deleted file mode 100644 index e8e240e..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/block/special_chars.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -"§" special chars in a block name ---TEMPLATE-- -{% block § %} -§ -{% endblock § %} ---DATA-- -return [] ---EXPECT-- -§ diff --git a/vendor/twig/twig/tests/Fixtures/tags/deprecated/block.legacy.test b/vendor/twig/twig/tests/Fixtures/tags/deprecated/block.legacy.test deleted file mode 100644 index 53729dd..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/deprecated/block.legacy.test +++ /dev/null @@ -1,20 +0,0 @@ ---TEST-- -Deprecating a block with "deprecated" tag ---TEMPLATE-- -{% use 'greeting.twig' %} - -{{ block('welcome') }} - ---TEMPLATE(greeting.twig)-- -{% block welcome %} - {% deprecated 'The "welcome" block is deprecated, use "hello" instead.' %} - {{ block('hello') }} -{% endblock %} - -{% block hello %} -Hello Fabien -{% endblock %} ---DATA-- -return [] ---EXPECT-- - Hello Fabien diff --git a/vendor/twig/twig/tests/Fixtures/tags/deprecated/macro.legacy.test b/vendor/twig/twig/tests/Fixtures/tags/deprecated/macro.legacy.test deleted file mode 100644 index 5cc48dd..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/deprecated/macro.legacy.test +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -Deprecating a macro with "deprecated" tag ---TEMPLATE-- -{% import 'greeting.twig' as greeting %} - -{{ greeting.welcome('Fabien') }} - ---TEMPLATE(greeting.twig)-- -{% macro welcome(name) %} - {% deprecated 'The "welcome" macro is deprecated, use "hello" instead.' %} - {% import _self as self %} - {{ self.hello(name) }} -{% endmacro %} - -{% macro hello(name) %} -Hello {{ name }} -{% endmacro %} ---DATA-- -return [] ---EXPECT-- - Hello Fabien diff --git a/vendor/twig/twig/tests/Fixtures/tags/deprecated/template.legacy.test b/vendor/twig/twig/tests/Fixtures/tags/deprecated/template.legacy.test deleted file mode 100644 index 7f786d5..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/deprecated/template.legacy.test +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -Deprecating a template with "deprecated" tag ---TEMPLATE-- -{% extends 'greeting.twig' %} - -{% deprecated 'The "index.twig" template is deprecated, use "greeting.twig" instead.' %} ---TEMPLATE(greeting.twig)-- -Hello Fabien ---DATA-- -return [] ---EXPECT-- -Hello Fabien diff --git a/vendor/twig/twig/tests/Fixtures/tags/embed/basic.test b/vendor/twig/twig/tests/Fixtures/tags/embed/basic.test deleted file mode 100644 index 16781e4..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/embed/basic.test +++ /dev/null @@ -1,35 +0,0 @@ ---TEST-- -"embed" tag ---TEMPLATE-- -FOO -{% embed "foo.twig" %} - {% block c1 %} - {{ parent() }} - block1extended - {% endblock %} -{% endembed %} - -BAR ---TEMPLATE(foo.twig)-- -A -{% block c1 %} - block1 -{% endblock %} -B -{% block c2 %} - block2 -{% endblock %} -C ---DATA-- -return [] ---EXPECT-- -FOO - -A - block1 - - block1extended - B - block2 -C -BAR diff --git a/vendor/twig/twig/tests/Fixtures/tags/embed/complex_dynamic_parent.test b/vendor/twig/twig/tests/Fixtures/tags/embed/complex_dynamic_parent.test deleted file mode 100644 index b799a8c..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/embed/complex_dynamic_parent.test +++ /dev/null @@ -1,35 +0,0 @@ ---TEST-- -"embed" tag ---TEMPLATE-- -FOO -{% embed foo ~ ".twig" %} - {% block c1 %} - {{ parent() }} - block1extended - {% endblock %} -{% endembed %} - -BAR ---TEMPLATE(foo.twig)-- -A -{% block c1 %} - block1 -{% endblock %} -B -{% block c2 %} - block2 -{% endblock %} -C ---DATA-- -return ['foo' => 'foo'] ---EXPECT-- -FOO - -A - block1 - - block1extended - B - block2 -C -BAR diff --git a/vendor/twig/twig/tests/Fixtures/tags/embed/dynamic_parent.test b/vendor/twig/twig/tests/Fixtures/tags/embed/dynamic_parent.test deleted file mode 100644 index 6f0879e..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/embed/dynamic_parent.test +++ /dev/null @@ -1,35 +0,0 @@ ---TEST-- -"embed" tag ---TEMPLATE-- -FOO -{% embed foo %} - {% block c1 %} - {{ parent() }} - block1extended - {% endblock %} -{% endembed %} - -BAR ---TEMPLATE(foo.twig)-- -A -{% block c1 %} - block1 -{% endblock %} -B -{% block c2 %} - block2 -{% endblock %} -C ---DATA-- -return ['foo' => 'foo.twig'] ---EXPECT-- -FOO - -A - block1 - - block1extended - B - block2 -C -BAR diff --git a/vendor/twig/twig/tests/Fixtures/tags/embed/error_line.test b/vendor/twig/twig/tests/Fixtures/tags/embed/error_line.test deleted file mode 100644 index b1c6c85..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/embed/error_line.test +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -"embed" tag ---TEMPLATE(index.twig)-- -FOO -{% embed "foo.twig" %} - {% block c1 %} - {{ nothing }} - {% endblock %} -{% endembed %} -BAR ---TEMPLATE(foo.twig)-- -{% block c1 %}{% endblock %} ---DATA-- -return [] ---EXCEPTION-- -Twig\Error\RuntimeError: Variable "nothing" does not exist in "index.twig" at line 5. diff --git a/vendor/twig/twig/tests/Fixtures/tags/embed/multiple.test b/vendor/twig/twig/tests/Fixtures/tags/embed/multiple.test deleted file mode 100644 index 9f7b52f..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/embed/multiple.test +++ /dev/null @@ -1,50 +0,0 @@ ---TEST-- -"embed" tag ---TEMPLATE-- -FOO -{% embed "foo.twig" %} - {% block c1 %} - {{ parent() }} - block1extended - {% endblock %} -{% endembed %} - -{% embed "foo.twig" %} - {% block c1 %} - {{ parent() }} - block1extended - {% endblock %} -{% endembed %} - -BAR ---TEMPLATE(foo.twig)-- -A -{% block c1 %} - block1 -{% endblock %} -B -{% block c2 %} - block2 -{% endblock %} -C ---DATA-- -return [] ---EXPECT-- -FOO - -A - block1 - - block1extended - B - block2 -C - -A - block1 - - block1extended - B - block2 -C -BAR diff --git a/vendor/twig/twig/tests/Fixtures/tags/embed/nested.test b/vendor/twig/twig/tests/Fixtures/tags/embed/nested.test deleted file mode 100644 index 9f33723..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/embed/nested.test +++ /dev/null @@ -1,42 +0,0 @@ ---TEST-- -"embed" tag ---TEMPLATE-- -{% embed "foo.twig" %} - {% block c1 %} - {{ parent() }} - {% embed "foo.twig" %} - {% block c1 %} - {{ parent() }} - block1extended - {% endblock %} - {% endembed %} - - {% endblock %} -{% endembed %} ---TEMPLATE(foo.twig)-- -A -{% block c1 %} - block1 -{% endblock %} -B -{% block c2 %} - block2 -{% endblock %} -C ---DATA-- -return [] ---EXPECT-- -A - block1 - - -A - block1 - - block1extended - B - block2 -C - B - block2 -C diff --git a/vendor/twig/twig/tests/Fixtures/tags/embed/with_extends.test b/vendor/twig/twig/tests/Fixtures/tags/embed/with_extends.test deleted file mode 100644 index ce726ac..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/embed/with_extends.test +++ /dev/null @@ -1,60 +0,0 @@ ---TEST-- -"embed" tag ---TEMPLATE-- -{% extends "base.twig" %} - -{% block c1 %} - {{ parent() }} - blockc1baseextended -{% endblock %} - -{% block c2 %} - {{ parent() }} - - {% embed "foo.twig" %} - {% block c1 %} - {{ parent() }} - block1extended - {% endblock %} - {% endembed %} - {{ parent() }} -{% endblock %} ---TEMPLATE(base.twig)-- -A -{% block c1 %} - blockc1base -{% endblock %} -{% block c2 %} - blockc2base -{% endblock %} -B ---TEMPLATE(foo.twig)-- -A -{% block c1 %} - block1 -{% endblock %} -B -{% block c2 %} - block2 -{% endblock %} -C ---DATA-- -return [] ---EXPECT-- -A - blockc1base - - blockc1baseextended - blockc2base - - - -A - block1 - - block1extended - B - block2 -C blockc2base - -B \ No newline at end of file diff --git a/vendor/twig/twig/tests/Fixtures/tags/filter/basic.test b/vendor/twig/twig/tests/Fixtures/tags/filter/basic.test deleted file mode 100644 index 866171e..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/filter/basic.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -"filter" tag applies a filter on its children ---TEMPLATE-- -{% filter upper %} -Some text with a {{ var }} -{% endfilter %} ---DATA-- -return ['var' => 'var'] ---EXPECT-- -SOME TEXT WITH A VAR diff --git a/vendor/twig/twig/tests/Fixtures/tags/filter/json_encode.test b/vendor/twig/twig/tests/Fixtures/tags/filter/json_encode.test deleted file mode 100644 index a2562b9..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/filter/json_encode.test +++ /dev/null @@ -1,8 +0,0 @@ ---TEST-- -"filter" tag applies a filter on its children ---TEMPLATE-- -{% filter json_encode|raw %}test{% endfilter %} ---DATA-- -return [] ---EXPECT-- -"test" diff --git a/vendor/twig/twig/tests/Fixtures/tags/filter/multiple.test b/vendor/twig/twig/tests/Fixtures/tags/filter/multiple.test deleted file mode 100644 index 8eb3cbd..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/filter/multiple.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -"filter" tags accept multiple chained filters ---TEMPLATE-- -{% filter lower|title %} - {{ var }} -{% endfilter %} ---DATA-- -return ['var' => 'VAR'] ---EXPECT-- - Var diff --git a/vendor/twig/twig/tests/Fixtures/tags/filter/nested.test b/vendor/twig/twig/tests/Fixtures/tags/filter/nested.test deleted file mode 100644 index 6d18e1a..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/filter/nested.test +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -"filter" tags can be nested at will ---TEMPLATE-- -{% filter lower|title %} - {{ var }} - {% filter upper %} - {{ var }} - {% endfilter %} - {{ var }} -{% endfilter %} ---DATA-- -return ['var' => 'var'] ---EXPECT-- - Var - Var - Var diff --git a/vendor/twig/twig/tests/Fixtures/tags/filter/scope.test b/vendor/twig/twig/tests/Fixtures/tags/filter/scope.test deleted file mode 100644 index 889a46f..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/filter/scope.test +++ /dev/null @@ -1,11 +0,0 @@ ---TEST-- -"scope" tag creates a new scope ---TEMPLATE-- -{% filter spaceless %} -{% set item = 'foo' %} -{% endfilter %} -{{ item }} ---DATA-- -return [] ---EXCEPTION-- -Twig\Error\RuntimeError: Variable "item" does not exist in "index.twig" at line 5. diff --git a/vendor/twig/twig/tests/Fixtures/tags/filter/with_for_tag.test b/vendor/twig/twig/tests/Fixtures/tags/filter/with_for_tag.test deleted file mode 100644 index d2d87cf..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/filter/with_for_tag.test +++ /dev/null @@ -1,13 +0,0 @@ ---TEST-- -"filter" tag applies the filter on "for" tags ---TEMPLATE-- -{% filter upper %} -{% for item in items %} -{{ item }} -{% endfor %} -{% endfilter %} ---DATA-- -return ['items' => ['a', 'b']] ---EXPECT-- -A -B diff --git a/vendor/twig/twig/tests/Fixtures/tags/filter/with_if_tag.test b/vendor/twig/twig/tests/Fixtures/tags/filter/with_if_tag.test deleted file mode 100644 index f2e804b..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/filter/with_if_tag.test +++ /dev/null @@ -1,29 +0,0 @@ ---TEST-- -"filter" tag applies the filter on "if" tags ---TEMPLATE-- -{% filter upper %} -{% if items %} -{{ items|join(', ') }} -{% endif %} - -{% if items.3 is defined %} -FOO -{% else %} -{{ items.1 }} -{% endif %} - -{% if items.3 is defined %} -FOO -{% elseif items.1 %} -{{ items.0 }} -{% endif %} - -{% endfilter %} ---DATA-- -return ['items' => ['a', 'b']] ---EXPECT-- -A, B - -B - -A diff --git a/vendor/twig/twig/tests/Fixtures/tags/for/condition.test b/vendor/twig/twig/tests/Fixtures/tags/for/condition.test deleted file mode 100644 index b1ad22f..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/for/condition.test +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -"for" tag takes a condition ---TEMPLATE-- -{% for i in 1..5 if i is odd -%} - {{ loop.index }}.{{ i }}{{ foo.bar }} -{% endfor %} ---DATA-- -return ['foo' => ['bar' => 'X']] ---CONFIG-- -return ['strict_variables' => false] ---EXPECT-- -1.1X -2.3X -3.5X diff --git a/vendor/twig/twig/tests/Fixtures/tags/for/context.test b/vendor/twig/twig/tests/Fixtures/tags/for/context.test deleted file mode 100644 index 3cdd575..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/for/context.test +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -"for" tag keeps the context safe ---TEMPLATE-- -{% for item in items %} - {% for item in items %} - * {{ item }} - {% endfor %} - * {{ item }} -{% endfor %} ---DATA-- -return ['items' => ['a', 'b']] ---EXPECT-- - * a - * b - * a - * a - * b - * b diff --git a/vendor/twig/twig/tests/Fixtures/tags/for/else.test b/vendor/twig/twig/tests/Fixtures/tags/for/else.test deleted file mode 100644 index 86ec9c2..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/for/else.test +++ /dev/null @@ -1,23 +0,0 @@ ---TEST-- -"for" tag can use an "else" clause ---TEMPLATE-- -{% for item in items %} - * {{ item }} -{% else %} - no item -{% endfor %} ---DATA-- -return ['items' => ['a', 'b']] ---EXPECT-- - * a - * b ---DATA-- -return ['items' => []] ---EXPECT-- - no item ---DATA-- -return [] ---CONFIG-- -return ['strict_variables' => false] ---EXPECT-- - no item diff --git a/vendor/twig/twig/tests/Fixtures/tags/for/inner_variables.test b/vendor/twig/twig/tests/Fixtures/tags/for/inner_variables.test deleted file mode 100644 index e1ad3c7..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/for/inner_variables.test +++ /dev/null @@ -1,17 +0,0 @@ ---TEST-- -"for" tag does not reset inner variables ---TEMPLATE-- -{% for i in 1..2 %} - {% for j in 0..2 %} - {{k}}{% set k = k+1 %} {{ loop.parent.loop.index }} - {% endfor %} -{% endfor %} ---DATA-- -return ['k' => 0] ---EXPECT-- - 0 1 - 1 1 - 2 1 - 3 2 - 4 2 - 5 2 diff --git a/vendor/twig/twig/tests/Fixtures/tags/for/keys.test b/vendor/twig/twig/tests/Fixtures/tags/for/keys.test deleted file mode 100644 index 9213557..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/for/keys.test +++ /dev/null @@ -1,11 +0,0 @@ ---TEST-- -"for" tag can iterate over keys ---TEMPLATE-- -{% for key in items|keys %} - * {{ key }} -{% endfor %} ---DATA-- -return ['items' => ['a', 'b']] ---EXPECT-- - * 0 - * 1 diff --git a/vendor/twig/twig/tests/Fixtures/tags/for/keys_and_values.test b/vendor/twig/twig/tests/Fixtures/tags/for/keys_and_values.test deleted file mode 100644 index ab39ddf..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/for/keys_and_values.test +++ /dev/null @@ -1,11 +0,0 @@ ---TEST-- -"for" tag can iterate over keys and values ---TEMPLATE-- -{% for key, item in items %} - * {{ key }}/{{ item }} -{% endfor %} ---DATA-- -return ['items' => ['a', 'b']] ---EXPECT-- - * 0/a - * 1/b diff --git a/vendor/twig/twig/tests/Fixtures/tags/for/loop_context.test b/vendor/twig/twig/tests/Fixtures/tags/for/loop_context.test deleted file mode 100644 index 56a60c2..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/for/loop_context.test +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -"for" tag adds a loop variable to the context ---TEMPLATE-- -{% for item in items %} - * {{ loop.index }}/{{ loop.index0 }} - * {{ loop.revindex }}/{{ loop.revindex0 }} - * {{ loop.first }}/{{ loop.last }}/{{ loop.length }} - -{% endfor %} ---DATA-- -return ['items' => ['a', 'b']] ---EXPECT-- - * 1/0 - * 2/1 - * 1//2 - - * 2/1 - * 1/0 - * /1/2 diff --git a/vendor/twig/twig/tests/Fixtures/tags/for/loop_context_local.test b/vendor/twig/twig/tests/Fixtures/tags/for/loop_context_local.test deleted file mode 100644 index 58e5a9b..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/for/loop_context_local.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -"for" tag adds a loop variable to the context locally ---TEMPLATE-- -{% for item in items %} -{% endfor %} -{% if loop is not defined %}WORKS{% endif %} ---DATA-- -return ['items' => []] ---EXPECT-- -WORKS diff --git a/vendor/twig/twig/tests/Fixtures/tags/for/loop_not_defined.test b/vendor/twig/twig/tests/Fixtures/tags/for/loop_not_defined.test deleted file mode 100644 index 2d8c0b8..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/for/loop_not_defined.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -"for" tag ---TEMPLATE-- -{% for i, item in items if i > 0 %} - {{ loop.last }} -{% endfor %} ---DATA-- -return ['items' => ['a', 'b']] ---EXCEPTION-- -Twig\Error\SyntaxError: The "loop.last" variable is not defined when looping with a condition in "index.twig" at line 3. diff --git a/vendor/twig/twig/tests/Fixtures/tags/for/loop_not_defined_cond.test b/vendor/twig/twig/tests/Fixtures/tags/for/loop_not_defined_cond.test deleted file mode 100644 index e90e96b..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/for/loop_not_defined_cond.test +++ /dev/null @@ -1,9 +0,0 @@ ---TEST-- -"for" tag ---TEMPLATE-- -{% for i, item in items if loop.last > 0 %} -{% endfor %} ---DATA-- -return ['items' => ['a', 'b']] ---EXCEPTION-- -Twig\Error\SyntaxError: The "loop" variable cannot be used in a looping condition in "index.twig" at line 2. diff --git a/vendor/twig/twig/tests/Fixtures/tags/for/nested_else.test b/vendor/twig/twig/tests/Fixtures/tags/for/nested_else.test deleted file mode 100644 index df1bb07..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/for/nested_else.test +++ /dev/null @@ -1,17 +0,0 @@ ---TEST-- -"for" tag can use an "else" clause ---TEMPLATE-- -{% for item in items %} - {% for item in items1 %} - * {{ item }} - {% else %} - no {{ item }} - {% endfor %} -{% else %} - no item1 -{% endfor %} ---DATA-- -return ['items' => ['a', 'b'], 'items1' => []] ---EXPECT-- -no a - no b diff --git a/vendor/twig/twig/tests/Fixtures/tags/for/objects.test b/vendor/twig/twig/tests/Fixtures/tags/for/objects.test deleted file mode 100644 index 2ba2d92..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/for/objects.test +++ /dev/null @@ -1,43 +0,0 @@ ---TEST-- -"for" tag iterates over iterable objects ---TEMPLATE-- -{% for item in items %} - * {{ item }} - * {{ loop.index }}/{{ loop.index0 }} - * {{ loop.first }} - -{% endfor %} - -{% for key, value in items %} - * {{ key }}/{{ value }} -{% endfor %} - -{% for key in items|keys %} - * {{ key }} -{% endfor %} ---DATA-- -class ItemsIterator implements Iterator -{ - protected $values = ['foo' => 'bar', 'bar' => 'foo']; - public function current() { return current($this->values); } - public function key() { return key($this->values); } - public function next() { return next($this->values); } - public function rewind() { return reset($this->values); } - public function valid() { return false !== current($this->values); } -} -return ['items' => new ItemsIterator()] ---EXPECT-- - * bar - * 1/0 - * 1 - - * foo - * 2/1 - * - - - * foo/bar - * bar/foo - - * foo - * bar diff --git a/vendor/twig/twig/tests/Fixtures/tags/for/objects_countable.test b/vendor/twig/twig/tests/Fixtures/tags/for/objects_countable.test deleted file mode 100644 index 99146bd..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/for/objects_countable.test +++ /dev/null @@ -1,47 +0,0 @@ ---TEST-- -"for" tag iterates over iterable and countable objects ---TEMPLATE-- -{% for item in items %} - * {{ item }} - * {{ loop.index }}/{{ loop.index0 }} - * {{ loop.revindex }}/{{ loop.revindex0 }} - * {{ loop.first }}/{{ loop.last }}/{{ loop.length }} - -{% endfor %} - -{% for key, value in items %} - * {{ key }}/{{ value }} -{% endfor %} - -{% for key in items|keys %} - * {{ key }} -{% endfor %} ---DATA-- -class ItemsIteratorCountable implements Iterator, \Countable -{ - protected $values = ['foo' => 'bar', 'bar' => 'foo']; - public function current() { return current($this->values); } - public function key() { return key($this->values); } - public function next() { return next($this->values); } - public function rewind() { return reset($this->values); } - public function valid() { return false !== current($this->values); } - public function count() { return count($this->values); } -} -return ['items' => new ItemsIteratorCountable()] ---EXPECT-- - * bar - * 1/0 - * 2/1 - * 1//2 - - * foo - * 2/1 - * 1/0 - * /1/2 - - - * foo/bar - * bar/foo - - * foo - * bar diff --git a/vendor/twig/twig/tests/Fixtures/tags/for/recursive.test b/vendor/twig/twig/tests/Fixtures/tags/for/recursive.test deleted file mode 100644 index 3b677d6..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/for/recursive.test +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -"for" tags can be nested ---TEMPLATE-- -{% for key, item in items %} -* {{ key }} ({{ loop.length }}): -{% for value in item %} - * {{ value }} ({{ loop.length }}) -{% endfor %} -{% endfor %} ---DATA-- -return ['items' => ['a' => ['a1', 'a2', 'a3'], 'b' => ['b1']]] ---EXPECT-- -* a (2): - * a1 (3) - * a2 (3) - * a3 (3) -* b (2): - * b1 (1) diff --git a/vendor/twig/twig/tests/Fixtures/tags/for/values.test b/vendor/twig/twig/tests/Fixtures/tags/for/values.test deleted file mode 100644 index 384c41b..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/for/values.test +++ /dev/null @@ -1,11 +0,0 @@ ---TEST-- -"for" tag iterates over item values ---TEMPLATE-- -{% for item in items %} - * {{ item }} -{% endfor %} ---DATA-- -return ['items' => ['a', 'b']] ---EXPECT-- - * a - * b diff --git a/vendor/twig/twig/tests/Fixtures/tags/from.test b/vendor/twig/twig/tests/Fixtures/tags/from.test deleted file mode 100644 index 1d3c9e2..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/from.test +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -global variables ---TEMPLATE-- -{% include "included.twig" %} -{% from "included.twig" import foobar %} -{{ foobar() }} ---TEMPLATE(included.twig)-- -{% macro foobar() %} -called foobar -{% endmacro %} ---DATA-- -return [] ---EXPECT-- -called foobar diff --git a/vendor/twig/twig/tests/Fixtures/tags/if/basic.test b/vendor/twig/twig/tests/Fixtures/tags/if/basic.test deleted file mode 100644 index a02165e..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/if/basic.test +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -"if" creates a condition ---TEMPLATE-- -{% if a is defined %} - {{ a }} -{% elseif b is defined %} - {{ b }} -{% else %} - NOTHING -{% endif %} ---DATA-- -return ['a' => 'a'] ---EXPECT-- - a ---DATA-- -return ['b' => 'b'] ---EXPECT-- - b ---DATA-- -return [] ---EXPECT-- - NOTHING diff --git a/vendor/twig/twig/tests/Fixtures/tags/if/expression.test b/vendor/twig/twig/tests/Fixtures/tags/if/expression.test deleted file mode 100644 index eb65083..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/if/expression.test +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -"if" takes an expression as a test ---TEMPLATE-- -{% if a < 2 %} - A1 -{% elseif a > 10 %} - A2 -{% else %} - A3 -{% endif %} ---DATA-- -return ['a' => 1] ---EXPECT-- - A1 ---DATA-- -return ['a' => 12] ---EXPECT-- - A2 ---DATA-- -return ['a' => 7] ---EXPECT-- - A3 diff --git a/vendor/twig/twig/tests/Fixtures/tags/include/basic.test b/vendor/twig/twig/tests/Fixtures/tags/include/basic.test deleted file mode 100644 index 9982b03..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/include/basic.test +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -"include" tag ---TEMPLATE-- -FOO -{% include "foo.twig" %} - -BAR ---TEMPLATE(foo.twig)-- -FOOBAR ---DATA-- -return [] ---EXPECT-- -FOO - -FOOBAR -BAR diff --git a/vendor/twig/twig/tests/Fixtures/tags/include/expression.test b/vendor/twig/twig/tests/Fixtures/tags/include/expression.test deleted file mode 100644 index 23db181..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/include/expression.test +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -"include" tag allows expressions for the template to include ---TEMPLATE-- -FOO -{% include foo %} - -BAR ---TEMPLATE(foo.twig)-- -FOOBAR ---DATA-- -return ['foo' => 'foo.twig'] ---EXPECT-- -FOO - -FOOBAR -BAR diff --git a/vendor/twig/twig/tests/Fixtures/tags/include/ignore_missing.test b/vendor/twig/twig/tests/Fixtures/tags/include/ignore_missing.test deleted file mode 100644 index 6c8bdb1..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/include/ignore_missing.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -"include" tag ---TEMPLATE-- -{% include ["foo.twig", "bar.twig"] ignore missing %} -{% include "foo.twig" ignore missing %} -{% include "foo.twig" ignore missing with {} %} -{% include "foo.twig" ignore missing with {} only %} ---DATA-- -return [] ---EXPECT-- diff --git a/vendor/twig/twig/tests/Fixtures/tags/include/ignore_missing_exists.test b/vendor/twig/twig/tests/Fixtures/tags/include/ignore_missing_exists.test deleted file mode 100644 index 1af0122..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/include/ignore_missing_exists.test +++ /dev/null @@ -1,11 +0,0 @@ ---TEST-- -"include" tag ---TEMPLATE-- -{% include "included.twig" ignore missing %} -NOT DISPLAYED ---TEMPLATE(included.twig)-- -{% include "DOES NOT EXIST" %} ---DATA-- -return [] ---EXCEPTION-- -Twig\Error\LoaderError: Template "DOES NOT EXIST" is not defined in "included.twig" at line 2. diff --git a/vendor/twig/twig/tests/Fixtures/tags/include/include_missing_extends.test b/vendor/twig/twig/tests/Fixtures/tags/include/include_missing_extends.test deleted file mode 100644 index d0d1bfe..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/include/include_missing_extends.test +++ /dev/null @@ -1,13 +0,0 @@ ---TEST-- -"include" tag ---TEMPLATE-- -{% include ['bad.twig', 'good.twig'] ignore missing %} -NOT DISPLAYED ---TEMPLATE(bad.twig)-- -{% extends 'DOES NOT EXIST' %} ---TEMPLATE(good.twig)-- -NOT DISPLAYED ---DATA-- -return [] ---EXCEPTION-- -Twig\Error\LoaderError: Template "DOES NOT EXIST" is not defined in "bad.twig" at line 2. diff --git a/vendor/twig/twig/tests/Fixtures/tags/include/missing.test b/vendor/twig/twig/tests/Fixtures/tags/include/missing.test deleted file mode 100644 index ac72838..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/include/missing.test +++ /dev/null @@ -1,8 +0,0 @@ ---TEST-- -"include" tag ---TEMPLATE-- -{% include "foo.twig" %} ---DATA-- -return [] ---EXCEPTION-- -Twig\Error\LoaderError: Template "foo.twig" is not defined in "index.twig" at line 2. diff --git a/vendor/twig/twig/tests/Fixtures/tags/include/missing_nested.test b/vendor/twig/twig/tests/Fixtures/tags/include/missing_nested.test deleted file mode 100644 index 0ee51b7..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/include/missing_nested.test +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -"include" tag ---TEMPLATE-- -{% extends "base.twig" %} - -{% block content %} - {{ parent() }} -{% endblock %} ---TEMPLATE(base.twig)-- -{% block content %} - {% include "foo.twig" %} -{% endblock %} ---DATA-- -return [] ---EXCEPTION-- -Twig\Error\LoaderError: Template "foo.twig" is not defined in "base.twig" at line 3. diff --git a/vendor/twig/twig/tests/Fixtures/tags/include/only.test b/vendor/twig/twig/tests/Fixtures/tags/include/only.test deleted file mode 100644 index 8da402f..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/include/only.test +++ /dev/null @@ -1,20 +0,0 @@ ---TEST-- -"include" tag accept variables and only ---TEMPLATE-- -{% include "foo.twig" %} -{% include "foo.twig" only %} -{% include "foo.twig" with vars1 %} -{% include "foo.twig" with vars1 only %} -{% include "foo.twig" with vars2 %} -{% include "foo.twig" with vars2 only %} ---TEMPLATE(foo.twig)-- -{% for k, v in _context %}{{ k }},{% endfor %} ---DATA-- -return ['vars1' => ['foo1' => 'bar'], 'vars2' => new ArrayObject(['foo2' => 'bar'])] ---EXPECT-- -vars1,vars2,global,_parent, -global,_parent, -vars1,vars2,global,foo1,_parent, -foo1,global,_parent, -vars1,vars2,global,foo2,_parent, -foo2,global,_parent, diff --git a/vendor/twig/twig/tests/Fixtures/tags/include/template_instance.test b/vendor/twig/twig/tests/Fixtures/tags/include/template_instance.test deleted file mode 100644 index 4fb862a..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/include/template_instance.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -"include" tag accepts \Twig\TemplateWrapper instance ---TEMPLATE-- -{% include foo %} FOO ---TEMPLATE(foo.twig)-- -BAR ---DATA-- -return ['foo' => $twig->load('foo.twig')] ---EXPECT-- -BAR FOO diff --git a/vendor/twig/twig/tests/Fixtures/tags/include/templates_as_array.test b/vendor/twig/twig/tests/Fixtures/tags/include/templates_as_array.test deleted file mode 100644 index 3806395..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/include/templates_as_array.test +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -"include" tag ---TEMPLATE-- -{% include ["foo.twig", "bar.twig"] %} -{% include ["bar.twig", "foo.twig"] %} ---TEMPLATE(foo.twig)-- -foo ---DATA-- -return [] ---EXPECT-- -foo -foo diff --git a/vendor/twig/twig/tests/Fixtures/tags/include/with_variables.test b/vendor/twig/twig/tests/Fixtures/tags/include/with_variables.test deleted file mode 100644 index 45a0519..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/include/with_variables.test +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -"include" tag accept variables ---TEMPLATE-- -{% include "foo.twig" with {'foo': 'bar'} %} -{% include "foo.twig" with vars1 %} -{% include "foo.twig" with vars2 %} ---TEMPLATE(foo.twig)-- -{{ foo }} ---DATA-- -return ['vars1' => ['foo' => 'bar'], 'vars2' => new ArrayObject(['foo' => 'bar'])] ---EXPECT-- -bar -bar -bar diff --git a/vendor/twig/twig/tests/Fixtures/tags/inheritance/basic.test b/vendor/twig/twig/tests/Fixtures/tags/inheritance/basic.test deleted file mode 100644 index 703b61b..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/inheritance/basic.test +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -"extends" tag ---TEMPLATE-- -{% extends "foo.twig" %} - -{% block content %} -FOO -{% endblock %} ---TEMPLATE(foo.twig)-- -{% block content %}{% endblock %} ---DATA-- -return [] ---EXPECT-- -FOO diff --git a/vendor/twig/twig/tests/Fixtures/tags/inheritance/block_expr.test b/vendor/twig/twig/tests/Fixtures/tags/inheritance/block_expr.test deleted file mode 100644 index 0b82d4c..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/inheritance/block_expr.test +++ /dev/null @@ -1,30 +0,0 @@ ---TEST-- -block_expr ---TEMPLATE-- -{% extends "base.twig" %} - -{% block element -%} - Element: - {{- parent() -}} -{% endblock %} ---TEMPLATE(base.twig)-- -{% block element -%} -
    - {%- if item.children is defined %} - {%- for item in item.children %} - {{- block('element') -}} - {% endfor %} - {%- endif -%} -
    -{%- endblock %} ---DATA-- -return [ - 'item' => [ - 'children' => [ - null, - null, - ] - ] -] ---EXPECT-- -Element:
    Element:
    Element:
    diff --git a/vendor/twig/twig/tests/Fixtures/tags/inheritance/block_expr2.test b/vendor/twig/twig/tests/Fixtures/tags/inheritance/block_expr2.test deleted file mode 100644 index 18f6604..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/inheritance/block_expr2.test +++ /dev/null @@ -1,32 +0,0 @@ ---TEST-- -block_expr2 ---TEMPLATE-- -{% extends "base2.twig" %} - -{% block element -%} - Element: - {{- parent() -}} -{% endblock %} ---TEMPLATE(base2.twig)-- -{% extends "base.twig" %} ---TEMPLATE(base.twig)-- -{% block element -%} -
    - {%- if item.children is defined %} - {%- for item in item.children %} - {{- block('element') -}} - {% endfor %} - {%- endif -%} -
    -{%- endblock %} ---DATA-- -return [ - 'item' => [ - 'children' => [ - null, - null, - ] - ] -] ---EXPECT-- -Element:
    Element:
    Element:
    diff --git a/vendor/twig/twig/tests/Fixtures/tags/inheritance/conditional.test b/vendor/twig/twig/tests/Fixtures/tags/inheritance/conditional.test deleted file mode 100644 index bd28248..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/inheritance/conditional.test +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -"extends" tag ---TEMPLATE-- -{% extends standalone ? foo : 'bar.twig' %} - -{% block content %}{{ parent() }}FOO{% endblock %} ---TEMPLATE(foo.twig)-- -{% block content %}FOO{% endblock %} ---TEMPLATE(bar.twig)-- -{% block content %}BAR{% endblock %} ---DATA-- -return ['foo' => 'foo.twig', 'standalone' => true] ---EXPECT-- -FOOFOO diff --git a/vendor/twig/twig/tests/Fixtures/tags/inheritance/dynamic.test b/vendor/twig/twig/tests/Fixtures/tags/inheritance/dynamic.test deleted file mode 100644 index e6a0f01..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/inheritance/dynamic.test +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -"extends" tag ---TEMPLATE-- -{% extends foo %} - -{% block content %} -FOO -{% endblock %} ---TEMPLATE(foo.twig)-- -{% block content %}{% endblock %} ---DATA-- -return ['foo' => 'foo.twig'] ---EXPECT-- -FOO diff --git a/vendor/twig/twig/tests/Fixtures/tags/inheritance/empty.test b/vendor/twig/twig/tests/Fixtures/tags/inheritance/empty.test deleted file mode 100644 index ca11bf2..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/inheritance/empty.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -"extends" tag ---TEMPLATE-- -{% extends "foo.twig" %} ---TEMPLATE(foo.twig)-- -{% block content %}FOO{% endblock %} ---DATA-- -return [] ---EXPECT-- -FOO diff --git a/vendor/twig/twig/tests/Fixtures/tags/inheritance/extends_as_array.test b/vendor/twig/twig/tests/Fixtures/tags/inheritance/extends_as_array.test deleted file mode 100644 index 4d2cb6c..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/inheritance/extends_as_array.test +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -"extends" tag ---TEMPLATE-- -{% extends ["foo.twig", "bar.twig"] %} ---TEMPLATE(bar.twig)-- -{% block content %} -foo -{% endblock %} ---DATA-- -return [] ---EXPECT-- -foo diff --git a/vendor/twig/twig/tests/Fixtures/tags/inheritance/extends_as_array_with_empty_name.test b/vendor/twig/twig/tests/Fixtures/tags/inheritance/extends_as_array_with_empty_name.test deleted file mode 100644 index 5108651..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/inheritance/extends_as_array_with_empty_name.test +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -"extends" tag ---TEMPLATE-- -{% extends ["", "bar.twig"] %} ---TEMPLATE(bar.twig)-- -{% block content %} -foo -{% endblock %} ---DATA-- -return [] ---EXPECT-- -foo diff --git a/vendor/twig/twig/tests/Fixtures/tags/inheritance/extends_as_array_with_null_name.test b/vendor/twig/twig/tests/Fixtures/tags/inheritance/extends_as_array_with_null_name.test deleted file mode 100644 index c5ee6f1..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/inheritance/extends_as_array_with_null_name.test +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -"extends" tag ---TEMPLATE-- -{% extends [null, "bar.twig"] %} ---TEMPLATE(bar.twig)-- -{% block content %} -foo -{% endblock %} ---DATA-- -return [] ---EXPECT-- -foo diff --git a/vendor/twig/twig/tests/Fixtures/tags/inheritance/extends_in_block.test b/vendor/twig/twig/tests/Fixtures/tags/inheritance/extends_in_block.test deleted file mode 100644 index a372ea1..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/inheritance/extends_in_block.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -"extends" tag in a block ---TEMPLATE-- -{% block foo %} - {% extends "foo.twig" %} -{% endblock %} ---DATA-- -return [] ---EXCEPTION-- -Twig\Error\SyntaxError: Cannot use "extend" in a block in "index.twig" at line 3. diff --git a/vendor/twig/twig/tests/Fixtures/tags/inheritance/extends_in_macro.test b/vendor/twig/twig/tests/Fixtures/tags/inheritance/extends_in_macro.test deleted file mode 100644 index dc87b2a..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/inheritance/extends_in_macro.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -"extends" tag in a macro ---TEMPLATE-- -{% macro foo() %} - {% extends "foo.twig" %} -{% endmacro %} ---DATA-- -return [] ---EXCEPTION-- -Twig\Error\SyntaxError: Cannot use "extend" in a macro in "index.twig" at line 3. diff --git a/vendor/twig/twig/tests/Fixtures/tags/inheritance/multiple.test b/vendor/twig/twig/tests/Fixtures/tags/inheritance/multiple.test deleted file mode 100644 index fc25bad..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/inheritance/multiple.test +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -"extends" tag ---TEMPLATE-- -{% extends "layout.twig" %}{% block content %}{{ parent() }}index {% endblock %} ---TEMPLATE(layout.twig)-- -{% extends "base.twig" %}{% block content %}{{ parent() }}layout {% endblock %} ---TEMPLATE(base.twig)-- -{% block content %}base {% endblock %} ---DATA-- -return [] ---EXPECT-- -base layout index diff --git a/vendor/twig/twig/tests/Fixtures/tags/inheritance/multiple_dynamic.test b/vendor/twig/twig/tests/Fixtures/tags/inheritance/multiple_dynamic.test deleted file mode 100644 index fa88717..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/inheritance/multiple_dynamic.test +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -"extends" tag ---TEMPLATE-- -{% set foo = 1 %} -{{ include('parent.twig') }} -{{ include('parent.twig') }} -{% set foo = 2 %} -{{ include('parent.twig') }} ---TEMPLATE(parent.twig)-- -{% extends foo~'_parent.twig' %}{% block content %}{{ parent() }} parent{% endblock %} ---TEMPLATE(1_parent.twig)-- -{% block content %}1{% endblock %} ---TEMPLATE(2_parent.twig)-- -{% block content %}2{% endblock %} ---DATA-- -return [] ---EXPECT-- -1 parent - -1 parent - -2 parent diff --git a/vendor/twig/twig/tests/Fixtures/tags/inheritance/nested_blocks.test b/vendor/twig/twig/tests/Fixtures/tags/inheritance/nested_blocks.test deleted file mode 100644 index abea2e9..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/inheritance/nested_blocks.test +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -"block" tag ---TEMPLATE-- -{% extends "foo.twig" %} - -{% block content %} - {% block subcontent %} - {% block subsubcontent %} - SUBSUBCONTENT - {% endblock %} - {% endblock %} -{% endblock %} ---TEMPLATE(foo.twig)-- -{% block content %} - {% block subcontent %} - SUBCONTENT - {% endblock %} -{% endblock %} ---DATA-- -return [] ---EXPECT-- -SUBSUBCONTENT diff --git a/vendor/twig/twig/tests/Fixtures/tags/inheritance/nested_blocks_parent_only.test b/vendor/twig/twig/tests/Fixtures/tags/inheritance/nested_blocks_parent_only.test deleted file mode 100644 index 20b7848..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/inheritance/nested_blocks_parent_only.test +++ /dev/null @@ -1,15 +0,0 @@ ---TEST-- -"block" tag ---TEMPLATE-- -{% block content %} - CONTENT - {%- block subcontent -%} - SUBCONTENT - {%- endblock -%} - ENDCONTENT -{% endblock %} ---TEMPLATE(foo.twig)-- ---DATA-- -return [] ---EXPECT-- -CONTENTSUBCONTENTENDCONTENT diff --git a/vendor/twig/twig/tests/Fixtures/tags/inheritance/nested_inheritance.test b/vendor/twig/twig/tests/Fixtures/tags/inheritance/nested_inheritance.test deleted file mode 100644 index 0b585b4..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/inheritance/nested_inheritance.test +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -"extends" tag ---TEMPLATE-- -{% extends "layout.twig" %} -{% block inside %}INSIDE{% endblock inside %} ---TEMPLATE(layout.twig)-- -{% extends "base.twig" %} -{% block body %} - {% block inside '' %} -{% endblock body %} ---TEMPLATE(base.twig)-- -{% block body '' %} ---DATA-- -return [] ---EXPECT-- -INSIDE diff --git a/vendor/twig/twig/tests/Fixtures/tags/inheritance/parent.test b/vendor/twig/twig/tests/Fixtures/tags/inheritance/parent.test deleted file mode 100644 index 73f4c0e..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/inheritance/parent.test +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -"extends" tag ---TEMPLATE-- -{% extends "foo.twig" %} - -{% block content %}{{ parent() }}FOO{{ parent() }}{% endblock %} ---TEMPLATE(foo.twig)-- -{% block content %}BAR{% endblock %} ---DATA-- -return [] ---EXPECT-- -BARFOOBAR diff --git a/vendor/twig/twig/tests/Fixtures/tags/inheritance/parent_as_template_wrapper.test b/vendor/twig/twig/tests/Fixtures/tags/inheritance/parent_as_template_wrapper.test deleted file mode 100644 index 1aaed55..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/inheritance/parent_as_template_wrapper.test +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -"extends" tag with a parent as a Twig_TemplateWrapper instance ---TEMPLATE-- -{% extends foo %} - -{% block content %}New{% endblock %} ---TEMPLATE(foo.twig)-- -{% block content %}Default{% endblock %} ---DATA-- -return ['foo' => $twig->load('foo.twig')] ---EXPECT-- -New diff --git a/vendor/twig/twig/tests/Fixtures/tags/inheritance/parent_change.test b/vendor/twig/twig/tests/Fixtures/tags/inheritance/parent_change.test deleted file mode 100644 index 01bd544..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/inheritance/parent_change.test +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -"extends" tag ---TEMPLATE-- -{% extends foo ? 'foo.twig' : 'bar.twig' %} ---TEMPLATE(foo.twig)-- -FOO ---TEMPLATE(bar.twig)-- -BAR ---DATA-- -return ['foo' => true] ---EXPECT-- -FOO ---DATA-- -return ['foo' => false] ---EXPECT-- -BAR diff --git a/vendor/twig/twig/tests/Fixtures/tags/inheritance/parent_isolation.test b/vendor/twig/twig/tests/Fixtures/tags/inheritance/parent_isolation.test deleted file mode 100644 index 58a37bd..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/inheritance/parent_isolation.test +++ /dev/null @@ -1,20 +0,0 @@ ---TEST-- -"extends" tag ---TEMPLATE-- -{% extends "base.twig" %} -{% block content %}{% include "included.twig" %}{% endblock %} - -{% block footer %}Footer{% endblock %} ---TEMPLATE(included.twig)-- -{% extends "base.twig" %} -{% block content %}Included Content{% endblock %} ---TEMPLATE(base.twig)-- -{% block content %}Default Content{% endblock %} - -{% block footer %}Default Footer{% endblock %} ---DATA-- -return [] ---EXPECT-- -Included Content -Default Footer -Footer diff --git a/vendor/twig/twig/tests/Fixtures/tags/inheritance/parent_nested.test b/vendor/twig/twig/tests/Fixtures/tags/inheritance/parent_nested.test deleted file mode 100644 index d4347ba..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/inheritance/parent_nested.test +++ /dev/null @@ -1,28 +0,0 @@ ---TEST-- -"extends" tag ---TEMPLATE-- -{% extends "foo.twig" %} - -{% block content %} - {% block inside %} - INSIDE OVERRIDDEN - {% endblock %} - - BEFORE - {{ parent() }} - AFTER -{% endblock %} ---TEMPLATE(foo.twig)-- -{% block content %} - BAR -{% endblock %} ---DATA-- -return [] ---EXPECT-- - -INSIDE OVERRIDDEN - - BEFORE - BAR - - AFTER diff --git a/vendor/twig/twig/tests/Fixtures/tags/inheritance/parent_without_extends.test b/vendor/twig/twig/tests/Fixtures/tags/inheritance/parent_without_extends.test deleted file mode 100644 index 6d98891..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/inheritance/parent_without_extends.test +++ /dev/null @@ -1,8 +0,0 @@ ---TEST-- -"parent" tag ---TEMPLATE-- -{% block content %} - {{ parent() }} -{% endblock %} ---EXCEPTION-- -Twig\Error\SyntaxError: Calling "parent" on a template that does not extend nor "use" another template is forbidden in "index.twig" at line 3. diff --git a/vendor/twig/twig/tests/Fixtures/tags/inheritance/parent_without_extends_but_traits.test b/vendor/twig/twig/tests/Fixtures/tags/inheritance/parent_without_extends_but_traits.test deleted file mode 100644 index 39882b8..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/inheritance/parent_without_extends_but_traits.test +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -"parent" tag ---TEMPLATE-- -{% use 'foo.twig' %} - -{% block content %} - {{ parent() }} -{% endblock %} ---TEMPLATE(foo.twig)-- -{% block content %}BAR{% endblock %} ---DATA-- -return [] ---EXPECT-- -BAR diff --git a/vendor/twig/twig/tests/Fixtures/tags/inheritance/template_instance.test b/vendor/twig/twig/tests/Fixtures/tags/inheritance/template_instance.test deleted file mode 100644 index a5a2238..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/inheritance/template_instance.test +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -"extends" tag accepts Twig_Template instance ---TEMPLATE-- -{% extends foo %} - -{% block content %} -{{ parent() }}FOO -{% endblock %} ---TEMPLATE(foo.twig)-- -{% block content %}BAR{% endblock %} ---DATA-- -return ['foo' => $twig->load('foo.twig')] ---EXPECT-- -BARFOO diff --git a/vendor/twig/twig/tests/Fixtures/tags/inheritance/use.test b/vendor/twig/twig/tests/Fixtures/tags/inheritance/use.test deleted file mode 100644 index 4df32ee..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/inheritance/use.test +++ /dev/null @@ -1,44 +0,0 @@ ---TEST-- -"parent" function ---TEMPLATE-- -{% extends "parent.twig" %} - -{% use "use1.twig" %} -{% use "use2.twig" %} - -{% block content_parent %} - {{ parent() }} -{% endblock %} - -{% block content_use1 %} - {{ parent() }} -{% endblock %} - -{% block content_use2 %} - {{ parent() }} -{% endblock %} - -{% block content %} - {{ block('content_use1_only') }} - {{ block('content_use2_only') }} -{% endblock %} ---TEMPLATE(parent.twig)-- -{% block content_parent 'content_parent' %} -{% block content_use1 'content_parent' %} -{% block content_use2 'content_parent' %} -{% block content '' %} ---TEMPLATE(use1.twig)-- -{% block content_use1 'content_use1' %} -{% block content_use2 'content_use1' %} -{% block content_use1_only 'content_use1_only' %} ---TEMPLATE(use2.twig)-- -{% block content_use2 'content_use2' %} -{% block content_use2_only 'content_use2_only' %} ---DATA-- -return [] ---EXPECT-- - content_parent - content_use1 - content_use2 - content_use1_only - content_use2_only diff --git a/vendor/twig/twig/tests/Fixtures/tags/macro/basic.test b/vendor/twig/twig/tests/Fixtures/tags/macro/basic.test deleted file mode 100644 index ae090f9..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/macro/basic.test +++ /dev/null @@ -1,17 +0,0 @@ ---TEST-- -"macro" tag ---TEMPLATE-- -{% import _self as macros %} - -{{ macros.input('username') }} -{{ macros.input('password', null, 'password', 1) }} - -{% macro input(name, value, type, size) %} - -{% endmacro %} ---DATA-- -return [] ---EXPECT-- - - - diff --git a/vendor/twig/twig/tests/Fixtures/tags/macro/endmacro_name.test b/vendor/twig/twig/tests/Fixtures/tags/macro/endmacro_name.test deleted file mode 100644 index 3f3caf7..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/macro/endmacro_name.test +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -"macro" tag supports name for endmacro ---TEMPLATE-- -{% import _self as macros %} - -{{ macros.foo() }} -{{ macros.bar() }} - -{% macro foo() %}foo{% endmacro %} -{% macro bar() %}bar{% endmacro bar %} ---DATA-- -return [] ---EXPECT-- -foo -bar - diff --git a/vendor/twig/twig/tests/Fixtures/tags/macro/external.test b/vendor/twig/twig/tests/Fixtures/tags/macro/external.test deleted file mode 100644 index b28ca19..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/macro/external.test +++ /dev/null @@ -1,17 +0,0 @@ ---TEST-- -"macro" tag ---TEMPLATE-- -{% import 'forms.twig' as forms %} - -{{ forms.input('username') }} -{{ forms.input('password', null, 'password', 1) }} ---TEMPLATE(forms.twig)-- -{% macro input(name, value, type, size) %} - -{% endmacro %} ---DATA-- -return [] ---EXPECT-- - - - diff --git a/vendor/twig/twig/tests/Fixtures/tags/macro/from.test b/vendor/twig/twig/tests/Fixtures/tags/macro/from.test deleted file mode 100644 index 8b9aae8..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/macro/from.test +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -"macro" tag ---TEMPLATE-- -{% from 'forms.twig' import foo %} -{% from 'forms.twig' import foo as foobar, bar %} - -{{ foo('foo') }} -{{ foobar('foo') }} -{{ bar('foo') }} ---TEMPLATE(forms.twig)-- -{% macro foo(name) %}foo{{ name }}{% endmacro %} -{% macro bar(name) %}bar{{ name }}{% endmacro %} ---DATA-- -return [] ---EXPECT-- -foofoo -foofoo -barfoo diff --git a/vendor/twig/twig/tests/Fixtures/tags/macro/from_in_block_is_local.test b/vendor/twig/twig/tests/Fixtures/tags/macro/from_in_block_is_local.test deleted file mode 100644 index 0c89ce6..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/macro/from_in_block_is_local.test +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -"macro" tag ---TEMPLATE-- -{% block foo %} - {%- from _self import input as linput %} -{% endblock %} - -{% block bar %} - {{- linput('username') }} -{% endblock %} - -{% macro input(name) -%} - -{% endmacro %} ---DATA-- -return [] ---EXCEPTION-- -Twig\Error\SyntaxError: Unknown "linput" function in "index.twig" at line 7. diff --git a/vendor/twig/twig/tests/Fixtures/tags/macro/from_local_override.test b/vendor/twig/twig/tests/Fixtures/tags/macro/from_local_override.test deleted file mode 100644 index 27bfbae..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/macro/from_local_override.test +++ /dev/null @@ -1,28 +0,0 @@ ---TEST-- -"macro" tag ---TEMPLATE-- -{%- from _self import input %} - -{% block foo %} - {%- from "macros" import input %} - {{- input('username') }} -{% endblock %} - -{% block bar %} - {{- input('username') }} -{% endblock %} - -{% macro input(name) -%} - -{% endmacro %} ---TEMPLATE(macros)-- -{% macro input(name) %} - -{% endmacro %} ---DATA-- -return [] ---EXPECT-- - - - - diff --git a/vendor/twig/twig/tests/Fixtures/tags/macro/from_macro_in_a_macro.test b/vendor/twig/twig/tests/Fixtures/tags/macro/from_macro_in_a_macro.test deleted file mode 100644 index 87ac25c..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/macro/from_macro_in_a_macro.test +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -"from" tag with syntax error ---TEMPLATE-- -{% from _self import another, foo %} - -{{ foo() }} - -{% macro foo() %} - {{ another() }} -{% endmacro %} - -{% macro another() %} - OK -{% endmacro %} ---DATA-- -return [] ---EXCEPTION-- -Twig\Error\SyntaxError: Unknown "another" function in "index.twig" at line 7. diff --git a/vendor/twig/twig/tests/Fixtures/tags/macro/from_nested_blocks.test b/vendor/twig/twig/tests/Fixtures/tags/macro/from_nested_blocks.test deleted file mode 100644 index 8ede5db..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/macro/from_nested_blocks.test +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -"macro" tag ---TEMPLATE-- -{% block foo %} - {%- from _self import input as linput %} - - {% block bar %} - {{- linput('username') }} - {% endblock %} -{% endblock %} - -{% macro input(name) -%} - -{% endmacro %} ---DATA-- -return [] ---EXCEPTION-- -Twig\Error\SyntaxError: Unknown "linput" function in "index.twig" at line 6. diff --git a/vendor/twig/twig/tests/Fixtures/tags/macro/from_nested_blocks_with_global_macro.test b/vendor/twig/twig/tests/Fixtures/tags/macro/from_nested_blocks_with_global_macro.test deleted file mode 100644 index f737bf0..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/macro/from_nested_blocks_with_global_macro.test +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -"macro" tag ---TEMPLATE-- -{%- from _self import input %} - -{% block foo %} - {% block bar %} - {{- input('username') }} - {% endblock %} -{% endblock %} - -{% macro input(name) -%} - -{% endmacro %} ---DATA-- -return [] ---EXCEPTION-- -Twig\Error\SyntaxError: Unknown "input" function in "index.twig" at line 6. diff --git a/vendor/twig/twig/tests/Fixtures/tags/macro/from_syntax_error.test b/vendor/twig/twig/tests/Fixtures/tags/macro/from_syntax_error.test deleted file mode 100644 index 6223cfe..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/macro/from_syntax_error.test +++ /dev/null @@ -1,8 +0,0 @@ ---TEST-- -"from" tag with syntax error ---TEMPLATE-- -{% from 'forms.twig' %} ---DATA-- -return [] ---EXCEPTION-- -Twig\Error\SyntaxError: Unexpected token "end of statement block" ("name" expected with value "import") in "index.twig" at line 2. diff --git a/vendor/twig/twig/tests/Fixtures/tags/macro/from_with_reserved_name.test b/vendor/twig/twig/tests/Fixtures/tags/macro/from_with_reserved_name.test deleted file mode 100644 index 19adb9d..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/macro/from_with_reserved_name.test +++ /dev/null @@ -1,8 +0,0 @@ ---TEST-- -"from" tag with reserved name ---TEMPLATE-- -{% from 'forms.twig' import templateName %} ---DATA-- -return [] ---EXCEPTION-- -Twig\Error\SyntaxError: "templateName" cannot be an imported macro as it is a reserved keyword in "index.twig" at line 2. diff --git a/vendor/twig/twig/tests/Fixtures/tags/macro/global.test b/vendor/twig/twig/tests/Fixtures/tags/macro/global.test deleted file mode 100644 index 832740e..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/macro/global.test +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -"macro" tag ---TEMPLATE-- -{% from 'forms.twig' import foo %} - -{{ foo('foo') }} -{{ foo() }} ---TEMPLATE(forms.twig)-- -{% macro foo(name) %}{{ name|default('foo') }}{{ global }}{% endmacro %} ---DATA-- -return [] ---EXPECT-- -fooglobal -fooglobal diff --git a/vendor/twig/twig/tests/Fixtures/tags/macro/import_and_blocks.test b/vendor/twig/twig/tests/Fixtures/tags/macro/import_and_blocks.test deleted file mode 100644 index 721f550..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/macro/import_and_blocks.test +++ /dev/null @@ -1,36 +0,0 @@ ---TEST-- -"macro" tag ---TEMPLATE-- -{% import _self as macros %} -{% from _self import input %} - -{% block foo %} - {{- macros.input('username') }} - {{- input('username') }} - - {%- import _self as lmacros %} - {%- from _self import input as linput %} - - {{- lmacros.input('username') }} - {{- linput('username') }} -{% endblock %} - -{% block bar %} - {{- macros.input('username') }} - {{- input('username') }} -{% endblock %} - -{% macro input(name) -%} - -{% endmacro %} ---DATA-- -return [] ---EXPECT-- - - - - - - - - diff --git a/vendor/twig/twig/tests/Fixtures/tags/macro/import_from_string_template.test b/vendor/twig/twig/tests/Fixtures/tags/macro/import_from_string_template.test deleted file mode 100644 index 6c1817b..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/macro/import_from_string_template.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -"import" tag with a template as string ---TEMPLATE-- -{% import template_from_string("{% macro test() %}ok{% endmacro %}") as m %} -{{ m.test() }} ---TEMPLATE(forms.twig)-- ---DATA-- -return [] ---EXPECT-- -ok diff --git a/vendor/twig/twig/tests/Fixtures/tags/macro/import_in_block_is_local.test b/vendor/twig/twig/tests/Fixtures/tags/macro/import_in_block_is_local.test deleted file mode 100644 index 9443e12..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/macro/import_in_block_is_local.test +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -"macro" tag ---TEMPLATE-- -{% block foo %} - {%- import _self as lmacros %} -{% endblock %} - -{% block bar %} - {{- lmacros.input('username') }} -{% endblock %} - -{% macro input(name) -%} - -{% endmacro %} ---DATA-- -return [] ---EXCEPTION-- -Twig\Error\RuntimeError: Variable "lmacros" does not exist in "index.twig" at line 7. diff --git a/vendor/twig/twig/tests/Fixtures/tags/macro/import_local_override.test b/vendor/twig/twig/tests/Fixtures/tags/macro/import_local_override.test deleted file mode 100644 index 7cf0552..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/macro/import_local_override.test +++ /dev/null @@ -1,28 +0,0 @@ ---TEST-- -"macro" tag ---TEMPLATE-- -{%- import _self as macros %} - -{% block foo %} - {%- import "macros" as macros %} - {{- macros.input('username') }} -{% endblock %} - -{% block bar %} - {{- macros.input('username') }} -{% endblock %} - -{% macro input(name) -%} - -{% endmacro %} ---TEMPLATE(macros)-- -{% macro input(name) %} - -{% endmacro %} ---DATA-- -return [] ---EXPECT-- - - - - diff --git a/vendor/twig/twig/tests/Fixtures/tags/macro/import_macro_in_a_macro.test b/vendor/twig/twig/tests/Fixtures/tags/macro/import_macro_in_a_macro.test deleted file mode 100644 index d224482..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/macro/import_macro_in_a_macro.test +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -"import" tag with syntax error ---TEMPLATE-- -{% import _self as foo %} - -{{ foo.foo() }} - -{% macro foo() %} - {{ foo.another() }} -{% endmacro %} - -{% macro another() %} - OK -{% endmacro %} ---DATA-- -return [] ---EXCEPTION-- -Twig\Error\RuntimeError: Variable "foo" does not exist in "index.twig" at line 7. diff --git a/vendor/twig/twig/tests/Fixtures/tags/macro/import_nested_blocks.legacy.test b/vendor/twig/twig/tests/Fixtures/tags/macro/import_nested_blocks.legacy.test deleted file mode 100644 index e822c7f..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/macro/import_nested_blocks.legacy.test +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -"macro" tag ---TEMPLATE-- -{% block foo %} - {%- import _self as lmacros %} - - {% block bar %} - {{- lmacros.input('username') }} - {% endblock %} -{% endblock %} - -{% macro input(name) -%} - -{% endmacro %} ---DATA-- -return [] ---EXPECT-- - diff --git a/vendor/twig/twig/tests/Fixtures/tags/macro/import_nested_blocks_with_global_macro.legacy.test b/vendor/twig/twig/tests/Fixtures/tags/macro/import_nested_blocks_with_global_macro.legacy.test deleted file mode 100644 index 697d665..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/macro/import_nested_blocks_with_global_macro.legacy.test +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -"macro" tag ---TEMPLATE-- -{%- import _self as macros %} - -{% block foo %} - {% block bar %} - {{- macros.input('username') }} - {% endblock %} -{% endblock %} - -{% macro input(name) -%} - -{% endmacro %} ---DATA-- -return [] ---EXPECT-- - diff --git a/vendor/twig/twig/tests/Fixtures/tags/macro/import_self_parent.test b/vendor/twig/twig/tests/Fixtures/tags/macro/import_self_parent.test deleted file mode 100644 index 24a8cdb..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/macro/import_self_parent.test +++ /dev/null @@ -1,23 +0,0 @@ ---TEST-- -"macro" tag ---TEMPLATE-- -{% extends "parent" %} -{% import _self as me %} - -{% block test %} - {{ me.hello() }} -{% endblock test %} ---TEMPLATE(parent)-- -{% import _self as me %} - -{% block test %} -Hello -{% endblock test %} - -{% macro hello() %} - Test -{% endmacro %} ---DATA-- -return [] ---EXPECT-- -Test diff --git a/vendor/twig/twig/tests/Fixtures/tags/macro/import_syntax_error.test b/vendor/twig/twig/tests/Fixtures/tags/macro/import_syntax_error.test deleted file mode 100644 index b9817f0..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/macro/import_syntax_error.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -"import" tag with reserved name ---TEMPLATE-- -{% import 'forms.twig' %} - -{{ macros.parent() }} ---DATA-- -return [] ---EXCEPTION-- -Twig\Error\SyntaxError: Unexpected token "end of statement block" ("name" expected with value "as") in "index.twig" at line 2. diff --git a/vendor/twig/twig/tests/Fixtures/tags/macro/import_with_reserved_name.test b/vendor/twig/twig/tests/Fixtures/tags/macro/import_with_reserved_name.test deleted file mode 100644 index 34b8d43..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/macro/import_with_reserved_name.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -"from" tag with reserved name ---TEMPLATE-- -{% import 'forms.twig' as macros %} - -{{ macros.parent() }} ---DATA-- -return [] ---EXCEPTION-- -Twig\Error\SyntaxError: "parent" cannot be called as macro as it is a reserved keyword in "index.twig" at line 4. diff --git a/vendor/twig/twig/tests/Fixtures/tags/macro/reserved_name.test b/vendor/twig/twig/tests/Fixtures/tags/macro/reserved_name.test deleted file mode 100644 index e58dd7c..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/macro/reserved_name.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -"macro" tag with reserved name ---TEMPLATE-- -{% macro parent(arg1, arg2) %} - parent -{% endmacro %} ---DATA-- -return [] ---EXCEPTION-- -Twig\Error\SyntaxError: "parent" cannot be used as a macro name as it is a reserved keyword in "index.twig" at line 2. diff --git a/vendor/twig/twig/tests/Fixtures/tags/macro/self_import.test b/vendor/twig/twig/tests/Fixtures/tags/macro/self_import.test deleted file mode 100644 index ca3157d..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/macro/self_import.test +++ /dev/null @@ -1,17 +0,0 @@ ---TEST-- -"macro" tag ---TEMPLATE-- -{% import _self as forms %} - -{{ forms.input('username') }} -{{ forms.input('password', null, 'password', 1) }} - -{% macro input(name, value, type, size) %} - -{% endmacro %} ---DATA-- -return [] ---EXPECT-- - - - diff --git a/vendor/twig/twig/tests/Fixtures/tags/macro/special_chars.test b/vendor/twig/twig/tests/Fixtures/tags/macro/special_chars.test deleted file mode 100644 index 491e91e..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/macro/special_chars.test +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -"§" as a macro name ---TEMPLATE-- -{% import _self as macros %} - -{{ macros.§('foo') }} - -{% macro §(foo) %} - §{{ foo }}§ -{% endmacro %} ---DATA-- -return [] ---EXPECT-- -§foo§ diff --git a/vendor/twig/twig/tests/Fixtures/tags/macro/super_globals.test b/vendor/twig/twig/tests/Fixtures/tags/macro/super_globals.test deleted file mode 100644 index 643697c..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/macro/super_globals.test +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -Super globals as macro arguments ---TEMPLATE-- -{% import _self as macros %} - -{{ macros.foo('foo') }} - -{% macro foo(GET) %} - {{ GET }} -{% endmacro %} ---DATA-- -return [] ---EXPECT-- -foo diff --git a/vendor/twig/twig/tests/Fixtures/tags/raw/basic.legacy.test b/vendor/twig/twig/tests/Fixtures/tags/raw/basic.legacy.test deleted file mode 100644 index 7875b2a..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/raw/basic.legacy.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -"raw" tag ---TEMPLATE-- -{% raw %} -{{ foo }} -{% endraw %} ---DATA-- -return [] ---EXPECT-- -{{ foo }} diff --git a/vendor/twig/twig/tests/Fixtures/tags/raw/mixed_usage_with_raw.legacy.test b/vendor/twig/twig/tests/Fixtures/tags/raw/mixed_usage_with_raw.legacy.test deleted file mode 100644 index d4c8dd2..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/raw/mixed_usage_with_raw.legacy.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -"raw" tag ---TEMPLATE-- -{% raw %} -{{ foo }} -{% endverbatim %} ---DATA-- -return [] ---EXCEPTION-- -Twig\Error\SyntaxError: Unexpected end of file: Unclosed "raw" block in "index.twig" at line 2. diff --git a/vendor/twig/twig/tests/Fixtures/tags/raw/whitespace_control.legacy.test b/vendor/twig/twig/tests/Fixtures/tags/raw/whitespace_control.legacy.test deleted file mode 100644 index 11f4202..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/raw/whitespace_control.legacy.test +++ /dev/null @@ -1,56 +0,0 @@ ---TEST-- -"raw" tag ---TEMPLATE-- -1*** - -{%- raw %} - {{ 'bla' }} -{% endraw %} - -1*** -2*** - -{%- raw -%} - {{ 'bla' }} -{% endraw %} - -2*** -3*** - -{%- raw -%} - {{ 'bla' }} -{% endraw -%} - -3*** -4*** - -{%- raw -%} - {{ 'bla' }} -{%- endraw %} - -4*** -5*** - -{%- raw -%} - {{ 'bla' }} -{%- endraw -%} - -5*** ---DATA-- -return [] ---EXPECT-- -1*** - {{ 'bla' }} - - -1*** -2***{{ 'bla' }} - - -2*** -3***{{ 'bla' }} -3*** -4***{{ 'bla' }} - -4*** -5***{{ 'bla' }}5*** diff --git a/vendor/twig/twig/tests/Fixtures/tags/sandbox/array.test b/vendor/twig/twig/tests/Fixtures/tags/sandbox/array.test deleted file mode 100644 index b432427..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/sandbox/array.test +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -sandbox tag ---TEMPLATE-- -{%- sandbox %} - {%- include "foo.twig" %} -{%- endsandbox %} ---TEMPLATE(foo.twig)-- -{{ [a][0] }} -{{ dump([a][0]) }} ---DATA-- -return ['a' => 'b'] ---CONFIG-- -return ['autoescape' => false, 'debug' => true] ---EXPECT-- -b -string(1) "b" diff --git a/vendor/twig/twig/tests/Fixtures/tags/sandbox/not_valid1.test b/vendor/twig/twig/tests/Fixtures/tags/sandbox/not_valid1.test deleted file mode 100644 index e26a78b..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/sandbox/not_valid1.test +++ /dev/null @@ -1,11 +0,0 @@ ---TEST-- -sandbox tag ---TEMPLATE-- -{%- sandbox %} - {%- include "foo.twig" %} - a -{%- endsandbox %} ---TEMPLATE(foo.twig)-- -foo ---EXCEPTION-- -Twig\Error\SyntaxError: Only "include" tags are allowed within a "sandbox" section in "index.twig" at line 4. diff --git a/vendor/twig/twig/tests/Fixtures/tags/sandbox/not_valid2.test b/vendor/twig/twig/tests/Fixtures/tags/sandbox/not_valid2.test deleted file mode 100644 index bb2a329..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/sandbox/not_valid2.test +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -sandbox tag ---TEMPLATE-- -{%- sandbox %} - {%- include "foo.twig" %} - - {% if 1 %} - {%- include "foo.twig" %} - {% endif %} -{%- endsandbox %} ---TEMPLATE(foo.twig)-- -foo ---EXCEPTION-- -Twig\Error\SyntaxError: Only "include" tags are allowed within a "sandbox" section in "index.twig" at line 5. diff --git a/vendor/twig/twig/tests/Fixtures/tags/sandbox/simple.test b/vendor/twig/twig/tests/Fixtures/tags/sandbox/simple.test deleted file mode 100644 index 4d232d8..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/sandbox/simple.test +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -sandbox tag ---TEMPLATE-- -{%- sandbox %} - {%- include "foo.twig" %} -{%- endsandbox %} - -{%- sandbox %} - {%- include "foo.twig" %} - {%- include "foo.twig" %} -{%- endsandbox %} - -{%- sandbox %}{% include "foo.twig" %}{% endsandbox %} ---TEMPLATE(foo.twig)-- -foo ---DATA-- -return [] ---EXPECT-- -foo -foo -foo -foo diff --git a/vendor/twig/twig/tests/Fixtures/tags/set/basic.test b/vendor/twig/twig/tests/Fixtures/tags/set/basic.test deleted file mode 100644 index aae1427..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/set/basic.test +++ /dev/null @@ -1,20 +0,0 @@ ---TEST-- -"set" tag ---TEMPLATE-- -{% set foo = 'foo' %} -{% set bar = 'foo
    ' %} - -{{ foo }} -{{ bar }} - -{% set foo, bar = 'foo', 'bar' %} - -{{ foo }}{{ bar }} ---DATA-- -return [] ---EXPECT-- -foo -foo<br /> - - -foobar diff --git a/vendor/twig/twig/tests/Fixtures/tags/set/capture-empty.test b/vendor/twig/twig/tests/Fixtures/tags/set/capture-empty.test deleted file mode 100644 index 97fc43c..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/set/capture-empty.test +++ /dev/null @@ -1,9 +0,0 @@ ---TEST-- -"set" tag block empty capture ---TEMPLATE-- -{% set foo %}{% endset %} - -{% if foo %}FAIL{% endif %} ---DATA-- -return [] ---EXPECT-- diff --git a/vendor/twig/twig/tests/Fixtures/tags/set/capture.test b/vendor/twig/twig/tests/Fixtures/tags/set/capture.test deleted file mode 100644 index c3faf25..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/set/capture.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -"set" tag block capture ---TEMPLATE-- -{% set foo %}f
    o
    o{% endset %} - -{{ foo }} ---DATA-- -return [] ---EXPECT-- -f
    o
    o diff --git a/vendor/twig/twig/tests/Fixtures/tags/set/capture_scope.test b/vendor/twig/twig/tests/Fixtures/tags/set/capture_scope.test deleted file mode 100644 index bb2bbeb..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/set/capture_scope.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -"set" tag block capture ---TEMPLATE-- -{% set foo %}{{ foo }}{% endset %} - -{{ foo }} ---DATA-- -return ['foo' => 'foo'] ---EXPECT-- -foo diff --git a/vendor/twig/twig/tests/Fixtures/tags/set/expression.test b/vendor/twig/twig/tests/Fixtures/tags/set/expression.test deleted file mode 100644 index bd47277..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/set/expression.test +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -"set" tag ---TEMPLATE-- -{% set foo, bar = 'foo' ~ 'bar', 'bar' ~ 'foo' %} - -{{ foo }} -{{ bar }} ---DATA-- -return [] ---EXPECT-- -foobar -barfoo diff --git a/vendor/twig/twig/tests/Fixtures/tags/set/inheritance.test b/vendor/twig/twig/tests/Fixtures/tags/set/inheritance.test deleted file mode 100644 index 79e89ce..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/set/inheritance.test +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -"set" tag with inheritance ---TEMPLATE-- -{% extends "layout.twig" %} - -{% set bar %}bar{% endset %} - -{% block var_from_child %} - {{- bar -}} -{% endblock %} ---TEMPLATE(layout.twig)-- -{% set foo %}foo{% endset %} - -{% block var_from_layout %} - {{- foo -}} -{% endblock %} - -{% block var_from_child %} -{% endblock %} ---DATA-- -return [] ---EXPECT-- -foo -bar diff --git a/vendor/twig/twig/tests/Fixtures/tags/set/inheritance_overriding.test b/vendor/twig/twig/tests/Fixtures/tags/set/inheritance_overriding.test deleted file mode 100644 index 2d23c83..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/set/inheritance_overriding.test +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -"set" tag with inheritance ---TEMPLATE-- -{% extends "layout.twig" %} - -{% set foo %}bar{% endset %} - -{% block var_from_child %} - {{- foo -}} -{% endblock %} ---TEMPLATE(layout.twig)-- -{% set foo %}foo{% endset %} - -{% block var_from_layout %} - {{- foo -}} -{% endblock %} - -{% block var_from_child %} -{% endblock %} ---DATA-- -return [] ---EXPECT-- -foo -foo diff --git a/vendor/twig/twig/tests/Fixtures/tags/set/mutating.test b/vendor/twig/twig/tests/Fixtures/tags/set/mutating.test deleted file mode 100644 index ae388bb..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/set/mutating.test +++ /dev/null @@ -1,17 +0,0 @@ ---TEST-- -"set" tag ---TEMPLATE-- -{% set foo = "foo" %} - -{% set bar %} - {%- set foo = "bar" -%} - bar -{% endset %} - -{{ foo }} -{{ bar }} ---DATA-- -return [] ---EXPECT-- -bar -bar diff --git a/vendor/twig/twig/tests/Fixtures/tags/spaceless/simple.test b/vendor/twig/twig/tests/Fixtures/tags/spaceless/simple.test deleted file mode 100644 index 98bd27a..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/spaceless/simple.test +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -"spaceless" tag removes whites between HTML tags ---TEMPLATE-- -{% spaceless %} - -
    foo
    - -{% endspaceless %} ---DATA-- -return [] ---EXPECT-- -
    foo
    diff --git a/vendor/twig/twig/tests/Fixtures/tags/special_chars.test b/vendor/twig/twig/tests/Fixtures/tags/special_chars.test deleted file mode 100644 index 64ffd1d..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/special_chars.test +++ /dev/null @@ -1,8 +0,0 @@ ---TEST-- -"§" custom tag ---TEMPLATE-- -{% § %} ---DATA-- -return [] ---EXPECT-- -§ diff --git a/vendor/twig/twig/tests/Fixtures/tags/use/aliases.test b/vendor/twig/twig/tests/Fixtures/tags/use/aliases.test deleted file mode 100644 index b6b1d5c..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/use/aliases.test +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -"use" tag ---TEMPLATE-- -{% use "blocks.twig" with content as foo %} - -{{ block('foo') }} ---TEMPLATE(blocks.twig)-- -{% block content 'foo' %} ---DATA-- -return [] ---EXPECT-- -foo diff --git a/vendor/twig/twig/tests/Fixtures/tags/use/basic.test b/vendor/twig/twig/tests/Fixtures/tags/use/basic.test deleted file mode 100644 index be622a1..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/use/basic.test +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -"use" tag ---TEMPLATE-- -{% use "blocks.twig" %} - -{{ block('content') }} ---TEMPLATE(blocks.twig)-- -{% block content 'foo' %} ---DATA-- -return [] ---EXPECT-- -foo diff --git a/vendor/twig/twig/tests/Fixtures/tags/use/deep.test b/vendor/twig/twig/tests/Fixtures/tags/use/deep.test deleted file mode 100644 index 771ba64..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/use/deep.test +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -"use" tag ---TEMPLATE-- -{% use "foo.twig" %} - -{{ block('content') }} -{{ block('foo') }} -{{ block('bar') }} ---TEMPLATE(foo.twig)-- -{% use "bar.twig" %} - -{% block content 'foo' %} -{% block foo 'foo' %} ---TEMPLATE(bar.twig)-- -{% block content 'bar' %} -{% block bar 'bar' %} ---DATA-- -return [] ---EXPECT-- -foo -foo -bar diff --git a/vendor/twig/twig/tests/Fixtures/tags/use/deep_empty.test b/vendor/twig/twig/tests/Fixtures/tags/use/deep_empty.test deleted file mode 100644 index f14ce83..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/use/deep_empty.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -"use" tag ---TEMPLATE-- -{% use "foo.twig" %} ---TEMPLATE(foo.twig)-- -{% use "bar.twig" %} ---TEMPLATE(bar.twig)-- ---DATA-- -return [] ---EXPECT-- diff --git a/vendor/twig/twig/tests/Fixtures/tags/use/inheritance.test b/vendor/twig/twig/tests/Fixtures/tags/use/inheritance.test deleted file mode 100644 index 1edeaa1..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/use/inheritance.test +++ /dev/null @@ -1,25 +0,0 @@ ---TEST-- -"use" tag ---TEMPLATE-- -{% use "parent.twig" %} - -{{ block('container') }} ---TEMPLATE(parent.twig)-- -{% use "ancestor.twig" %} - -{% block sub_container %} -
    overridden sub_container
    -{% endblock %} ---TEMPLATE(ancestor.twig)-- -{% block container %} -
    {{ block('sub_container') }}
    -{% endblock %} - -{% block sub_container %} -
    sub_container
    -{% endblock %} ---DATA-- -return [] ---EXPECT-- -
    overridden sub_container
    -
    diff --git a/vendor/twig/twig/tests/Fixtures/tags/use/inheritance2.test b/vendor/twig/twig/tests/Fixtures/tags/use/inheritance2.test deleted file mode 100644 index accec50..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/use/inheritance2.test +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -"use" tag ---TEMPLATE-- -{% use "ancestor.twig" %} -{% use "parent.twig" %} - -{{ block('container') }} ---TEMPLATE(parent.twig)-- -{% block sub_container %} -
    overridden sub_container
    -{% endblock %} ---TEMPLATE(ancestor.twig)-- -{% block container %} -
    {{ block('sub_container') }}
    -{% endblock %} - -{% block sub_container %} -
    sub_container
    -{% endblock %} ---DATA-- -return [] ---EXPECT-- -
    overridden sub_container
    -
    diff --git a/vendor/twig/twig/tests/Fixtures/tags/use/multiple.test b/vendor/twig/twig/tests/Fixtures/tags/use/multiple.test deleted file mode 100644 index 85a6395..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/use/multiple.test +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -"use" tag ---TEMPLATE-- -{% use "foo.twig" %} -{% use "bar.twig" %} - -{{ block('content') }} -{{ block('foo') }} -{{ block('bar') }} ---TEMPLATE(foo.twig)-- -{% block content 'foo' %} -{% block foo 'foo' %} ---TEMPLATE(bar.twig)-- -{% block content 'bar' %} -{% block bar 'bar' %} ---DATA-- -return [] ---EXPECT-- -bar -foo -bar diff --git a/vendor/twig/twig/tests/Fixtures/tags/use/multiple_aliases.test b/vendor/twig/twig/tests/Fixtures/tags/use/multiple_aliases.test deleted file mode 100644 index 413bdfa..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/use/multiple_aliases.test +++ /dev/null @@ -1,23 +0,0 @@ ---TEST-- -"use" tag ---TEMPLATE-- -{% use "foo.twig" with content as foo_content %} -{% use "bar.twig" %} - -{{ block('content') }} -{{ block('foo') }} -{{ block('bar') }} -{{ block('foo_content') }} ---TEMPLATE(foo.twig)-- -{% block content 'foo' %} -{% block foo 'foo' %} ---TEMPLATE(bar.twig)-- -{% block content 'bar' %} -{% block bar 'bar' %} ---DATA-- -return [] ---EXPECT-- -bar -foo -bar -foo diff --git a/vendor/twig/twig/tests/Fixtures/tags/use/parent_block.test b/vendor/twig/twig/tests/Fixtures/tags/use/parent_block.test deleted file mode 100644 index 49328f6..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/use/parent_block.test +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -"use" tag ---TEMPLATE-- -{% use 'file2.html.twig' with foobar as base_base_foobar %} -{% block foobar %} - {{- block('base_base_foobar') -}} - Content of block (second override) -{% endblock foobar %} ---TEMPLATE(file2.html.twig)-- -{% use 'file1.html.twig' with foobar as base_foobar %} -{% block foobar %} - {{- block('base_foobar') -}} - Content of block (first override) -{% endblock foobar %} ---TEMPLATE(file1.html.twig)-- -{% block foobar -%} - Content of block -{% endblock foobar %} ---DATA-- -return [] ---EXPECT-- -Content of block -Content of block (first override) -Content of block (second override) diff --git a/vendor/twig/twig/tests/Fixtures/tags/use/parent_block2.test b/vendor/twig/twig/tests/Fixtures/tags/use/parent_block2.test deleted file mode 100644 index 274baa8..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/use/parent_block2.test +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -"use" tag ---TEMPLATE-- -{% use 'file2.html.twig'%} -{% block foobar %} - {{- parent() -}} - Content of block (second override) -{% endblock foobar %} ---TEMPLATE(file2.html.twig)-- -{% use 'file1.html.twig' %} -{% block foobar %} - {{- parent() -}} - Content of block (first override) -{% endblock foobar %} ---TEMPLATE(file1.html.twig)-- -{% block foobar -%} - Content of block -{% endblock foobar %} ---DATA-- -return [] ---EXPECT-- -Content of block -Content of block (first override) -Content of block (second override) diff --git a/vendor/twig/twig/tests/Fixtures/tags/use/parent_block3.test b/vendor/twig/twig/tests/Fixtures/tags/use/parent_block3.test deleted file mode 100644 index f6f2212..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/use/parent_block3.test +++ /dev/null @@ -1,38 +0,0 @@ ---TEST-- -"use" tag ---TEMPLATE-- -{% use 'file2.html.twig' %} -{% use 'file1.html.twig' with foo %} -{% block foo %} - {{- parent() -}} - Content of foo (second override) -{% endblock foo %} -{% block bar %} - {{- parent() -}} - Content of bar (second override) -{% endblock bar %} ---TEMPLATE(file2.html.twig)-- -{% use 'file1.html.twig' %} -{% block foo %} - {{- parent() -}} - Content of foo (first override) -{% endblock foo %} -{% block bar %} - {{- parent() -}} - Content of bar (first override) -{% endblock bar %} ---TEMPLATE(file1.html.twig)-- -{% block foo -%} - Content of foo -{% endblock foo %} -{% block bar -%} - Content of bar -{% endblock bar %} ---DATA-- -return [] ---EXPECT-- -Content of foo -Content of foo (first override) -Content of foo (second override) -Content of bar -Content of bar (second override) diff --git a/vendor/twig/twig/tests/Fixtures/tags/use/use_with_parent.test b/vendor/twig/twig/tests/Fixtures/tags/use/use_with_parent.test deleted file mode 100644 index fad9a2d..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/use/use_with_parent.test +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -"use" tag with a parent block ---TEMPLATE-- -{% extends "parent.twig" %} - -{% use 'blocks.twig' %} - -{% block body %} - {{ parent() -}} - CHILD - {{ block('content') }} -{% endblock %} ---TEMPLATE(parent.twig)-- -{% block body %} - PARENT -{% endblock %} ---TEMPLATE(blocks.twig)-- -{% block content 'BLOCK' %} ---DATA-- -return [] ---EXPECT-- -PARENT -CHILD - BLOCK diff --git a/vendor/twig/twig/tests/Fixtures/tags/verbatim/basic.test b/vendor/twig/twig/tests/Fixtures/tags/verbatim/basic.test deleted file mode 100644 index 9b60abc..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/verbatim/basic.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -"verbatim" tag ---TEMPLATE-- -{% verbatim %} -{{ foo }} -{% endverbatim %} ---DATA-- -return [] ---EXPECT-- -{{ foo }} diff --git a/vendor/twig/twig/tests/Fixtures/tags/verbatim/mixed_usage_with_raw.test b/vendor/twig/twig/tests/Fixtures/tags/verbatim/mixed_usage_with_raw.test deleted file mode 100644 index 2177538..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/verbatim/mixed_usage_with_raw.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -"verbatim" tag ---TEMPLATE-- -{% verbatim %} -{{ foo }} -{% endraw %} ---DATA-- -return [] ---EXCEPTION-- -Twig\Error\SyntaxError: Unexpected end of file: Unclosed "verbatim" block in "index.twig" at line 2. diff --git a/vendor/twig/twig/tests/Fixtures/tags/verbatim/whitespace_control.test b/vendor/twig/twig/tests/Fixtures/tags/verbatim/whitespace_control.test deleted file mode 100644 index 501922b..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/verbatim/whitespace_control.test +++ /dev/null @@ -1,56 +0,0 @@ ---TEST-- -"verbatim" tag ---TEMPLATE-- -1*** - -{%- verbatim %} - {{ 'bla' }} -{% endverbatim %} - -1*** -2*** - -{%- verbatim -%} - {{ 'bla' }} -{% endverbatim %} - -2*** -3*** - -{%- verbatim -%} - {{ 'bla' }} -{% endverbatim -%} - -3*** -4*** - -{%- verbatim -%} - {{ 'bla' }} -{%- endverbatim %} - -4*** -5*** - -{%- verbatim -%} - {{ 'bla' }} -{%- endverbatim -%} - -5*** ---DATA-- -return [] ---EXPECT-- -1*** - {{ 'bla' }} - - -1*** -2***{{ 'bla' }} - - -2*** -3***{{ 'bla' }} -3*** -4***{{ 'bla' }} - -4*** -5***{{ 'bla' }}5*** diff --git a/vendor/twig/twig/tests/Fixtures/tags/with/basic.test b/vendor/twig/twig/tests/Fixtures/tags/with/basic.test deleted file mode 100644 index 7c2abd0..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/with/basic.test +++ /dev/null @@ -1,13 +0,0 @@ ---TEST-- -"with" tag ---TEMPLATE-- -{% with %} - {% set bar = 'BAZ' %} - {{ foo }}{{ bar }} -{% endwith %} -{{ foo }}{{ bar }} ---DATA-- -return ['foo' => 'foo', 'bar' => 'bar'] ---EXPECT-- -fooBAZ -foobar diff --git a/vendor/twig/twig/tests/Fixtures/tags/with/expression.test b/vendor/twig/twig/tests/Fixtures/tags/with/expression.test deleted file mode 100644 index e4433d4..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/with/expression.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -"with" tag with expression ---TEMPLATE-- -{% with {foo: 'foo', bar: 'BAZ'} %} - {{ foo }}{{ bar }} -{% endwith %} ---DATA-- -return ['foo' => 'baz'] ---EXPECT-- -fooBAZ diff --git a/vendor/twig/twig/tests/Fixtures/tags/with/globals.test b/vendor/twig/twig/tests/Fixtures/tags/with/globals.test deleted file mode 100644 index b030e7e..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/with/globals.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -"with" tag ---TEMPLATE-- -{% with [] only %} - {{ global }} -{% endwith %} ---DATA-- -return [] ---EXPECT-- -global diff --git a/vendor/twig/twig/tests/Fixtures/tags/with/iterable.test b/vendor/twig/twig/tests/Fixtures/tags/with/iterable.test deleted file mode 100644 index 1b0cbc6..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/with/iterable.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -"with" tag with an iterable expression ---TEMPLATE-- -{% with vars %} - {{ foo }}{{ bar }} -{% endwith %} ---DATA-- -return ['vars' => new ArrayObject(['foo' => 'baz', 'bar' => 'qux'])] ---EXPECT-- -bazqux diff --git a/vendor/twig/twig/tests/Fixtures/tags/with/nested.test b/vendor/twig/twig/tests/Fixtures/tags/with/nested.test deleted file mode 100644 index 33ca390..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/with/nested.test +++ /dev/null @@ -1,15 +0,0 @@ ---TEST-- -nested "with" tags ---TEMPLATE-- -{% set foo, bar = 'foo', 'bar' %} -{% with {bar: 'BAZ'} %} - {% with {foo: 'FOO'} %} - {{ foo }}{{ bar }} - {% endwith %} -{% endwith %} -{{ foo }}{{ bar }} ---DATA-- -return [] ---EXPECT-- -FOOBAZ - foobar diff --git a/vendor/twig/twig/tests/Fixtures/tags/with/with_no_hash.test b/vendor/twig/twig/tests/Fixtures/tags/with/with_no_hash.test deleted file mode 100644 index 7083050..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/with/with_no_hash.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -"with" tag with an expression that is not a hash ---TEMPLATE-- -{% with vars %} - {{ foo }}{{ bar }} -{% endwith %} ---DATA-- -return ['vars' => 'no-hash'] ---EXCEPTION-- -Twig\Error\RuntimeError: Variables passed to the "with" tag must be a hash in "index.twig" at line 2. diff --git a/vendor/twig/twig/tests/Fixtures/tags/with/with_only.test b/vendor/twig/twig/tests/Fixtures/tags/with/with_only.test deleted file mode 100644 index 1aca34f..0000000 --- a/vendor/twig/twig/tests/Fixtures/tags/with/with_only.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -"with" tag with expression and only ---TEMPLATE-- -{% with {foo: 'foo', bar: 'BAZ'} only %} - {{ foo }}{{ bar }}{{ baz }} -{% endwith %} ---DATA-- -return ['foo' => 'baz', 'baz' => 'baz'] ---EXCEPTION-- -Twig\Error\RuntimeError: Variable "baz" does not exist in "index.twig" at line 3. diff --git a/vendor/twig/twig/tests/Fixtures/tests/array.test b/vendor/twig/twig/tests/Fixtures/tests/array.test deleted file mode 100644 index 7c9a6c8..0000000 --- a/vendor/twig/twig/tests/Fixtures/tests/array.test +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -array index test ---TEMPLATE-- -{% for key, value in days %} -{{ key }} -{% endfor %} ---DATA-- -return ['days' => [ - 1 => ['money' => 9], - 2 => ['money' => 21], - 3 => ['money' => 38], - 4 => ['money' => 6], - 18 => ['money' => 6], - 19 => ['money' => 3], - 31 => ['money' => 11], -]] ---EXPECT-- -1 -2 -3 -4 -18 -19 -31 diff --git a/vendor/twig/twig/tests/Fixtures/tests/constant.test b/vendor/twig/twig/tests/Fixtures/tests/constant.test deleted file mode 100644 index d4a9be7..0000000 --- a/vendor/twig/twig/tests/Fixtures/tests/constant.test +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -"const" test ---TEMPLATE-- -{{ 8 is constant('E_NOTICE') ? 'ok' : 'no' }} -{{ 'bar' is constant('Twig\\Tests\\TwigTestFoo::BAR_NAME') ? 'ok' : 'no' }} -{{ value is constant('Twig\\Tests\\TwigTestFoo::BAR_NAME') ? 'ok' : 'no' }} -{{ 2 is constant('ARRAY_AS_PROPS', object) ? 'ok' : 'no' }} ---DATA-- -return ['value' => 'bar', 'object' => new \ArrayObject(['hi'])] ---EXPECT-- -ok -ok -ok -ok \ No newline at end of file diff --git a/vendor/twig/twig/tests/Fixtures/tests/defined.test b/vendor/twig/twig/tests/Fixtures/tests/defined.test deleted file mode 100644 index 1648c66..0000000 --- a/vendor/twig/twig/tests/Fixtures/tests/defined.test +++ /dev/null @@ -1,129 +0,0 @@ ---TEST-- -"defined" test ---TEMPLATE-- -{{ definedVar is defined ? 'ok' : 'ko' }} -{{ definedVar is not defined ? 'ko' : 'ok' }} -{{ undefinedVar is defined ? 'ko' : 'ok' }} -{{ undefinedVar is not defined ? 'ok' : 'ko' }} -{{ zeroVar is defined ? 'ok' : 'ko' }} -{{ nullVar is defined ? 'ok' : 'ko' }} -{{ nested.definedVar is defined ? 'ok' : 'ko' }} -{{ nested['definedVar'] is defined ? 'ok' : 'ko' }} -{{ nested.definedVar is not defined ? 'ko' : 'ok' }} -{{ nested.undefinedVar is defined ? 'ko' : 'ok' }} -{{ nested['undefinedVar'] is defined ? 'ko' : 'ok' }} -{{ nested.undefinedVar is not defined ? 'ok' : 'ko' }} -{{ nested.zeroVar is defined ? 'ok' : 'ko' }} -{{ nested.nullVar is defined ? 'ok' : 'ko' }} -{{ nested.definedArray.0 is defined ? 'ok' : 'ko' }} -{{ nested['definedArray'][0] is defined ? 'ok' : 'ko' }} -{{ object.foo is defined ? 'ok' : 'ko' }} -{{ object.undefinedMethod is defined ? 'ko' : 'ok' }} -{{ object.getFoo() is defined ? 'ok' : 'ko' }} -{{ object.getFoo('a') is defined ? 'ok' : 'ko' }} -{{ object.undefinedMethod() is defined ? 'ko' : 'ok' }} -{{ object.undefinedMethod('a') is defined ? 'ko' : 'ok' }} -{{ object.self.foo is defined ? 'ok' : 'ko' }} -{{ object.self.undefinedMethod is defined ? 'ko' : 'ok' }} -{{ object.undefinedMethod.self is defined ? 'ko' : 'ok' }} -{{ 0 is defined ? 'ok' : 'ko' }} -{{ "foo" is defined ? 'ok' : 'ko' }} -{{ true is defined ? 'ok' : 'ko' }} -{{ false is defined ? 'ok' : 'ko' }} -{{ null is defined ? 'ok' : 'ko' }} -{{ [1, 2] is defined ? 'ok' : 'ko' }} -{{ { foo: "bar" } is defined ? 'ok' : 'ko' }} ---DATA-- -return [ - 'definedVar' => 'defined', - 'zeroVar' => 0, - 'nullVar' => null, - 'nested' => [ - 'definedVar' => 'defined', - 'zeroVar' => 0, - 'nullVar' => null, - 'definedArray' => [0], - ], - 'object' => new Twig\Tests\TwigTestFoo(), -] ---EXPECT-- -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok ---DATA-- -return [ - 'definedVar' => 'defined', - 'zeroVar' => 0, - 'nullVar' => null, - 'nested' => [ - 'definedVar' => 'defined', - 'zeroVar' => 0, - 'nullVar' => null, - 'definedArray' => [0], - ], - 'object' => new Twig\Tests\TwigTestFoo(), -] ---CONFIG-- -return ['strict_variables' => false] ---EXPECT-- -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok diff --git a/vendor/twig/twig/tests/Fixtures/tests/defined_for_attribute.test b/vendor/twig/twig/tests/Fixtures/tests/defined_for_attribute.test deleted file mode 100644 index 5fd2fe3..0000000 --- a/vendor/twig/twig/tests/Fixtures/tests/defined_for_attribute.test +++ /dev/null @@ -1,35 +0,0 @@ ---TEST-- -"defined" support for attribute ---TEMPLATE-- -{{ attribute(nested, "definedVar") is defined ? 'ok' : 'ko' }} -{{ attribute(nested, "undefinedVar") is not defined ? 'ok' : 'ko' }} -{{ attribute(nested, definedVarName) is defined ? 'ok' : 'ko' }} -{{ attribute(nested, undefinedVarName) is not defined ? 'ok' : 'ko' }} ---DATA-- -return [ - 'nested' => [ - 'definedVar' => 'defined', - ], - 'definedVarName' => 'definedVar', - 'undefinedVarName' => 'undefinedVar', -] ---EXPECT-- -ok -ok -ok -ok ---DATA-- -return [ - 'nested' => [ - 'definedVar' => 'defined', - ], - 'definedVarName' => 'definedVar', - 'undefinedVarName' => 'undefinedVar', -] ---CONFIG-- -return ['strict_variables' => false] ---EXPECT-- -ok -ok -ok -ok diff --git a/vendor/twig/twig/tests/Fixtures/tests/defined_for_blocks.test b/vendor/twig/twig/tests/Fixtures/tests/defined_for_blocks.test deleted file mode 100644 index c8b90f8..0000000 --- a/vendor/twig/twig/tests/Fixtures/tests/defined_for_blocks.test +++ /dev/null @@ -1,38 +0,0 @@ ---TEST-- -"defined" support for blocks ---TEMPLATE-- -{% extends 'parent' %} -{% block icon %}icon{% endblock %} -{% block body %} - {{ parent() }} - {{ block('foo') is defined ? 'ok' : 'ko' }} - {{ block('footer') is defined ? 'ok' : 'ko' }} - {{ block('icon') is defined ? 'ok' : 'ko' }} - {{ block('block1') is defined ? 'ok' : 'ko' }} - {%- embed 'embed' %} - {% block content %}content{% endblock %} - {% endembed %} -{% endblock %} -{% use 'blocks' %} ---TEMPLATE(parent)-- -{% block body %} - {{ block('icon') is defined ? 'ok' : 'ko' -}} -{% endblock %} -{% block footer %}{% endblock %} ---TEMPLATE(embed)-- -{{ block('icon') is defined ? 'ok' : 'ko' }} -{{ block('content') is defined ? 'ok' : 'ko' }} -{{ block('block1') is defined ? 'ok' : 'ko' }} ---TEMPLATE(blocks)-- -{% block block1 %}{%endblock %} ---DATA-- -return [] ---EXPECT-- -ok - ko - ok - ok - ok -ko -ok -ko diff --git a/vendor/twig/twig/tests/Fixtures/tests/defined_for_blocks_with_template.test b/vendor/twig/twig/tests/Fixtures/tests/defined_for_blocks_with_template.test deleted file mode 100644 index 68540de..0000000 --- a/vendor/twig/twig/tests/Fixtures/tests/defined_for_blocks_with_template.test +++ /dev/null @@ -1,17 +0,0 @@ ---TEST-- -"defined" support for blocks with a template argument ---TEMPLATE-- -{{ block('foo', 'included.twig') is defined ? 'ok' : 'ko' }} -{{ block('foo', included_loaded) is defined ? 'ok' : 'ko' }} -{{ block('foo', included_loaded_internal) is defined ? 'ok' : 'ko' }} ---TEMPLATE(included.twig)-- -{% block foo %}FOO{% endblock %} ---DATA-- -return [ - 'included_loaded' => $twig->load('included.twig'), - 'included_loaded_internal' => $twig->load('included.twig'), -] ---EXPECT-- -ok -ok -ok diff --git a/vendor/twig/twig/tests/Fixtures/tests/defined_for_constants.test b/vendor/twig/twig/tests/Fixtures/tests/defined_for_constants.test deleted file mode 100644 index 62172e4..0000000 --- a/vendor/twig/twig/tests/Fixtures/tests/defined_for_constants.test +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -"defined" support for constants ---TEMPLATE-- -{{ constant('DATE_W3C') is defined ? 'ok' : 'ko' }} -{{ constant('ARRAY_AS_PROPS', object) is defined ? 'ok' : 'ko' }} -{{ constant('FOOBAR') is not defined ? 'ok' : 'ko' }} -{{ constant('FOOBAR', object) is not defined ? 'ok' : 'ko' }} ---DATA-- -return ['expect' => DATE_W3C, 'object' => new \ArrayObject(['hi'])] ---EXPECT-- -ok -ok -ok -ok diff --git a/vendor/twig/twig/tests/Fixtures/tests/defined_on_complex_expr.test b/vendor/twig/twig/tests/Fixtures/tests/defined_on_complex_expr.test deleted file mode 100644 index 2d06158..0000000 --- a/vendor/twig/twig/tests/Fixtures/tests/defined_on_complex_expr.test +++ /dev/null @@ -1,8 +0,0 @@ ---TEST-- -"defined" support for "complex" expressions ---TEMPLATE-- -{{ (1 + 2) is defined ? 'ok' : 'ko' }} ---DATA-- -return [] ---EXCEPTION-- -Twig\Error\SyntaxError: The "defined" test only works with simple variables in "index.twig" at line 2. diff --git a/vendor/twig/twig/tests/Fixtures/tests/dynamic_test.test b/vendor/twig/twig/tests/Fixtures/tests/dynamic_test.test deleted file mode 100644 index 41625f6..0000000 --- a/vendor/twig/twig/tests/Fixtures/tests/dynamic_test.test +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -dynamic test ---TEMPLATE-- -{{ 'bar' is test_bar ? '1' :'0' }} -{{ 'foo' is test_foo ? '1' :'0' }} -{{ 'bar' is test_foo ? '1' :'0' }} -{{ 'foo' is test_bar ? '1' :'0' }} ---DATA-- -return [] ---EXPECT-- -1 -1 -0 -0 diff --git a/vendor/twig/twig/tests/Fixtures/tests/empty.test b/vendor/twig/twig/tests/Fixtures/tests/empty.test deleted file mode 100644 index ffcd518..0000000 --- a/vendor/twig/twig/tests/Fixtures/tests/empty.test +++ /dev/null @@ -1,54 +0,0 @@ ---TEST-- -"empty" test ---TEMPLATE-- -{{ string_empty is empty ? 'ok' : 'ko' }} -{{ string_zero is empty ? 'ko' : 'ok' }} -{{ value_null is empty ? 'ok' : 'ko' }} -{{ value_false is empty ? 'ok' : 'ko' }} -{{ value_int_zero is empty ? 'ko' : 'ok' }} -{{ array_empty is empty ? 'ok' : 'ko' }} -{{ array_not_empty is empty ? 'ko' : 'ok' }} -{{ magically_callable is empty ? 'ko' : 'ok' }} -{{ countable_empty is empty ? 'ok' : 'ko' }} -{{ countable_not_empty is empty ? 'ko' : 'ok' }} -{{ tostring_empty is empty ? 'ok' : 'ko' }} -{{ tostring_not_empty is empty ? 'ko' : 'ok' }} -{{ markup_empty is empty ? 'ok' : 'ko' }} -{{ markup_not_empty is empty ? 'ko' : 'ok' }} -{{ iterator is empty ? 'ko' : 'ok' }} -{{ empty_iterator is empty ? 'ok' : 'ko' }} -{{ callback_iterator is empty ? 'ko' : 'ok' }} -{{ empty_callback_iterator is empty ? 'ok' : 'ko' }} ---DATA-- -return [ - 'string_empty' => '', 'string_zero' => '0', - 'value_null' => null, 'value_false' => false, 'value_int_zero' => 0, - 'array_empty' => [], 'array_not_empty' => [1, 2], - 'magically_callable' => new \Twig\Tests\MagicCallStub(), - 'countable_empty' => new \Twig\Tests\CountableStub([]), 'countable_not_empty' => new \Twig\Tests\CountableStub([1, 2]), - 'tostring_empty' => new \Twig\Tests\ToStringStub(''), 'tostring_not_empty' => new \Twig\Tests\ToStringStub('0' /* edge case of using "0" as the string */), - 'markup_empty' => new \Twig\Markup('', 'UTF-8'), 'markup_not_empty' => new \Twig\Markup('test', 'UTF-8'), - 'iterator' => $iter = new \ArrayIterator(['bar', 'foo']), - 'empty_iterator' => new \ArrayIterator(), - 'callback_iterator' => new \CallbackFilterIterator($iter, function ($el) { return true; }), - 'empty_callback_iterator' => new \CallbackFilterIterator($iter, function ($el) { return false; }), -] ---EXPECT-- -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok diff --git a/vendor/twig/twig/tests/Fixtures/tests/even.test b/vendor/twig/twig/tests/Fixtures/tests/even.test deleted file mode 100644 index 5c73b01..0000000 --- a/vendor/twig/twig/tests/Fixtures/tests/even.test +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -"even" test ---TEMPLATE-- -{{ 1 is even ? 'ko' : 'ok' }} -{{ 2 is even ? 'ok' : 'ko' }} -{{ 1 is not even ? 'ok' : 'ko' }} -{{ 2 is not even ? 'ko' : 'ok' }} ---DATA-- -return [] ---EXPECT-- -ok -ok -ok -ok diff --git a/vendor/twig/twig/tests/Fixtures/tests/in.test b/vendor/twig/twig/tests/Fixtures/tests/in.test deleted file mode 100644 index f7b172e..0000000 --- a/vendor/twig/twig/tests/Fixtures/tests/in.test +++ /dev/null @@ -1,118 +0,0 @@ ---TEST-- -Twig supports the in operator ---TEMPLATE-- -{{ bar in foo ? 'OK' : 'KO' }} -{{ not (bar in foo) ? 'KO' : 'OK' }} -{{ bar not in foo ? 'KO' : 'OK' }} -{{ 'a' in bar ? 'OK' : 'KO' }} -{{ 'c' not in bar ? 'OK' : 'KO' }} -{{ '' in bar ? 'OK' : 'KO' }} -{{ '' in '' ? 'OK' : 'KO' }} -{{ '0' not in '' ? 'OK' : 'KO' }} -{{ 'a' not in '0' ? 'OK' : 'KO' }} -{{ '0' in '0' ? 'OK' : 'KO' }} - -{{ false in [0, 1] ? 'OK' : 'KO' }} -{{ true in [0, 1] ? 'OK' : 'KO' }} -{{ '0' in [0, 1] ? 'OK' : 'KO' }} -{{ '0' in [1, 0] ? 'OK' : 'KO' }} -{{ '' in [0, 1] ? 'OK' : 'KO' }} -{{ '' in [1, 0] ? 'OK' : 'KO' }} -{{ 0 in ['', 1] ? 'OK' : 'KO' }} -{{ 0 in [1, ''] ? 'OK' : 'KO' }} - -{{ '' in 'foo' ? 'OK' : 'KO' }} -{{ 0 in 'foo' ? 'KO' : 'OK' }} -{{ false in 'foo' ? 'KO' : 'OK' }} -{{ false in '100' ? 'KO' : 'OK' }} -{{ true in '100' ? 'KO' : 'OK' }} - -{{ [] in [true, false] ? 'OK' : 'KO' }} -{{ [] in [true, ''] ? 'KO' : 'OK' }} -{{ [] in [true, []] ? 'OK' : 'KO' }} - -{{ resource ? 'OK' : 'KO' }} -{{ resource in 'foo'~resource ? 'KO' : 'OK' }} -{{ object in 'stdClass' ? 'KO' : 'OK' }} -{{ [] in 'Array' ? 'KO' : 'OK' }} -{{ dir_object in 'foo'~dir_object ? 'KO' : 'OK' }} - -{{ ''~resource in resource ? 'KO' : 'OK' }} -{{ 'stdClass' in object ? 'KO' : 'OK' }} -{{ 'Array' in [] ? 'KO' : 'OK' }} -{{ ''~dir_object in dir_object ? 'KO' : 'OK' }} - -{{ resource in [''~resource] ? 'KO' : 'OK' }} -{{ resource in [resource + 1 - 1] ? 'KO' : 'OK' }} -{{ dir_object in [''~dir_object] ? 'KO' : 'OK' }} - -{{ 5 in 125 ? 'KO' : 'OK' }} -{{ 5 in '125' ? 'OK' : 'KO' }} -{{ '5' in 125 ? 'KO' : 'OK' }} -{{ '5' in '125' ? 'OK' : 'KO' }} - -{{ 5.5 in 125.5 ? 'KO' : 'OK' }} -{{ 5.5 in '125.5' ? 'OK' : 'KO' }} -{{ '5.5' in 125.5 ? 'KO' : 'OK' }} - -{{ safe in ['foo', 'bar'] ? 'OK' : 'KO' }} -{{ 'fo' in safe ? 'OK' : 'KO' }} ---DATA-- -return ['bar' => 'bar', 'foo' => ['bar' => 'bar'], 'dir_object' => new \SplFileInfo(dirname(__FILE__)), 'object' => new \stdClass(), 'resource' => opendir(dirname(__FILE__)), 'safe' => new \Twig\Markup('foo', 'UTF-8')] ---EXPECT-- -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK - -OK -OK -OK -OK -OK -OK -OK -OK - -OK -OK -OK -OK -OK - -OK -OK -OK - -OK -OK -OK -OK -OK - -OK -OK -OK -OK - -OK -OK -OK - -OK -OK -OK -OK - -OK -OK -OK - -OK -OK diff --git a/vendor/twig/twig/tests/Fixtures/tests/in_with_objects.test b/vendor/twig/twig/tests/Fixtures/tests/in_with_objects.test deleted file mode 100644 index 1f9fc63..0000000 --- a/vendor/twig/twig/tests/Fixtures/tests/in_with_objects.test +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -Twig supports the in operator when using objects ---TEMPLATE-- -{% if object in object_list %} -TRUE -{% endif %} ---DATA-- -$foo = new Twig\Tests\TwigTestFoo(); -$foo1 = new Twig\Tests\TwigTestFoo(); - -$foo->position = $foo1; -$foo1->position = $foo; - -return [ - 'object' => $foo, - 'object_list' => [$foo1, $foo], -] ---EXPECT-- -TRUE diff --git a/vendor/twig/twig/tests/Fixtures/tests/iterable.test b/vendor/twig/twig/tests/Fixtures/tests/iterable.test deleted file mode 100644 index 75b5756..0000000 --- a/vendor/twig/twig/tests/Fixtures/tests/iterable.test +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -"iterable" test ---TEMPLATE-- -{{ foo is iterable ? 'ok' : 'ko' }} -{{ traversable is iterable ? 'ok' : 'ko' }} -{{ obj is iterable ? 'ok' : 'ko' }} -{{ val is iterable ? 'ok' : 'ko' }} ---DATA-- -return [ - 'foo' => [], - 'traversable' => new \ArrayIterator([]), - 'obj' => new \stdClass(), - 'val' => 'test', -] ---EXPECT-- -ok -ok -ko -ko \ No newline at end of file diff --git a/vendor/twig/twig/tests/Fixtures/tests/null_coalesce.test b/vendor/twig/twig/tests/Fixtures/tests/null_coalesce.test deleted file mode 100644 index 7af3255..0000000 --- a/vendor/twig/twig/tests/Fixtures/tests/null_coalesce.test +++ /dev/null @@ -1,30 +0,0 @@ ---TEST-- -Twig supports the ?? operator ---TEMPLATE-- -{{ 'OK' ?? 'KO' }} -{{ null ?? 'OK' }} -{{ bar ?? 'KO' }} -{{ baz ?? 'OK' }} -{{ foo.bar ?? 'KO' }} -{{ foo.missing ?? 'OK' }} -{{ foo.bar.baz.missing ?? 'OK' }} -{{ foo['bar'] ?? 'KO' }} -{{ foo['missing'] ?? 'OK' }} -{{ nope ?? nada ?? 'OK' }} -{{ 1 + nope ?? nada ?? 2 }} -{{ 1 + nope ?? 3 + nada ?? 2 }} ---DATA-- -return ['bar' => 'OK', 'foo' => ['bar' => 'OK']] ---EXPECT-- -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -3 -6 diff --git a/vendor/twig/twig/tests/Fixtures/tests/odd.test b/vendor/twig/twig/tests/Fixtures/tests/odd.test deleted file mode 100644 index ec88bb5..0000000 --- a/vendor/twig/twig/tests/Fixtures/tests/odd.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -"odd" test ---TEMPLATE-- -{{ 1 is odd ? 'ok' : 'ko' }} -{{ 2 is odd ? 'ko' : 'ok' }} ---DATA-- -return [] ---EXPECT-- -ok -ok \ No newline at end of file diff --git a/vendor/twig/twig/tests/Fixtures/whitespace/trim_block.test b/vendor/twig/twig/tests/Fixtures/whitespace/trim_block.test deleted file mode 100644 index 346a110..0000000 --- a/vendor/twig/twig/tests/Fixtures/whitespace/trim_block.test +++ /dev/null @@ -1,68 +0,0 @@ ---TEST-- -Whitespace trimming on tags. ---TEMPLATE-- -Trim on control tag: -{% for i in range(1, 9) -%} - {{ i }} -{%- endfor %} - - -Trim on output tag: -{% for i in range(1, 9) %} - {{- i -}} -{% endfor %} - - -Trim comments: - -{#- Invisible -#} - -After the comment. - -Trim leading space: -{% if leading %} - - {{- leading }} -{% endif %} - -{%- if leading %} - {{- leading }} - -{%- endif %} - - -Trim trailing space: -{% if trailing -%} - {{ trailing -}} - -{% endif -%} - -Combined: - -{%- if both -%} -
      -
    • {{- both -}}
    • -
    - -{%- endif -%} - -end ---DATA-- -return ['leading' => 'leading space', 'trailing' => 'trailing space', 'both' => 'both'] ---EXPECT-- -Trim on control tag: -123456789 - -Trim on output tag: -123456789 - -Trim comments:After the comment. - -Trim leading space: -leading space -leading space - -Trim trailing space: -trailing spaceCombined:
      -
    • both
    • -
    end diff --git a/vendor/twig/twig/tests/Fixtures/whitespace/trim_delimiter_as_strings.test b/vendor/twig/twig/tests/Fixtures/whitespace/trim_delimiter_as_strings.test deleted file mode 100644 index a58818d..0000000 --- a/vendor/twig/twig/tests/Fixtures/whitespace/trim_delimiter_as_strings.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -Whitespace trimming as strings. ---TEMPLATE-- -{{ 5 * '{#-'|length }} -{{ '{{-'|length * 5 + '{%-'|length }} ---DATA-- -return [] ---EXPECT-- -15 -18 diff --git a/vendor/twig/twig/tests/Fixtures/whitespace/trim_left.test b/vendor/twig/twig/tests/Fixtures/whitespace/trim_left.test deleted file mode 100644 index 75d0f80..0000000 --- a/vendor/twig/twig/tests/Fixtures/whitespace/trim_left.test +++ /dev/null @@ -1,32 +0,0 @@ ---TEST-- -Whitespace trimming on tags (left side). ---TEMPLATE-- -**{% if true %} -foo - - {%- endif %}** - -** - - {{- 'foo' }}** - -** - - -{#- comment #}** - -**{% verbatim %} -foo - - {%- endverbatim %}** ---DATA-- -return [] ---EXPECT-- -**foo** - -**foo** - -**** - -** -foo** diff --git a/vendor/twig/twig/tests/Fixtures/whitespace/trim_line_left.test b/vendor/twig/twig/tests/Fixtures/whitespace/trim_line_left.test deleted file mode 100644 index e5e845f..0000000 --- a/vendor/twig/twig/tests/Fixtures/whitespace/trim_line_left.test +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -Line whitespace trimming on tags (left side). ---TEMPLATE-- -**{% if true %} -foo - {%~ endif %}** - -** - {{~ 'foo' }}** - -** - {#~ comment #}** - -**{% verbatim %} -foo - - {%~ endverbatim %}** ---DATA-- -return [] ---EXPECT-- -**foo -** - -** -foo** - -** -** - -** -foo - -** diff --git a/vendor/twig/twig/tests/Fixtures/whitespace/trim_line_right.test b/vendor/twig/twig/tests/Fixtures/whitespace/trim_line_right.test deleted file mode 100644 index e7b510c..0000000 --- a/vendor/twig/twig/tests/Fixtures/whitespace/trim_line_right.test +++ /dev/null @@ -1,32 +0,0 @@ ---TEST-- -Line whitespace trimming on tags (right side). ---TEMPLATE-- -**{% if true ~%} -foo{% endif %}** - -**{{ 'foo' ~}} -foo -** - -**{# comment ~#} - foo -** - -**{% verbatim ~%} - foo{% endverbatim %}** ---DATA-- -return [] ---EXPECT-- -** -foo** - -**foo -foo -** - -** - foo -** - -** - foo** diff --git a/vendor/twig/twig/tests/Fixtures/whitespace/trim_right.test b/vendor/twig/twig/tests/Fixtures/whitespace/trim_right.test deleted file mode 100644 index 0ec3b0c..0000000 --- a/vendor/twig/twig/tests/Fixtures/whitespace/trim_right.test +++ /dev/null @@ -1,28 +0,0 @@ ---TEST-- -Whitespace trimming on tags (right side). ---TEMPLATE-- -**{% if true -%} - - foo{% endif %}** - -**{{ 'foo' -}} - -** - -**{# comment -#} - -** - -**{% verbatim -%} - -foo{% endverbatim %}** ---DATA-- -return [] ---EXPECT-- -**foo** - -**foo** - -**** - -**foo** diff --git a/vendor/twig/twig/tests/IntegrationTest.php b/vendor/twig/twig/tests/IntegrationTest.php deleted file mode 100644 index 243aadb..0000000 --- a/vendor/twig/twig/tests/IntegrationTest.php +++ /dev/null @@ -1,386 +0,0 @@ -position = 0; - } - - public function current() - { - return $this->array[$this->position]; - } - - public function key() - { - return 'a'; - } - - public function next() - { - ++$this->position; - } - - public function valid() - { - return isset($this->array[$this->position]); - } -} - -class TwigTestTokenParser_§ extends AbstractTokenParser -{ - public function parse(Token $token) - { - $this->parser->getStream()->expect(Token::BLOCK_END_TYPE); - - return new PrintNode(new ConstantExpression('§', -1), -1); - } - - public function getTag() - { - return '§'; - } -} - -class TwigTestExtension extends AbstractExtension -{ - public function getTokenParsers() - { - return [ - new TwigTestTokenParser_§(), - ]; - } - - public function getFilters() - { - return [ - new TwigFilter('§', [$this, '§Filter']), - new TwigFilter('escape_and_nl2br', [$this, 'escape_and_nl2br'], ['needs_environment' => true, 'is_safe' => ['html']]), - new TwigFilter('nl2br', [$this, 'nl2br'], ['pre_escape' => 'html', 'is_safe' => ['html']]), - new TwigFilter('escape_something', [$this, 'escape_something'], ['is_safe' => ['something']]), - new TwigFilter('preserves_safety', [$this, 'preserves_safety'], ['preserves_safety' => ['html']]), - new TwigFilter('static_call_string', 'Twig\Tests\TwigTestExtension::staticCall'), - new TwigFilter('static_call_array', ['Twig\Tests\TwigTestExtension', 'staticCall']), - new TwigFilter('magic_call', [$this, 'magicCall']), - new TwigFilter('magic_call_string', 'Twig\Tests\TwigTestExtension::magicStaticCall'), - new TwigFilter('magic_call_array', ['Twig\Tests\TwigTestExtension', 'magicStaticCall']), - new TwigFilter('*_path', [$this, 'dynamic_path']), - new TwigFilter('*_foo_*_bar', [$this, 'dynamic_foo']), - ]; - } - - public function getFunctions() - { - return [ - new TwigFunction('§', [$this, '§Function']), - new TwigFunction('safe_br', [$this, 'br'], ['is_safe' => ['html']]), - new TwigFunction('unsafe_br', [$this, 'br']), - new TwigFunction('static_call_string', 'Twig\Tests\TwigTestExtension::staticCall'), - new TwigFunction('static_call_array', ['Twig\Tests\TwigTestExtension', 'staticCall']), - new TwigFunction('*_path', [$this, 'dynamic_path']), - new TwigFunction('*_foo_*_bar', [$this, 'dynamic_foo']), - ]; - } - - public function getTests() - { - return [ - new TwigTest('multi word', [$this, 'is_multi_word']), - new TwigTest('test_*', [$this, 'dynamic_test']), - ]; - } - - public function §Filter($value) - { - return "§{$value}§"; - } - - public function §Function($value) - { - return "§{$value}§"; - } - - /** - * nl2br which also escapes, for testing escaper filters. - */ - public function escape_and_nl2br($env, $value, $sep = '
    ') - { - return $this->nl2br(twig_escape_filter($env, $value, 'html'), $sep); - } - - /** - * nl2br only, for testing filters with pre_escape. - */ - public function nl2br($value, $sep = '
    ') - { - // not secure if $value contains html tags (not only entities) - // don't use - return str_replace("\n", "$sep\n", $value); - } - - public function dynamic_path($element, $item) - { - return $element.'/'.$item; - } - - public function dynamic_foo($foo, $bar, $item) - { - return $foo.'/'.$bar.'/'.$item; - } - - public function dynamic_test($element, $item) - { - return $element === $item; - } - - public function escape_something($value) - { - return strtoupper($value); - } - - public function preserves_safety($value) - { - return strtoupper($value); - } - - public static function staticCall($value) - { - return "*$value*"; - } - - public function br() - { - return '
    '; - } - - public function is_multi_word($value) - { - return false !== strpos($value, ' '); - } - - public function __call($method, $arguments) - { - if ('magicCall' !== $method) { - throw new \BadMethodCallException('Unexpected call to __call'); - } - - return 'magic_'.$arguments[0]; - } - - public static function __callStatic($method, $arguments) - { - if ('magicStaticCall' !== $method) { - throw new \BadMethodCallException('Unexpected call to __callStatic'); - } - - return 'static_magic_'.$arguments[0]; - } -} - -/** - * This class is used in tests for the "length" filter and "empty" test. It asserts that __call is not - * used to convert such objects to strings. - */ -class MagicCallStub -{ - public function __call($name, $args) - { - throw new \Exception('__call shall not be called'); - } -} - -class ToStringStub -{ - /** - * @var string - */ - private $string; - - public function __construct($string) - { - $this->string = $string; - } - - public function __toString() - { - return $this->string; - } -} - -/** - * This class is used in tests for the length filter and empty test to show - * that when \Countable is implemented, it is preferred over the __toString() - * method. - */ -class CountableStub implements \Countable -{ - private $count; - - public function __construct($count) - { - $this->count = $count; - } - - public function count() - { - return $this->count; - } - - public function __toString() - { - throw new \Exception('__toString shall not be called on \Countables'); - } -} - -/** - * This class is used in tests for the length filter. - */ -class IteratorAggregateStub implements \IteratorAggregate -{ - private $data; - - public function __construct(array $data) - { - $this->data = $data; - } - - public function getIterator() - { - return new \ArrayIterator($this->data); - } -} - -class SimpleIteratorForTesting implements \Iterator -{ - private $data = [1, 2, 3, 4, 5, 6, 7]; - private $key = 0; - - public function current() - { - return $this->key; - } - - public function next() - { - ++$this->key; - } - - public function key() - { - return $this->key; - } - - public function valid() - { - return isset($this->data[$this->key]); - } - - public function rewind() - { - $this->key = 0; - } - - public function __toString() - { - // for testing, make sure string length returned is not the same as the `iterator_count` - return str_repeat('X', iterator_count($this) + 10); - } -} diff --git a/vendor/twig/twig/tests/LegacyFixtures/autoescape/filename.legacy.test b/vendor/twig/twig/tests/LegacyFixtures/autoescape/filename.legacy.test deleted file mode 100644 index d25f75e..0000000 --- a/vendor/twig/twig/tests/LegacyFixtures/autoescape/filename.legacy.test +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -"filename" autoescape strategy ---TEMPLATE-- -{{ br -}} -{{ include('index.html.twig') -}} -{{ include('index.txt.twig') -}} ---TEMPLATE(index.html.twig)-- -{{ br -}} ---TEMPLATE(index.txt.twig)-- -{{ br -}} ---DATA-- -return ['br' => '
    '] ---CONFIG-- -return ['autoescape' => 'filename'] ---EXPECT-- -<br /> -<br /> -
    diff --git a/vendor/twig/twig/tests/LegacyFixtures/functions/undefined_block.legacy.test b/vendor/twig/twig/tests/LegacyFixtures/functions/undefined_block.legacy.test deleted file mode 100644 index e52c3b2..0000000 --- a/vendor/twig/twig/tests/LegacyFixtures/functions/undefined_block.legacy.test +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -"block" function with undefined block ---TEMPLATE-- -{% extends "base.twig" %} -{% block foo %}{{ parent() }}{{ block('unknown') }}{{ block('bar') }}{% endblock %} ---TEMPLATE(base.twig)-- -{% block foo %}Foo{% endblock %} -{% block bar %}Bar{% endblock %} ---DATA-- -return [] ---EXPECT-- -FooBarBar diff --git a/vendor/twig/twig/tests/LegacyFixtures/test.legacy.test b/vendor/twig/twig/tests/LegacyFixtures/test.legacy.test deleted file mode 100644 index 4bd1f6a..0000000 --- a/vendor/twig/twig/tests/LegacyFixtures/test.legacy.test +++ /dev/null @@ -1,8 +0,0 @@ ---TEST-- -Old test classes usage ---TEMPLATE-- -{{ 'foo' is multi word ? 'yes' : 'no' }} ---DATA-- -return [] ---EXPECT-- -no diff --git a/vendor/twig/twig/tests/LegacyIntegrationTest.php b/vendor/twig/twig/tests/LegacyIntegrationTest.php deleted file mode 100644 index db556f3..0000000 --- a/vendor/twig/twig/tests/LegacyIntegrationTest.php +++ /dev/null @@ -1,59 +0,0 @@ - new \Twig_Test_Method($this, 'is_multi_word'), - ]; - } - - public function is_multi_word($value) - { - return false !== strpos($value, ' '); - } - - public function getName() - { - return 'legacy_integration_test'; - } -} diff --git a/vendor/twig/twig/tests/LexerTest.php b/vendor/twig/twig/tests/LexerTest.php deleted file mode 100644 index 8bd2de5..0000000 --- a/vendor/twig/twig/tests/LexerTest.php +++ /dev/null @@ -1,378 +0,0 @@ -createMock('\Twig\Loader\LoaderInterface'))); - $stream = $lexer->tokenize('{{ foo }}', 'foo'); - $this->assertEquals('foo', $stream->getFilename()); - $this->assertEquals('{{ foo }}', $stream->getSource()); - } - - public function testNameLabelForTag() - { - $template = '{% § %}'; - - $lexer = new Lexer(new Environment($this->createMock('\Twig\Loader\LoaderInterface'))); - $stream = $lexer->tokenize(new Source($template, 'index')); - - $stream->expect(Token::BLOCK_START_TYPE); - $this->assertSame('§', $stream->expect(Token::NAME_TYPE)->getValue()); - } - - public function testNameLabelForFunction() - { - $template = '{{ §() }}'; - - $lexer = new Lexer(new Environment($this->createMock('\Twig\Loader\LoaderInterface'))); - $stream = $lexer->tokenize(new Source($template, 'index')); - - $stream->expect(Token::VAR_START_TYPE); - $this->assertSame('§', $stream->expect(Token::NAME_TYPE)->getValue()); - } - - public function testBracketsNesting() - { - $template = '{{ {"a":{"b":"c"}} }}'; - - $this->assertEquals(2, $this->countToken($template, Token::PUNCTUATION_TYPE, '{')); - $this->assertEquals(2, $this->countToken($template, Token::PUNCTUATION_TYPE, '}')); - } - - protected function countToken($template, $type, $value = null) - { - $lexer = new Lexer(new Environment($this->createMock('\Twig\Loader\LoaderInterface'))); - $stream = $lexer->tokenize(new Source($template, 'index')); - - $count = 0; - while (!$stream->isEOF()) { - $token = $stream->next(); - if ($type === $token->getType()) { - if (null === $value || $value === $token->getValue()) { - ++$count; - } - } - } - - return $count; - } - - public function testLineDirective() - { - $template = "foo\n" - ."bar\n" - ."{% line 10 %}\n" - ."{{\n" - ."baz\n" - ."}}\n"; - - $lexer = new Lexer(new Environment($this->createMock('\Twig\Loader\LoaderInterface'))); - $stream = $lexer->tokenize(new Source($template, 'index')); - - // foo\nbar\n - $this->assertSame(1, $stream->expect(Token::TEXT_TYPE)->getLine()); - // \n (after {% line %}) - $this->assertSame(10, $stream->expect(Token::TEXT_TYPE)->getLine()); - // {{ - $this->assertSame(11, $stream->expect(Token::VAR_START_TYPE)->getLine()); - // baz - $this->assertSame(12, $stream->expect(Token::NAME_TYPE)->getLine()); - } - - public function testLineDirectiveInline() - { - $template = "foo\n" - ."bar{% line 10 %}{{\n" - ."baz\n" - ."}}\n"; - - $lexer = new Lexer(new Environment($this->createMock('\Twig\Loader\LoaderInterface'))); - $stream = $lexer->tokenize(new Source($template, 'index')); - - // foo\nbar - $this->assertSame(1, $stream->expect(Token::TEXT_TYPE)->getLine()); - // {{ - $this->assertSame(10, $stream->expect(Token::VAR_START_TYPE)->getLine()); - // baz - $this->assertSame(11, $stream->expect(Token::NAME_TYPE)->getLine()); - } - - public function testLongComments() - { - $template = '{# '.str_repeat('*', 100000).' #}'; - - $lexer = new Lexer(new Environment($this->createMock('\Twig\Loader\LoaderInterface'))); - $lexer->tokenize(new Source($template, 'index')); - - // add a dummy assertion here to satisfy PHPUnit, the only thing we want to test is that the code above - // can be executed without throwing any exceptions - $this->addToAssertionCount(1); - } - - public function testLongVerbatim() - { - $template = '{% verbatim %}'.str_repeat('*', 100000).'{% endverbatim %}'; - - $lexer = new Lexer(new Environment($this->createMock('\Twig\Loader\LoaderInterface'))); - $lexer->tokenize(new Source($template, 'index')); - - // add a dummy assertion here to satisfy PHPUnit, the only thing we want to test is that the code above - // can be executed without throwing any exceptions - $this->addToAssertionCount(1); - } - - public function testLongVar() - { - $template = '{{ '.str_repeat('x', 100000).' }}'; - - $lexer = new Lexer(new Environment($this->createMock('\Twig\Loader\LoaderInterface'))); - $lexer->tokenize(new Source($template, 'index')); - - // add a dummy assertion here to satisfy PHPUnit, the only thing we want to test is that the code above - // can be executed without throwing any exceptions - $this->addToAssertionCount(1); - } - - public function testLongBlock() - { - $template = '{% '.str_repeat('x', 100000).' %}'; - - $lexer = new Lexer(new Environment($this->createMock('\Twig\Loader\LoaderInterface'))); - $lexer->tokenize(new Source($template, 'index')); - - // add a dummy assertion here to satisfy PHPUnit, the only thing we want to test is that the code above - // can be executed without throwing any exceptions - $this->addToAssertionCount(1); - } - - public function testBigNumbers() - { - $template = '{{ 922337203685477580700 }}'; - - $lexer = new Lexer(new Environment($this->createMock('\Twig\Loader\LoaderInterface'))); - $stream = $lexer->tokenize(new Source($template, 'index')); - $stream->next(); - $node = $stream->next(); - $this->assertEquals('922337203685477580700', $node->getValue()); - } - - public function testStringWithEscapedDelimiter() - { - $tests = [ - "{{ 'foo \' bar' }}" => 'foo \' bar', - '{{ "foo \" bar" }}' => 'foo " bar', - ]; - $lexer = new Lexer(new Environment($this->createMock('\Twig\Loader\LoaderInterface'))); - foreach ($tests as $template => $expected) { - $stream = $lexer->tokenize(new Source($template, 'index')); - $stream->expect(Token::VAR_START_TYPE); - $stream->expect(Token::STRING_TYPE, $expected); - - // add a dummy assertion here to satisfy PHPUnit, the only thing we want to test is that the code above - // can be executed without throwing any exceptions - $this->addToAssertionCount(1); - } - } - - public function testStringWithInterpolation() - { - $template = 'foo {{ "bar #{ baz + 1 }" }}'; - - $lexer = new Lexer(new Environment($this->createMock('\Twig\Loader\LoaderInterface'))); - $stream = $lexer->tokenize(new Source($template, 'index')); - $stream->expect(Token::TEXT_TYPE, 'foo '); - $stream->expect(Token::VAR_START_TYPE); - $stream->expect(Token::STRING_TYPE, 'bar '); - $stream->expect(Token::INTERPOLATION_START_TYPE); - $stream->expect(Token::NAME_TYPE, 'baz'); - $stream->expect(Token::OPERATOR_TYPE, '+'); - $stream->expect(Token::NUMBER_TYPE, '1'); - $stream->expect(Token::INTERPOLATION_END_TYPE); - $stream->expect(Token::VAR_END_TYPE); - - // add a dummy assertion here to satisfy PHPUnit, the only thing we want to test is that the code above - // can be executed without throwing any exceptions - $this->addToAssertionCount(1); - } - - public function testStringWithEscapedInterpolation() - { - $template = '{{ "bar \#{baz+1}" }}'; - - $lexer = new Lexer(new Environment($this->createMock('\Twig\Loader\LoaderInterface'))); - $stream = $lexer->tokenize(new Source($template, 'index')); - $stream->expect(Token::VAR_START_TYPE); - $stream->expect(Token::STRING_TYPE, 'bar #{baz+1}'); - $stream->expect(Token::VAR_END_TYPE); - - // add a dummy assertion here to satisfy PHPUnit, the only thing we want to test is that the code above - // can be executed without throwing any exceptions - $this->addToAssertionCount(1); - } - - public function testStringWithHash() - { - $template = '{{ "bar # baz" }}'; - - $lexer = new Lexer(new Environment($this->createMock('\Twig\Loader\LoaderInterface'))); - $stream = $lexer->tokenize(new Source($template, 'index')); - $stream->expect(Token::VAR_START_TYPE); - $stream->expect(Token::STRING_TYPE, 'bar # baz'); - $stream->expect(Token::VAR_END_TYPE); - - // add a dummy assertion here to satisfy PHPUnit, the only thing we want to test is that the code above - // can be executed without throwing any exceptions - $this->addToAssertionCount(1); - } - - public function testStringWithUnterminatedInterpolation() - { - $this->expectException('\Twig\Error\SyntaxError'); - $this->expectExceptionMessage('Unclosed """'); - - $template = '{{ "bar #{x" }}'; - - $lexer = new Lexer(new Environment($this->createMock('\Twig\Loader\LoaderInterface'))); - $lexer->tokenize(new Source($template, 'index')); - } - - public function testStringWithNestedInterpolations() - { - $template = '{{ "bar #{ "foo#{bar}" }" }}'; - - $lexer = new Lexer(new Environment($this->createMock('\Twig\Loader\LoaderInterface'))); - $stream = $lexer->tokenize(new Source($template, 'index')); - $stream->expect(Token::VAR_START_TYPE); - $stream->expect(Token::STRING_TYPE, 'bar '); - $stream->expect(Token::INTERPOLATION_START_TYPE); - $stream->expect(Token::STRING_TYPE, 'foo'); - $stream->expect(Token::INTERPOLATION_START_TYPE); - $stream->expect(Token::NAME_TYPE, 'bar'); - $stream->expect(Token::INTERPOLATION_END_TYPE); - $stream->expect(Token::INTERPOLATION_END_TYPE); - $stream->expect(Token::VAR_END_TYPE); - - // add a dummy assertion here to satisfy PHPUnit, the only thing we want to test is that the code above - // can be executed without throwing any exceptions - $this->addToAssertionCount(1); - } - - public function testStringWithNestedInterpolationsInBlock() - { - $template = '{% foo "bar #{ "foo#{bar}" }" %}'; - - $lexer = new Lexer(new Environment($this->createMock('\Twig\Loader\LoaderInterface'))); - $stream = $lexer->tokenize(new Source($template, 'index')); - $stream->expect(Token::BLOCK_START_TYPE); - $stream->expect(Token::NAME_TYPE, 'foo'); - $stream->expect(Token::STRING_TYPE, 'bar '); - $stream->expect(Token::INTERPOLATION_START_TYPE); - $stream->expect(Token::STRING_TYPE, 'foo'); - $stream->expect(Token::INTERPOLATION_START_TYPE); - $stream->expect(Token::NAME_TYPE, 'bar'); - $stream->expect(Token::INTERPOLATION_END_TYPE); - $stream->expect(Token::INTERPOLATION_END_TYPE); - $stream->expect(Token::BLOCK_END_TYPE); - - // add a dummy assertion here to satisfy PHPUnit, the only thing we want to test is that the code above - // can be executed without throwing any exceptions - $this->addToAssertionCount(1); - } - - public function testOperatorEndingWithALetterAtTheEndOfALine() - { - $template = "{{ 1 and\n0}}"; - - $lexer = new Lexer(new Environment($this->createMock('\Twig\Loader\LoaderInterface'))); - $stream = $lexer->tokenize(new Source($template, 'index')); - $stream->expect(Token::VAR_START_TYPE); - $stream->expect(Token::NUMBER_TYPE, 1); - $stream->expect(Token::OPERATOR_TYPE, 'and'); - - // add a dummy assertion here to satisfy PHPUnit, the only thing we want to test is that the code above - // can be executed without throwing any exceptions - $this->addToAssertionCount(1); - } - - public function testUnterminatedVariable() - { - $this->expectException('\Twig\Error\SyntaxError'); - $this->expectExceptionMessage('Unclosed "variable" in "index" at line 3'); - - $template = ' - -{{ - -bar - - -'; - - $lexer = new Lexer(new Environment($this->createMock('\Twig\Loader\LoaderInterface'))); - $lexer->tokenize(new Source($template, 'index')); - } - - public function testUnterminatedBlock() - { - $this->expectException('\Twig\Error\SyntaxError'); - $this->expectExceptionMessage('Unclosed "block" in "index" at line 3'); - - $template = ' - -{% - -bar - - -'; - - $lexer = new Lexer(new Environment($this->createMock('\Twig\Loader\LoaderInterface'))); - $lexer->tokenize(new Source($template, 'index')); - } - - public function testOverridingSyntax() - { - $template = '[# comment #]{# variable #}/# if true #/true/# endif #/'; - $lexer = new Lexer(new Environment($this->createMock('\Twig\Loader\LoaderInterface')), [ - 'tag_comment' => ['[#', '#]'], - 'tag_block' => ['/#', '#/'], - 'tag_variable' => ['{#', '#}'], - ]); - $stream = $lexer->tokenize(new Source($template, 'index')); - $stream->expect(Token::VAR_START_TYPE); - $stream->expect(Token::NAME_TYPE, 'variable'); - $stream->expect(Token::VAR_END_TYPE); - $stream->expect(Token::BLOCK_START_TYPE); - $stream->expect(Token::NAME_TYPE, 'if'); - $stream->expect(Token::NAME_TYPE, 'true'); - $stream->expect(Token::BLOCK_END_TYPE); - $stream->expect(Token::TEXT_TYPE, 'true'); - $stream->expect(Token::BLOCK_START_TYPE); - $stream->expect(Token::NAME_TYPE, 'endif'); - $stream->expect(Token::BLOCK_END_TYPE); - - // add a dummy assertion here to satisfy PHPUnit, the only thing we want to test is that the code above - // can be executed without throwing any exceptions - $this->addToAssertionCount(1); - } -} diff --git a/vendor/twig/twig/tests/Loader/ArrayTest.php b/vendor/twig/twig/tests/Loader/ArrayTest.php deleted file mode 100644 index ab670b5..0000000 --- a/vendor/twig/twig/tests/Loader/ArrayTest.php +++ /dev/null @@ -1,139 +0,0 @@ - 'bar']); - - $this->assertEquals('bar', $loader->getSource('foo')); - } - - /** - * @group legacy - */ - public function testGetSourceWhenTemplateDoesNotExist() - { - $this->expectException('\Twig\Error\LoaderError'); - - $loader = new ArrayLoader([]); - - $loader->getSource('foo'); - } - - public function testGetSourceContextWhenTemplateDoesNotExist() - { - $this->expectException('\Twig\Error\LoaderError'); - - $loader = new ArrayLoader([]); - - $loader->getSourceContext('foo'); - } - - public function testGetCacheKey() - { - $loader = new ArrayLoader(['foo' => 'bar']); - - $this->assertEquals('foo:bar', $loader->getCacheKey('foo')); - } - - public function testGetCacheKeyWhenTemplateHasDuplicateContent() - { - $loader = new ArrayLoader([ - 'foo' => 'bar', - 'baz' => 'bar', - ]); - - $this->assertEquals('foo:bar', $loader->getCacheKey('foo')); - $this->assertEquals('baz:bar', $loader->getCacheKey('baz')); - } - - public function testGetCacheKeyIsProtectedFromEdgeCollisions() - { - $loader = new ArrayLoader([ - 'foo__' => 'bar', - 'foo' => '__bar', - ]); - - $this->assertEquals('foo__:bar', $loader->getCacheKey('foo__')); - $this->assertEquals('foo:__bar', $loader->getCacheKey('foo')); - } - - public function testGetCacheKeyWhenTemplateDoesNotExist() - { - $this->expectException('\Twig\Error\LoaderError'); - - $loader = new ArrayLoader([]); - - $loader->getCacheKey('foo'); - } - - public function testSetTemplate() - { - $loader = new ArrayLoader([]); - $loader->setTemplate('foo', 'bar'); - - $this->assertEquals('bar', $loader->getSourceContext('foo')->getCode()); - } - - public function testIsFresh() - { - $loader = new ArrayLoader(['foo' => 'bar']); - $this->assertTrue($loader->isFresh('foo', time())); - } - - public function testIsFreshWhenTemplateDoesNotExist() - { - $this->expectException('\Twig\Error\LoaderError'); - - $loader = new ArrayLoader([]); - - $loader->isFresh('foo', time()); - } - - public function testTemplateReference() - { - $name = new Twig_Test_Loader_TemplateReference('foo'); - $loader = new ArrayLoader(['foo' => 'bar']); - - $loader->getCacheKey($name); - $loader->getSourceContext($name); - $loader->isFresh($name, time()); - $loader->setTemplate($name, 'foo:bar'); - - // add a dummy assertion here to satisfy PHPUnit, the only thing we want to test is that the code above - // can be executed without crashing PHP - $this->addToAssertionCount(1); - } -} - -class Twig_Test_Loader_TemplateReference -{ - private $name; - - public function __construct($name) - { - $this->name = $name; - } - - public function __toString() - { - return $this->name; - } -} diff --git a/vendor/twig/twig/tests/Loader/ChainTest.php b/vendor/twig/twig/tests/Loader/ChainTest.php deleted file mode 100644 index d89e2cc..0000000 --- a/vendor/twig/twig/tests/Loader/ChainTest.php +++ /dev/null @@ -1,133 +0,0 @@ - 'bar']), - new ArrayLoader(['foo' => 'foobar', 'bar' => 'foo']), - ]); - - $this->assertEquals('bar', $loader->getSource('foo')); - $this->assertEquals('foo', $loader->getSource('bar')); - } - - public function testGetSourceContext() - { - $path = __DIR__.'/../Fixtures'; - $loader = new ChainLoader([ - new ArrayLoader(['foo' => 'bar']), - new ArrayLoader(['errors/index.html' => 'baz']), - new FilesystemLoader([$path]), - ]); - - $this->assertEquals('foo', $loader->getSourceContext('foo')->getName()); - $this->assertSame('', $loader->getSourceContext('foo')->getPath()); - - $this->assertEquals('errors/index.html', $loader->getSourceContext('errors/index.html')->getName()); - $this->assertSame('', $loader->getSourceContext('errors/index.html')->getPath()); - $this->assertEquals('baz', $loader->getSourceContext('errors/index.html')->getCode()); - - $this->assertEquals('errors/base.html', $loader->getSourceContext('errors/base.html')->getName()); - $this->assertEquals(realpath($path.'/errors/base.html'), realpath($loader->getSourceContext('errors/base.html')->getPath())); - $this->assertNotEquals('baz', $loader->getSourceContext('errors/base.html')->getCode()); - } - - public function testGetSourceContextWhenTemplateDoesNotExist() - { - $this->expectException('\Twig\Error\LoaderError'); - - $loader = new ChainLoader([]); - - $loader->getSourceContext('foo'); - } - - /** - * @group legacy - */ - public function testGetSourceWhenTemplateDoesNotExist() - { - $this->expectException('\Twig\Error\LoaderError'); - - $loader = new ChainLoader([]); - - $loader->getSource('foo'); - } - - public function testGetCacheKey() - { - $loader = new ChainLoader([ - new ArrayLoader(['foo' => 'bar']), - new ArrayLoader(['foo' => 'foobar', 'bar' => 'foo']), - ]); - - $this->assertEquals('foo:bar', $loader->getCacheKey('foo')); - $this->assertEquals('bar:foo', $loader->getCacheKey('bar')); - } - - public function testGetCacheKeyWhenTemplateDoesNotExist() - { - $this->expectException('\Twig\Error\LoaderError'); - - $loader = new ChainLoader([]); - - $loader->getCacheKey('foo'); - } - - public function testAddLoader() - { - $loader = new ChainLoader(); - $loader->addLoader(new ArrayLoader(['foo' => 'bar'])); - - $this->assertEquals('bar', $loader->getSourceContext('foo')->getCode()); - } - - public function testExists() - { - $loader1 = $this->createMock('Twig\Tests\Loader\ChainTestLoaderWithExistsInterface'); - $loader1->expects($this->once())->method('exists')->willReturn(false); - $loader1->expects($this->never())->method('getSourceContext'); - - // can be removed in 2.0 - $loader2 = $this->createMock('Twig\Tests\Loader\ChainTestLoaderInterface'); - //$loader2 = $this->createMock(['\Twig\Loader\LoaderInterface', '\Twig\Loader\SourceContextLoaderInterface']); - $loader2->expects($this->once())->method('getSourceContext')->willReturn(new Source('content', 'index')); - - $loader = new ChainLoader(); - $loader->addLoader($loader1); - $loader->addLoader($loader2); - - $this->assertTrue($loader->exists('foo')); - } -} - -interface ChainTestLoaderInterface extends LoaderInterface, SourceContextLoaderInterface -{ -} - -interface ChainTestLoaderWithExistsInterface extends LoaderInterface, ExistsLoaderInterface, SourceContextLoaderInterface -{ -} diff --git a/vendor/twig/twig/tests/Loader/FilesystemTest.php b/vendor/twig/twig/tests/Loader/FilesystemTest.php deleted file mode 100644 index 3307a9b..0000000 --- a/vendor/twig/twig/tests/Loader/FilesystemTest.php +++ /dev/null @@ -1,247 +0,0 @@ -assertEquals('errors/index.html', $loader->getSourceContext('errors/index.html')->getName()); - $this->assertEquals(realpath($path.'/errors/index.html'), realpath($loader->getSourceContext('errors/index.html')->getPath())); - } - - /** - * @dataProvider getSecurityTests - */ - public function testSecurity($template) - { - $loader = new FilesystemLoader([__DIR__.'/../Fixtures']); - - try { - $loader->getCacheKey($template); - $this->fail(); - } catch (LoaderError $e) { - $this->assertStringNotContainsString('Unable to find template', $e->getMessage()); - } - } - - public function getSecurityTests() - { - return [ - ["AutoloaderTest\0.php"], - ['..\\AutoloaderTest.php'], - ['..\\\\\\AutoloaderTest.php'], - ['../AutoloaderTest.php'], - ['..////AutoloaderTest.php'], - ['./../AutoloaderTest.php'], - ['.\\..\\AutoloaderTest.php'], - ['././././././../AutoloaderTest.php'], - ['.\\./.\\./.\\./../AutoloaderTest.php'], - ['foo/../../AutoloaderTest.php'], - ['foo\\..\\..\\AutoloaderTest.php'], - ['foo/../bar/../../AutoloaderTest.php'], - ['foo/bar/../../../AutoloaderTest.php'], - ['filters/../../AutoloaderTest.php'], - ['filters//..//..//AutoloaderTest.php'], - ['filters\\..\\..\\AutoloaderTest.php'], - ['filters\\\\..\\\\..\\\\AutoloaderTest.php'], - ['filters\\//../\\/\\..\\AutoloaderTest.php'], - ['/../AutoloaderTest.php'], - ]; - } - - /** - * @dataProvider getBasePaths - */ - public function testPaths($basePath, $cacheKey, $rootPath) - { - $loader = new FilesystemLoader([$basePath.'/normal', $basePath.'/normal_bis'], $rootPath); - $loader->setPaths([$basePath.'/named', $basePath.'/named_bis'], 'named'); - $loader->addPath($basePath.'/named_ter', 'named'); - $loader->addPath($basePath.'/normal_ter'); - $loader->prependPath($basePath.'/normal_final'); - $loader->prependPath($basePath.'/named/../named_quater', 'named'); - $loader->prependPath($basePath.'/named_final', 'named'); - - $this->assertEquals([ - $basePath.'/normal_final', - $basePath.'/normal', - $basePath.'/normal_bis', - $basePath.'/normal_ter', - ], $loader->getPaths()); - $this->assertEquals([ - $basePath.'/named_final', - $basePath.'/named/../named_quater', - $basePath.'/named', - $basePath.'/named_bis', - $basePath.'/named_ter', - ], $loader->getPaths('named')); - - // do not use realpath here as it would make the test unuseful - $this->assertEquals($cacheKey, str_replace('\\', '/', $loader->getCacheKey('@named/named_absolute.html'))); - $this->assertEquals("path (final)\n", $loader->getSourceContext('index.html')->getCode()); - $this->assertEquals("path (final)\n", $loader->getSourceContext('@__main__/index.html')->getCode()); - $this->assertEquals("named path (final)\n", $loader->getSourceContext('@named/index.html')->getCode()); - } - - public function getBasePaths() - { - return [ - [ - __DIR__.'/Fixtures', - 'tests/Loader/Fixtures/named_quater/named_absolute.html', - null, - ], - [ - __DIR__.'/Fixtures/../Fixtures', - 'tests/Loader/Fixtures/named_quater/named_absolute.html', - null, - ], - [ - 'tests/Loader/Fixtures', - 'tests/Loader/Fixtures/named_quater/named_absolute.html', - getcwd(), - ], - [ - 'Fixtures', - 'Fixtures/named_quater/named_absolute.html', - getcwd().'/tests/Loader', - ], - [ - 'Fixtures', - 'Fixtures/named_quater/named_absolute.html', - getcwd().'/tests/../tests/Loader', - ], - ]; - } - - public function testEmptyConstructor() - { - $loader = new FilesystemLoader(); - $this->assertEquals([], $loader->getPaths()); - } - - public function testGetNamespaces() - { - $loader = new FilesystemLoader(sys_get_temp_dir()); - $this->assertEquals([FilesystemLoader::MAIN_NAMESPACE], $loader->getNamespaces()); - - $loader->addPath(sys_get_temp_dir(), 'named'); - $this->assertEquals([FilesystemLoader::MAIN_NAMESPACE, 'named'], $loader->getNamespaces()); - } - - public function testFindTemplateExceptionNamespace() - { - $basePath = __DIR__.'/Fixtures'; - - $loader = new FilesystemLoader([$basePath.'/normal']); - $loader->addPath($basePath.'/named', 'named'); - - try { - $loader->getSourceContext('@named/nowhere.html'); - } catch (\Exception $e) { - $this->assertInstanceOf('\Twig\Error\LoaderError', $e); - $this->assertStringContainsString('Unable to find template "@named/nowhere.html"', $e->getMessage()); - } - } - - public function testFindTemplateWithCache() - { - $basePath = __DIR__.'/Fixtures'; - - $loader = new FilesystemLoader([$basePath.'/normal']); - $loader->addPath($basePath.'/named', 'named'); - - // prime the cache for index.html in the named namespace - $namedSource = $loader->getSourceContext('@named/index.html')->getCode(); - $this->assertEquals("named path\n", $namedSource); - - // get index.html from the main namespace - $this->assertEquals("path\n", $loader->getSourceContext('index.html')->getCode()); - } - - public function testLoadTemplateAndRenderBlockWithCache() - { - $loader = new FilesystemLoader([]); - $loader->addPath(__DIR__.'/Fixtures/themes/theme2'); - $loader->addPath(__DIR__.'/Fixtures/themes/theme1'); - $loader->addPath(__DIR__.'/Fixtures/themes/theme1', 'default_theme'); - - $twig = new Environment($loader); - - $template = $twig->load('blocks.html.twig'); - $this->assertSame('block from theme 1', $template->renderBlock('b1', [])); - - $template = $twig->load('blocks.html.twig'); - $this->assertSame('block from theme 2', $template->renderBlock('b2', [])); - } - - public function getArrayInheritanceTests() - { - return [ - 'valid array inheritance' => ['array_inheritance_valid_parent.html.twig'], - 'array inheritance with null first template' => ['array_inheritance_null_parent.html.twig'], - 'array inheritance with empty first template' => ['array_inheritance_empty_parent.html.twig'], - 'array inheritance with non-existent first template' => ['array_inheritance_nonexistent_parent.html.twig'], - ]; - } - - /** - * @dataProvider getArrayInheritanceTests - * - * @param $templateName string Template name with array inheritance - */ - public function testArrayInheritance($templateName) - { - $loader = new FilesystemLoader([]); - $loader->addPath(__DIR__.'/Fixtures/inheritance'); - - $twig = new Environment($loader); - - $template = $twig->load($templateName); - $this->assertSame('VALID Child', $template->renderBlock('body', [])); - } - - /** - * @requires PHP 5.3 - */ - public function testLoadTemplateFromPhar() - { - $loader = new FilesystemLoader([]); - // phar-sample.phar was created with the following script: - // $f = new Phar('phar-test.phar'); - // $f->addFromString('hello.twig', 'hello from phar'); - $loader->addPath('phar://'.__DIR__.'/Fixtures/phar/phar-sample.phar'); - $this->assertSame('hello from phar', $loader->getSourceContext('hello.twig')->getCode()); - } - - public function testTemplateExistsAlwaysReturnsBool() - { - $loader = new FilesystemLoader([]); - $this->assertFalse($loader->exists("foo\0.twig")); - $this->assertFalse($loader->exists('../foo.twig')); - $this->assertFalse($loader->exists('@foo')); - $this->assertFalse($loader->exists('foo')); - $this->assertFalse($loader->exists('@foo/bar.twig')); - - $loader->addPath(__DIR__.'/Fixtures/normal'); - $this->assertTrue($loader->exists('index.html')); - $loader->addPath(__DIR__.'/Fixtures/normal', 'foo'); - $this->assertTrue($loader->exists('@foo/index.html')); - } -} diff --git a/vendor/twig/twig/tests/Loader/Fixtures/inheritance/array_inheritance_empty_parent.html.twig b/vendor/twig/twig/tests/Loader/Fixtures/inheritance/array_inheritance_empty_parent.html.twig deleted file mode 100644 index 6977ebf..0000000 --- a/vendor/twig/twig/tests/Loader/Fixtures/inheritance/array_inheritance_empty_parent.html.twig +++ /dev/null @@ -1,3 +0,0 @@ -{% extends ['','parent.html.twig'] %} - -{% block body %}{{ parent() }} Child{% endblock %} diff --git a/vendor/twig/twig/tests/Loader/Fixtures/inheritance/array_inheritance_nonexistent_parent.html.twig b/vendor/twig/twig/tests/Loader/Fixtures/inheritance/array_inheritance_nonexistent_parent.html.twig deleted file mode 100644 index 5b50a8b..0000000 --- a/vendor/twig/twig/tests/Loader/Fixtures/inheritance/array_inheritance_nonexistent_parent.html.twig +++ /dev/null @@ -1,3 +0,0 @@ -{% extends ['nonexistent.html.twig','parent.html.twig'] %} - -{% block body %}{{ parent() }} Child{% endblock %} diff --git a/vendor/twig/twig/tests/Loader/Fixtures/inheritance/array_inheritance_null_parent.html.twig b/vendor/twig/twig/tests/Loader/Fixtures/inheritance/array_inheritance_null_parent.html.twig deleted file mode 100644 index a16b3ad..0000000 --- a/vendor/twig/twig/tests/Loader/Fixtures/inheritance/array_inheritance_null_parent.html.twig +++ /dev/null @@ -1,3 +0,0 @@ -{% extends [null,'parent.html.twig'] %} - -{% block body %}{{ parent() }} Child{% endblock %} diff --git a/vendor/twig/twig/tests/Loader/Fixtures/inheritance/array_inheritance_valid_parent.html.twig b/vendor/twig/twig/tests/Loader/Fixtures/inheritance/array_inheritance_valid_parent.html.twig deleted file mode 100644 index 4940dad..0000000 --- a/vendor/twig/twig/tests/Loader/Fixtures/inheritance/array_inheritance_valid_parent.html.twig +++ /dev/null @@ -1,3 +0,0 @@ -{% extends ['parent.html.twig','spare_parent.html.twig'] %} - -{% block body %}{{ parent() }} Child{% endblock %} diff --git a/vendor/twig/twig/tests/Loader/Fixtures/inheritance/parent.html.twig b/vendor/twig/twig/tests/Loader/Fixtures/inheritance/parent.html.twig deleted file mode 100644 index d594c0e..0000000 --- a/vendor/twig/twig/tests/Loader/Fixtures/inheritance/parent.html.twig +++ /dev/null @@ -1 +0,0 @@ -{% block body %}VALID{% endblock %} diff --git a/vendor/twig/twig/tests/Loader/Fixtures/inheritance/spare_parent.html.twig b/vendor/twig/twig/tests/Loader/Fixtures/inheritance/spare_parent.html.twig deleted file mode 100644 index 70b7360..0000000 --- a/vendor/twig/twig/tests/Loader/Fixtures/inheritance/spare_parent.html.twig +++ /dev/null @@ -1 +0,0 @@ -{% block body %}SPARE PARENT{% endblock %} diff --git a/vendor/twig/twig/tests/Loader/Fixtures/named/index.html b/vendor/twig/twig/tests/Loader/Fixtures/named/index.html deleted file mode 100644 index 9e5449c..0000000 --- a/vendor/twig/twig/tests/Loader/Fixtures/named/index.html +++ /dev/null @@ -1 +0,0 @@ -named path diff --git a/vendor/twig/twig/tests/Loader/Fixtures/named_bis/index.html b/vendor/twig/twig/tests/Loader/Fixtures/named_bis/index.html deleted file mode 100644 index d3a272b..0000000 --- a/vendor/twig/twig/tests/Loader/Fixtures/named_bis/index.html +++ /dev/null @@ -1 +0,0 @@ -named path (bis) diff --git a/vendor/twig/twig/tests/Loader/Fixtures/named_final/index.html b/vendor/twig/twig/tests/Loader/Fixtures/named_final/index.html deleted file mode 100644 index 9f05d15..0000000 --- a/vendor/twig/twig/tests/Loader/Fixtures/named_final/index.html +++ /dev/null @@ -1 +0,0 @@ -named path (final) diff --git a/vendor/twig/twig/tests/Loader/Fixtures/named_quater/named_absolute.html b/vendor/twig/twig/tests/Loader/Fixtures/named_quater/named_absolute.html deleted file mode 100644 index b1fb5f5..0000000 --- a/vendor/twig/twig/tests/Loader/Fixtures/named_quater/named_absolute.html +++ /dev/null @@ -1 +0,0 @@ -named path (quater) diff --git a/vendor/twig/twig/tests/Loader/Fixtures/named_ter/index.html b/vendor/twig/twig/tests/Loader/Fixtures/named_ter/index.html deleted file mode 100644 index 24fb68a..0000000 --- a/vendor/twig/twig/tests/Loader/Fixtures/named_ter/index.html +++ /dev/null @@ -1 +0,0 @@ -named path (ter) diff --git a/vendor/twig/twig/tests/Loader/Fixtures/normal/index.html b/vendor/twig/twig/tests/Loader/Fixtures/normal/index.html deleted file mode 100644 index e7a8fd4..0000000 --- a/vendor/twig/twig/tests/Loader/Fixtures/normal/index.html +++ /dev/null @@ -1 +0,0 @@ -path diff --git a/vendor/twig/twig/tests/Loader/Fixtures/normal_bis/index.html b/vendor/twig/twig/tests/Loader/Fixtures/normal_bis/index.html deleted file mode 100644 index bfa9160..0000000 --- a/vendor/twig/twig/tests/Loader/Fixtures/normal_bis/index.html +++ /dev/null @@ -1 +0,0 @@ -path (bis) diff --git a/vendor/twig/twig/tests/Loader/Fixtures/normal_final/index.html b/vendor/twig/twig/tests/Loader/Fixtures/normal_final/index.html deleted file mode 100644 index 73a089b..0000000 --- a/vendor/twig/twig/tests/Loader/Fixtures/normal_final/index.html +++ /dev/null @@ -1 +0,0 @@ -path (final) diff --git a/vendor/twig/twig/tests/Loader/Fixtures/normal_ter/index.html b/vendor/twig/twig/tests/Loader/Fixtures/normal_ter/index.html deleted file mode 100644 index b7ad97d..0000000 --- a/vendor/twig/twig/tests/Loader/Fixtures/normal_ter/index.html +++ /dev/null @@ -1 +0,0 @@ -path (ter) diff --git a/vendor/twig/twig/tests/Loader/Fixtures/phar/phar-sample.phar b/vendor/twig/twig/tests/Loader/Fixtures/phar/phar-sample.phar deleted file mode 100644 index 092bbfa..0000000 Binary files a/vendor/twig/twig/tests/Loader/Fixtures/phar/phar-sample.phar and /dev/null differ diff --git a/vendor/twig/twig/tests/Loader/Fixtures/themes/theme1/blocks.html.twig b/vendor/twig/twig/tests/Loader/Fixtures/themes/theme1/blocks.html.twig deleted file mode 100644 index dd0cbc2..0000000 --- a/vendor/twig/twig/tests/Loader/Fixtures/themes/theme1/blocks.html.twig +++ /dev/null @@ -1,3 +0,0 @@ -{% block b1 %}block from theme 1{% endblock %} - -{% block b2 %}block from theme 1{% endblock %} diff --git a/vendor/twig/twig/tests/Loader/Fixtures/themes/theme2/blocks.html.twig b/vendor/twig/twig/tests/Loader/Fixtures/themes/theme2/blocks.html.twig deleted file mode 100644 index 07cf9db..0000000 --- a/vendor/twig/twig/tests/Loader/Fixtures/themes/theme2/blocks.html.twig +++ /dev/null @@ -1,3 +0,0 @@ -{% use '@default_theme/blocks.html.twig' %} - -{% block b2 %}block from theme 2{% endblock %} diff --git a/vendor/twig/twig/tests/NativeExtensionTest.php b/vendor/twig/twig/tests/NativeExtensionTest.php deleted file mode 100644 index 3399292..0000000 --- a/vendor/twig/twig/tests/NativeExtensionTest.php +++ /dev/null @@ -1,43 +0,0 @@ -= 70000) { - $this->markTestSkipped('Extension is not available on PHP 7+'); - } - - $twig = new Environment(new ArrayLoader(['index' => '{{ d1.date }}{{ d2.date }}']), [ - 'debug' => true, - 'cache' => false, - 'autoescape' => false, - ]); - - $d1 = new \DateTime(); - $d2 = new \DateTime(); - $output = $twig->render('index', compact('d1', 'd2')); - - // If it fails, PHP will crash. - $this->assertEquals($output, $d1->date.$d2->date); - } -} diff --git a/vendor/twig/twig/tests/Node/AutoEscapeTest.php b/vendor/twig/twig/tests/Node/AutoEscapeTest.php deleted file mode 100644 index d0f641c..0000000 --- a/vendor/twig/twig/tests/Node/AutoEscapeTest.php +++ /dev/null @@ -1,39 +0,0 @@ -assertEquals($body, $node->getNode('body')); - $this->assertTrue($node->getAttribute('value')); - } - - public function getTests() - { - $body = new Node([new TextNode('foo', 1)]); - $node = new AutoEscapeNode(true, $body, 1); - - return [ - [$node, "// line 1\necho \"foo\";"], - ]; - } -} diff --git a/vendor/twig/twig/tests/Node/BlockReferenceTest.php b/vendor/twig/twig/tests/Node/BlockReferenceTest.php deleted file mode 100644 index 63dc070..0000000 --- a/vendor/twig/twig/tests/Node/BlockReferenceTest.php +++ /dev/null @@ -1,36 +0,0 @@ -assertEquals('foo', $node->getAttribute('name')); - } - - public function getTests() - { - return [ - [new BlockReferenceNode('foo', 1), <<displayBlock('foo', \$context, \$blocks); -EOF - ], - ]; - } -} diff --git a/vendor/twig/twig/tests/Node/BlockTest.php b/vendor/twig/twig/tests/Node/BlockTest.php deleted file mode 100644 index 235cbaf..0000000 --- a/vendor/twig/twig/tests/Node/BlockTest.php +++ /dev/null @@ -1,45 +0,0 @@ -assertEquals($body, $node->getNode('body')); - $this->assertEquals('foo', $node->getAttribute('name')); - } - - public function getTests() - { - $body = new TextNode('foo', 1); - $node = new BlockNode('foo', $body, 1); - - return [ - [$node, <<assertEquals($expr, $node->getNode('expr')); - } - - public function getTests() - { - $tests = []; - - $expr = new ConstantExpression('This section is deprecated', 1); - $node = new DeprecatedNode($expr, 1, 'deprecated'); - $node->setTemplateName('foo.twig'); - - $tests[] = [$node, <<setTemplateName('foo.twig'); - - $tests[] = [$node, <<createMock('\Twig\Loader\LoaderInterface')); - $environment->addFunction(new TwigFunction('foo', 'foo', [])); - - $expr = new FunctionExpression('foo', new Node(), 1); - $node = new DeprecatedNode($expr, 1, 'deprecated'); - $node->setTemplateName('foo.twig'); - - $compiler = $this->getCompiler($environment); - $varName = $compiler->getVarName(); - - $tests[] = [$node, <<assertEquals($expr, $node->getNode('expr')); - } - - public function getTests() - { - $tests = []; - - $expr = new ConstantExpression('foo', 1); - $node = new DoNode($expr, 1); - $tests[] = [$node, "// line 1\n\"foo\";"]; - - return $tests; - } -} diff --git a/vendor/twig/twig/tests/Node/Expression/ArrayTest.php b/vendor/twig/twig/tests/Node/Expression/ArrayTest.php deleted file mode 100644 index cfd9c67..0000000 --- a/vendor/twig/twig/tests/Node/Expression/ArrayTest.php +++ /dev/null @@ -1,43 +0,0 @@ -assertEquals($foo, $node->getNode(1)); - } - - public function getTests() - { - $elements = [ - new ConstantExpression('foo', 1), - new ConstantExpression('bar', 1), - - new ConstantExpression('bar', 1), - new ConstantExpression('foo', 1), - ]; - $node = new ArrayExpression($elements, 1); - - return [ - [$node, '["foo" => "bar", "bar" => "foo"]'], - ]; - } -} diff --git a/vendor/twig/twig/tests/Node/Expression/AssignNameTest.php b/vendor/twig/twig/tests/Node/Expression/AssignNameTest.php deleted file mode 100644 index 80dbe94..0000000 --- a/vendor/twig/twig/tests/Node/Expression/AssignNameTest.php +++ /dev/null @@ -1,34 +0,0 @@ -assertEquals('foo', $node->getAttribute('name')); - } - - public function getTests() - { - $node = new AssignNameExpression('foo', 1); - - return [ - [$node, '$context["foo"]'], - ]; - } -} diff --git a/vendor/twig/twig/tests/Node/Expression/Binary/AddTest.php b/vendor/twig/twig/tests/Node/Expression/Binary/AddTest.php deleted file mode 100644 index 5cff2bc..0000000 --- a/vendor/twig/twig/tests/Node/Expression/Binary/AddTest.php +++ /dev/null @@ -1,40 +0,0 @@ -assertEquals($left, $node->getNode('left')); - $this->assertEquals($right, $node->getNode('right')); - } - - public function getTests() - { - $left = new ConstantExpression(1, 1); - $right = new ConstantExpression(2, 1); - $node = new AddBinary($left, $right, 1); - - return [ - [$node, '(1 + 2)'], - ]; - } -} diff --git a/vendor/twig/twig/tests/Node/Expression/Binary/AndTest.php b/vendor/twig/twig/tests/Node/Expression/Binary/AndTest.php deleted file mode 100644 index d83aed0..0000000 --- a/vendor/twig/twig/tests/Node/Expression/Binary/AndTest.php +++ /dev/null @@ -1,40 +0,0 @@ -assertEquals($left, $node->getNode('left')); - $this->assertEquals($right, $node->getNode('right')); - } - - public function getTests() - { - $left = new ConstantExpression(1, 1); - $right = new ConstantExpression(2, 1); - $node = new AndBinary($left, $right, 1); - - return [ - [$node, '(1 && 2)'], - ]; - } -} diff --git a/vendor/twig/twig/tests/Node/Expression/Binary/ConcatTest.php b/vendor/twig/twig/tests/Node/Expression/Binary/ConcatTest.php deleted file mode 100644 index 0eff603..0000000 --- a/vendor/twig/twig/tests/Node/Expression/Binary/ConcatTest.php +++ /dev/null @@ -1,40 +0,0 @@ -assertEquals($left, $node->getNode('left')); - $this->assertEquals($right, $node->getNode('right')); - } - - public function getTests() - { - $left = new ConstantExpression(1, 1); - $right = new ConstantExpression(2, 1); - $node = new ConcatBinary($left, $right, 1); - - return [ - [$node, '(1 . 2)'], - ]; - } -} diff --git a/vendor/twig/twig/tests/Node/Expression/Binary/DivTest.php b/vendor/twig/twig/tests/Node/Expression/Binary/DivTest.php deleted file mode 100644 index 20cf464..0000000 --- a/vendor/twig/twig/tests/Node/Expression/Binary/DivTest.php +++ /dev/null @@ -1,40 +0,0 @@ -assertEquals($left, $node->getNode('left')); - $this->assertEquals($right, $node->getNode('right')); - } - - public function getTests() - { - $left = new ConstantExpression(1, 1); - $right = new ConstantExpression(2, 1); - $node = new DivBinary($left, $right, 1); - - return [ - [$node, '(1 / 2)'], - ]; - } -} diff --git a/vendor/twig/twig/tests/Node/Expression/Binary/FloorDivTest.php b/vendor/twig/twig/tests/Node/Expression/Binary/FloorDivTest.php deleted file mode 100644 index 8268598..0000000 --- a/vendor/twig/twig/tests/Node/Expression/Binary/FloorDivTest.php +++ /dev/null @@ -1,40 +0,0 @@ -assertEquals($left, $node->getNode('left')); - $this->assertEquals($right, $node->getNode('right')); - } - - public function getTests() - { - $left = new ConstantExpression(1, 1); - $right = new ConstantExpression(2, 1); - $node = new FloorDivBinary($left, $right, 1); - - return [ - [$node, '(int) floor((1 / 2))'], - ]; - } -} diff --git a/vendor/twig/twig/tests/Node/Expression/Binary/ModTest.php b/vendor/twig/twig/tests/Node/Expression/Binary/ModTest.php deleted file mode 100644 index 2069ef0..0000000 --- a/vendor/twig/twig/tests/Node/Expression/Binary/ModTest.php +++ /dev/null @@ -1,40 +0,0 @@ -assertEquals($left, $node->getNode('left')); - $this->assertEquals($right, $node->getNode('right')); - } - - public function getTests() - { - $left = new ConstantExpression(1, 1); - $right = new ConstantExpression(2, 1); - $node = new ModBinary($left, $right, 1); - - return [ - [$node, '(1 % 2)'], - ]; - } -} diff --git a/vendor/twig/twig/tests/Node/Expression/Binary/MulTest.php b/vendor/twig/twig/tests/Node/Expression/Binary/MulTest.php deleted file mode 100644 index c50dfc1..0000000 --- a/vendor/twig/twig/tests/Node/Expression/Binary/MulTest.php +++ /dev/null @@ -1,40 +0,0 @@ -assertEquals($left, $node->getNode('left')); - $this->assertEquals($right, $node->getNode('right')); - } - - public function getTests() - { - $left = new ConstantExpression(1, 1); - $right = new ConstantExpression(2, 1); - $node = new MulBinary($left, $right, 1); - - return [ - [$node, '(1 * 2)'], - ]; - } -} diff --git a/vendor/twig/twig/tests/Node/Expression/Binary/OrTest.php b/vendor/twig/twig/tests/Node/Expression/Binary/OrTest.php deleted file mode 100644 index 94df7c0..0000000 --- a/vendor/twig/twig/tests/Node/Expression/Binary/OrTest.php +++ /dev/null @@ -1,40 +0,0 @@ -assertEquals($left, $node->getNode('left')); - $this->assertEquals($right, $node->getNode('right')); - } - - public function getTests() - { - $left = new ConstantExpression(1, 1); - $right = new ConstantExpression(2, 1); - $node = new OrBinary($left, $right, 1); - - return [ - [$node, '(1 || 2)'], - ]; - } -} diff --git a/vendor/twig/twig/tests/Node/Expression/Binary/SubTest.php b/vendor/twig/twig/tests/Node/Expression/Binary/SubTest.php deleted file mode 100644 index 04eebe2..0000000 --- a/vendor/twig/twig/tests/Node/Expression/Binary/SubTest.php +++ /dev/null @@ -1,40 +0,0 @@ -assertEquals($left, $node->getNode('left')); - $this->assertEquals($right, $node->getNode('right')); - } - - public function getTests() - { - $left = new ConstantExpression(1, 1); - $right = new ConstantExpression(2, 1); - $node = new SubBinary($left, $right, 1); - - return [ - [$node, '(1 - 2)'], - ]; - } -} diff --git a/vendor/twig/twig/tests/Node/Expression/CallTest.php b/vendor/twig/twig/tests/Node/Expression/CallTest.php deleted file mode 100644 index 1ffb4c7..0000000 --- a/vendor/twig/twig/tests/Node/Expression/CallTest.php +++ /dev/null @@ -1,139 +0,0 @@ - 'function', 'name' => 'date']); - $this->assertEquals(['U', null], $node->getArguments('date', ['format' => 'U', 'timestamp' => null])); - } - - public function testGetArgumentsWhenPositionalArgumentsAfterNamedArguments() - { - $this->expectException('\Twig\Error\SyntaxError'); - $this->expectExceptionMessage('Positional arguments cannot be used after named arguments for function "date".'); - - $node = new Node_Expression_Call([], ['type' => 'function', 'name' => 'date']); - $node->getArguments('date', ['timestamp' => 123456, 'Y-m-d']); - } - - public function testGetArgumentsWhenArgumentIsDefinedTwice() - { - $this->expectException('\Twig\Error\SyntaxError'); - $this->expectExceptionMessage('Argument "format" is defined twice for function "date".'); - - $node = new Node_Expression_Call([], ['type' => 'function', 'name' => 'date']); - $node->getArguments('date', ['Y-m-d', 'format' => 'U']); - } - - public function testGetArgumentsWithWrongNamedArgumentName() - { - $this->expectException('\Twig\Error\SyntaxError'); - $this->expectExceptionMessage('Unknown argument "unknown" for function "date(format, timestamp)".'); - - $node = new Node_Expression_Call([], ['type' => 'function', 'name' => 'date']); - $node->getArguments('date', ['Y-m-d', 'timestamp' => null, 'unknown' => '']); - } - - public function testGetArgumentsWithWrongNamedArgumentNames() - { - $this->expectException('\Twig\Error\SyntaxError'); - $this->expectExceptionMessage('Unknown arguments "unknown1", "unknown2" for function "date(format, timestamp)".'); - - $node = new Node_Expression_Call([], ['type' => 'function', 'name' => 'date']); - $node->getArguments('date', ['Y-m-d', 'timestamp' => null, 'unknown1' => '', 'unknown2' => '']); - } - - public function testResolveArgumentsWithMissingValueForOptionalArgument() - { - $this->expectException('\Twig\Error\SyntaxError'); - $this->expectExceptionMessage('Argument "case_sensitivity" could not be assigned for function "substr_compare(main_str, str, offset, length, case_sensitivity)" because it is mapped to an internal PHP function which cannot determine default value for optional argument "length".'); - - $node = new Node_Expression_Call([], ['type' => 'function', 'name' => 'substr_compare']); - $node->getArguments('substr_compare', ['abcd', 'bc', 'offset' => 1, 'case_sensitivity' => true]); - } - - public function testResolveArgumentsOnlyNecessaryArgumentsForCustomFunction() - { - $node = new Node_Expression_Call([], ['type' => 'function', 'name' => 'custom_function']); - - $this->assertEquals(['arg1'], $node->getArguments([$this, 'customFunction'], ['arg1' => 'arg1'])); - } - - public function testGetArgumentsForStaticMethod() - { - $node = new Node_Expression_Call([], ['type' => 'function', 'name' => 'custom_static_function']); - $this->assertEquals(['arg1'], $node->getArguments(__CLASS__.'::customStaticFunction', ['arg1' => 'arg1'])); - } - - public function testResolveArgumentsWithMissingParameterForArbitraryArguments() - { - $this->expectException('\LogicException'); - $this->expectExceptionMessage('The last parameter of "Twig\\Tests\\Node\\Expression\\CallTest::customFunctionWithArbitraryArguments" for function "foo" must be an array with default value, eg. "array $arg = []".'); - - $node = new Node_Expression_Call([], ['type' => 'function', 'name' => 'foo', 'is_variadic' => true]); - $node->getArguments([$this, 'customFunctionWithArbitraryArguments'], []); - } - - public static function customStaticFunction($arg1, $arg2 = 'default', $arg3 = []) - { - } - - public function customFunction($arg1, $arg2 = 'default', $arg3 = []) - { - } - - public function customFunctionWithArbitraryArguments() - { - } - - public function testResolveArgumentsWithMissingParameterForArbitraryArgumentsOnFunction() - { - $this->expectException('\LogicException'); - $this->expectExceptionMessageRegExp('#^The last parameter of "Twig\\\\Tests\\\\Node\\\\Expression\\\\custom_Twig_Tests_Node_Expression_CallTest_function" for function "foo" must be an array with default value, eg\\. "array \\$arg \\= \\[\\]"\\.$#'); - - $node = new Node_Expression_Call([], ['type' => 'function', 'name' => 'foo', 'is_variadic' => true]); - $node->getArguments('Twig\Tests\Node\Expression\custom_Twig_Tests_Node_Expression_CallTest_function', []); - } - - public function testResolveArgumentsWithMissingParameterForArbitraryArgumentsOnObject() - { - $this->expectException('\LogicException'); - $this->expectExceptionMessageRegExp('#^The last parameter of "Twig\\\\Tests\\\\Node\\\\Expression\\\\CallableTestClass\\:\\:__invoke" for function "foo" must be an array with default value, eg\\. "array \\$arg \\= \\[\\]"\\.$#'); - - $node = new Node_Expression_Call([], ['type' => 'function', 'name' => 'foo', 'is_variadic' => true]); - $node->getArguments(new CallableTestClass(), []); - } -} - -class Node_Expression_Call extends CallExpression -{ - public function getArguments($callable, $arguments) - { - return parent::getArguments($callable, $arguments); - } -} - -class CallableTestClass -{ - public function __invoke($required) - { - } -} - -function custom_Twig_Tests_Node_Expression_CallTest_function($required) -{ -} diff --git a/vendor/twig/twig/tests/Node/Expression/ConditionalTest.php b/vendor/twig/twig/tests/Node/Expression/ConditionalTest.php deleted file mode 100644 index 004e9c9..0000000 --- a/vendor/twig/twig/tests/Node/Expression/ConditionalTest.php +++ /dev/null @@ -1,44 +0,0 @@ -assertEquals($expr1, $node->getNode('expr1')); - $this->assertEquals($expr2, $node->getNode('expr2')); - $this->assertEquals($expr3, $node->getNode('expr3')); - } - - public function getTests() - { - $tests = []; - - $expr1 = new ConstantExpression(1, 1); - $expr2 = new ConstantExpression(2, 1); - $expr3 = new ConstantExpression(3, 1); - $node = new ConditionalExpression($expr1, $expr2, $expr3, 1); - $tests[] = [$node, '((1) ? (2) : (3))']; - - return $tests; - } -} diff --git a/vendor/twig/twig/tests/Node/Expression/ConstantTest.php b/vendor/twig/twig/tests/Node/Expression/ConstantTest.php deleted file mode 100644 index 920892e..0000000 --- a/vendor/twig/twig/tests/Node/Expression/ConstantTest.php +++ /dev/null @@ -1,35 +0,0 @@ -assertEquals('foo', $node->getAttribute('value')); - } - - public function getTests() - { - $tests = []; - - $node = new ConstantExpression('foo', 1); - $tests[] = [$node, '"foo"']; - - return $tests; - } -} diff --git a/vendor/twig/twig/tests/Node/Expression/FilterTest.php b/vendor/twig/twig/tests/Node/Expression/FilterTest.php deleted file mode 100644 index d7e38f3..0000000 --- a/vendor/twig/twig/tests/Node/Expression/FilterTest.php +++ /dev/null @@ -1,161 +0,0 @@ -assertEquals($expr, $node->getNode('node')); - $this->assertEquals($name, $node->getNode('filter')); - $this->assertEquals($args, $node->getNode('arguments')); - } - - public function getTests() - { - $environment = new Environment($this->createMock('\Twig\Loader\LoaderInterface')); - $environment->addFilter(new TwigFilter('bar', 'bar', ['needs_environment' => true])); - $environment->addFilter(new TwigFilter('barbar', 'Twig\Tests\Node\Expression\twig_tests_filter_barbar', ['needs_context' => true, 'is_variadic' => true])); - - $tests = []; - - $expr = new ConstantExpression('foo', 1); - $node = $this->createFilter($expr, 'upper'); - $node = $this->createFilter($node, 'number_format', [new ConstantExpression(2, 1), new ConstantExpression('.', 1), new ConstantExpression(',', 1)]); - - if (\function_exists('mb_get_info')) { - $tests[] = [$node, 'twig_number_format_filter($this->env, twig_upper_filter($this->env, "foo"), 2, ".", ",")']; - } else { - $tests[] = [$node, 'twig_number_format_filter($this->env, strtoupper("foo"), 2, ".", ",")']; - } - - // named arguments - $date = new ConstantExpression(0, 1); - $node = $this->createFilter($date, 'date', [ - 'timezone' => new ConstantExpression('America/Chicago', 1), - 'format' => new ConstantExpression('d/m/Y H:i:s P', 1), - ]); - $tests[] = [$node, 'twig_date_format_filter($this->env, 0, "d/m/Y H:i:s P", "America/Chicago")']; - - // skip an optional argument - $date = new ConstantExpression(0, 1); - $node = $this->createFilter($date, 'date', [ - 'timezone' => new ConstantExpression('America/Chicago', 1), - ]); - $tests[] = [$node, 'twig_date_format_filter($this->env, 0, null, "America/Chicago")']; - - // underscores vs camelCase for named arguments - $string = new ConstantExpression('abc', 1); - $node = $this->createFilter($string, 'reverse', [ - 'preserve_keys' => new ConstantExpression(true, 1), - ]); - $tests[] = [$node, 'twig_reverse_filter($this->env, "abc", true)']; - $node = $this->createFilter($string, 'reverse', [ - 'preserveKeys' => new ConstantExpression(true, 1), - ]); - $tests[] = [$node, 'twig_reverse_filter($this->env, "abc", true)']; - - // filter as an anonymous function - if (\PHP_VERSION_ID >= 50300) { - $node = $this->createFilter(new ConstantExpression('foo', 1), 'anonymous'); - $tests[] = [$node, 'call_user_func_array($this->env->getFilter(\'anonymous\')->getCallable(), ["foo"])']; - } - - // needs environment - $node = $this->createFilter($string, 'bar'); - $tests[] = [$node, 'bar($this->env, "abc")', $environment]; - - $node = $this->createFilter($string, 'bar', [new ConstantExpression('bar', 1)]); - $tests[] = [$node, 'bar($this->env, "abc", "bar")', $environment]; - - // arbitrary named arguments - $node = $this->createFilter($string, 'barbar'); - $tests[] = [$node, 'Twig\Tests\Node\Expression\twig_tests_filter_barbar($context, "abc")', $environment]; - - $node = $this->createFilter($string, 'barbar', ['foo' => new ConstantExpression('bar', 1)]); - $tests[] = [$node, 'Twig\Tests\Node\Expression\twig_tests_filter_barbar($context, "abc", null, null, ["foo" => "bar"])', $environment]; - - $node = $this->createFilter($string, 'barbar', ['arg2' => new ConstantExpression('bar', 1)]); - $tests[] = [$node, 'Twig\Tests\Node\Expression\twig_tests_filter_barbar($context, "abc", null, "bar")', $environment]; - - $node = $this->createFilter($string, 'barbar', [ - new ConstantExpression('1', 1), - new ConstantExpression('2', 1), - new ConstantExpression('3', 1), - 'foo' => new ConstantExpression('bar', 1), - ]); - $tests[] = [$node, 'Twig\Tests\Node\Expression\twig_tests_filter_barbar($context, "abc", "1", "2", [0 => "3", "foo" => "bar"])', $environment]; - - return $tests; - } - - public function testCompileWithWrongNamedArgumentName() - { - $this->expectException('\Twig\Error\SyntaxError'); - $this->expectExceptionMessage('Unknown argument "foobar" for filter "date(format, timezone)" at line 1.'); - - $date = new ConstantExpression(0, 1); - $node = $this->createFilter($date, 'date', [ - 'foobar' => new ConstantExpression('America/Chicago', 1), - ]); - - $compiler = $this->getCompiler(); - $compiler->compile($node); - } - - public function testCompileWithMissingNamedArgument() - { - $this->expectException('\Twig\Error\SyntaxError'); - $this->expectExceptionMessage('Value for argument "from" is required for filter "replace" at line 1.'); - - $value = new ConstantExpression(0, 1); - $node = $this->createFilter($value, 'replace', [ - 'to' => new ConstantExpression('foo', 1), - ]); - - $compiler = $this->getCompiler(); - $compiler->compile($node); - } - - protected function createFilter($node, $name, array $arguments = []) - { - $name = new ConstantExpression($name, 1); - $arguments = new Node($arguments); - - return new FilterExpression($node, $name, $arguments, 1); - } - - protected function getEnvironment() - { - if (\PHP_VERSION_ID >= 50300) { - return include 'PHP53/FilterInclude.php'; - } - - return parent::getEnvironment(); - } -} - -function twig_tests_filter_barbar($context, $string, $arg1 = null, $arg2 = null, array $args = []) -{ -} diff --git a/vendor/twig/twig/tests/Node/Expression/FunctionTest.php b/vendor/twig/twig/tests/Node/Expression/FunctionTest.php deleted file mode 100644 index 489f17a..0000000 --- a/vendor/twig/twig/tests/Node/Expression/FunctionTest.php +++ /dev/null @@ -1,119 +0,0 @@ -assertEquals($name, $node->getAttribute('name')); - $this->assertEquals($args, $node->getNode('arguments')); - } - - public function getTests() - { - $environment = new Environment($this->createMock('\Twig\Loader\LoaderInterface')); - $environment->addFunction(new TwigFunction('foo', 'foo', [])); - $environment->addFunction(new TwigFunction('bar', 'bar', ['needs_environment' => true])); - $environment->addFunction(new TwigFunction('foofoo', 'foofoo', ['needs_context' => true])); - $environment->addFunction(new TwigFunction('foobar', 'foobar', ['needs_environment' => true, 'needs_context' => true])); - $environment->addFunction(new TwigFunction('barbar', 'Twig\Tests\Node\Expression\twig_tests_function_barbar', ['is_variadic' => true])); - - $tests = []; - - $node = $this->createFunction('foo'); - $tests[] = [$node, 'foo()', $environment]; - - $node = $this->createFunction('foo', [new ConstantExpression('bar', 1), new ConstantExpression('foobar', 1)]); - $tests[] = [$node, 'foo("bar", "foobar")', $environment]; - - $node = $this->createFunction('bar'); - $tests[] = [$node, 'bar($this->env)', $environment]; - - $node = $this->createFunction('bar', [new ConstantExpression('bar', 1)]); - $tests[] = [$node, 'bar($this->env, "bar")', $environment]; - - $node = $this->createFunction('foofoo'); - $tests[] = [$node, 'foofoo($context)', $environment]; - - $node = $this->createFunction('foofoo', [new ConstantExpression('bar', 1)]); - $tests[] = [$node, 'foofoo($context, "bar")', $environment]; - - $node = $this->createFunction('foobar'); - $tests[] = [$node, 'foobar($this->env, $context)', $environment]; - - $node = $this->createFunction('foobar', [new ConstantExpression('bar', 1)]); - $tests[] = [$node, 'foobar($this->env, $context, "bar")', $environment]; - - // named arguments - $node = $this->createFunction('date', [ - 'timezone' => new ConstantExpression('America/Chicago', 1), - 'date' => new ConstantExpression(0, 1), - ]); - $tests[] = [$node, 'twig_date_converter($this->env, 0, "America/Chicago")']; - - // arbitrary named arguments - $node = $this->createFunction('barbar'); - $tests[] = [$node, 'Twig\Tests\Node\Expression\twig_tests_function_barbar()', $environment]; - - $node = $this->createFunction('barbar', ['foo' => new ConstantExpression('bar', 1)]); - $tests[] = [$node, 'Twig\Tests\Node\Expression\twig_tests_function_barbar(null, null, ["foo" => "bar"])', $environment]; - - $node = $this->createFunction('barbar', ['arg2' => new ConstantExpression('bar', 1)]); - $tests[] = [$node, 'Twig\Tests\Node\Expression\twig_tests_function_barbar(null, "bar")', $environment]; - - $node = $this->createFunction('barbar', [ - new ConstantExpression('1', 1), - new ConstantExpression('2', 1), - new ConstantExpression('3', 1), - 'foo' => new ConstantExpression('bar', 1), - ]); - $tests[] = [$node, 'Twig\Tests\Node\Expression\twig_tests_function_barbar("1", "2", [0 => "3", "foo" => "bar"])', $environment]; - - // function as an anonymous function - if (\PHP_VERSION_ID >= 50300) { - $node = $this->createFunction('anonymous', [new ConstantExpression('foo', 1)]); - $tests[] = [$node, 'call_user_func_array($this->env->getFunction(\'anonymous\')->getCallable(), ["foo"])']; - } - - return $tests; - } - - protected function createFunction($name, array $arguments = []) - { - return new FunctionExpression($name, new Node($arguments), 1); - } - - protected function getEnvironment() - { - if (\PHP_VERSION_ID >= 50300) { - return include 'PHP53/FunctionInclude.php'; - } - - return parent::getEnvironment(); - } -} - -function twig_tests_function_barbar($arg1 = null, $arg2 = null, array $args = []) -{ -} diff --git a/vendor/twig/twig/tests/Node/Expression/GetAttrTest.php b/vendor/twig/twig/tests/Node/Expression/GetAttrTest.php deleted file mode 100644 index 5f9a0a7..0000000 --- a/vendor/twig/twig/tests/Node/Expression/GetAttrTest.php +++ /dev/null @@ -1,59 +0,0 @@ -addElement(new NameExpression('foo', 1)); - $args->addElement(new ConstantExpression('bar', 1)); - $node = new GetAttrExpression($expr, $attr, $args, Template::ARRAY_CALL, 1); - - $this->assertEquals($expr, $node->getNode('node')); - $this->assertEquals($attr, $node->getNode('attribute')); - $this->assertEquals($args, $node->getNode('arguments')); - $this->assertEquals(Template::ARRAY_CALL, $node->getAttribute('type')); - } - - public function getTests() - { - $tests = []; - - $expr = new NameExpression('foo', 1); - $attr = new ConstantExpression('bar', 1); - $args = new ArrayExpression([], 1); - $node = new GetAttrExpression($expr, $attr, $args, Template::ANY_CALL, 1); - $tests[] = [$node, sprintf('%s%s, "bar", [])', $this->getAttributeGetter(), $this->getVariableGetter('foo', 1))]; - - $node = new GetAttrExpression($expr, $attr, $args, Template::ARRAY_CALL, 1); - $tests[] = [$node, sprintf('%s%s, "bar", [], "array")', $this->getAttributeGetter(), $this->getVariableGetter('foo', 1))]; - - $args = new ArrayExpression([], 1); - $args->addElement(new NameExpression('foo', 1)); - $args->addElement(new ConstantExpression('bar', 1)); - $node = new GetAttrExpression($expr, $attr, $args, Template::METHOD_CALL, 1); - $tests[] = [$node, sprintf('%s%s, "bar", [0 => %s, 1 => "bar"], "method")', $this->getAttributeGetter(), $this->getVariableGetter('foo', 1), $this->getVariableGetter('foo'))]; - - return $tests; - } -} diff --git a/vendor/twig/twig/tests/Node/Expression/NameTest.php b/vendor/twig/twig/tests/Node/Expression/NameTest.php deleted file mode 100644 index 738f28a..0000000 --- a/vendor/twig/twig/tests/Node/Expression/NameTest.php +++ /dev/null @@ -1,49 +0,0 @@ -assertEquals('foo', $node->getAttribute('name')); - } - - public function getTests() - { - $node = new NameExpression('foo', 1); - $context = new NameExpression('_context', 1); - - $env = new Environment($this->createMock('\Twig\Loader\LoaderInterface'), ['strict_variables' => true]); - $env1 = new Environment($this->createMock('\Twig\Loader\LoaderInterface'), ['strict_variables' => false]); - - if (\PHP_VERSION_ID >= 70000) { - $output = '($context["foo"] ?? $this->getContext($context, "foo"))'; - } elseif (\PHP_VERSION_ID >= 50400) { - $output = '(isset($context["foo"]) ? $context["foo"] : $this->getContext($context, "foo"))'; - } else { - $output = '$this->getContext($context, "foo")'; - } - - return [ - [$node, "// line 1\n".$output, $env], - [$node, $this->getVariableGetter('foo', 1), $env1], - [$context, "// line 1\n\$context"], - ]; - } -} diff --git a/vendor/twig/twig/tests/Node/Expression/NullCoalesceTest.php b/vendor/twig/twig/tests/Node/Expression/NullCoalesceTest.php deleted file mode 100644 index bbfff57..0000000 --- a/vendor/twig/twig/tests/Node/Expression/NullCoalesceTest.php +++ /dev/null @@ -1,38 +0,0 @@ -= 70000) { - $tests[] = [$node, "((// line 1\n\$context[\"foo\"]) ?? (2))"]; - } elseif (\PHP_VERSION_ID >= 50400) { - $tests[] = [$node, "(((// line 1\n(isset(\$context[\"foo\"]) || array_key_exists(\"foo\", \$context)) && !(null === (isset(\$context[\"foo\"]) ? \$context[\"foo\"] : null)))) ? ((isset(\$context[\"foo\"]) ? \$context[\"foo\"] : null)) : (2))"]; - } else { - $tests[] = [$node, "(((// line 1\n(isset(\$context[\"foo\"]) || array_key_exists(\"foo\", \$context)) && !(null === \$this->getContext(\$context, \"foo\")))) ? (\$this->getContext(\$context, \"foo\")) : (2))"]; - } - - return $tests; - } -} diff --git a/vendor/twig/twig/tests/Node/Expression/PHP53/FilterInclude.php b/vendor/twig/twig/tests/Node/Expression/PHP53/FilterInclude.php deleted file mode 100644 index fc8f517..0000000 --- a/vendor/twig/twig/tests/Node/Expression/PHP53/FilterInclude.php +++ /dev/null @@ -1,8 +0,0 @@ -addFilter(new \Twig\TwigFilter('anonymous', function () {})); - -return $env; diff --git a/vendor/twig/twig/tests/Node/Expression/PHP53/FunctionInclude.php b/vendor/twig/twig/tests/Node/Expression/PHP53/FunctionInclude.php deleted file mode 100644 index b364001..0000000 --- a/vendor/twig/twig/tests/Node/Expression/PHP53/FunctionInclude.php +++ /dev/null @@ -1,8 +0,0 @@ -addFunction(new \Twig\TwigFunction('anonymous', function () {})); - -return $env; diff --git a/vendor/twig/twig/tests/Node/Expression/PHP53/TestInclude.php b/vendor/twig/twig/tests/Node/Expression/PHP53/TestInclude.php deleted file mode 100644 index b2bf2ce..0000000 --- a/vendor/twig/twig/tests/Node/Expression/PHP53/TestInclude.php +++ /dev/null @@ -1,8 +0,0 @@ -addTest(new \Twig\TwigTest('anonymous', function () {})); - -return $env; diff --git a/vendor/twig/twig/tests/Node/Expression/ParentTest.php b/vendor/twig/twig/tests/Node/Expression/ParentTest.php deleted file mode 100644 index 1a67b77..0000000 --- a/vendor/twig/twig/tests/Node/Expression/ParentTest.php +++ /dev/null @@ -1,33 +0,0 @@ -assertEquals('foo', $node->getAttribute('name')); - } - - public function getTests() - { - $tests = []; - $tests[] = [new ParentExpression('foo', 1), '$this->renderParentBlock("foo", $context, $blocks)']; - - return $tests; - } -} diff --git a/vendor/twig/twig/tests/Node/Expression/TestTest.php b/vendor/twig/twig/tests/Node/Expression/TestTest.php deleted file mode 100644 index 11e1596..0000000 --- a/vendor/twig/twig/tests/Node/Expression/TestTest.php +++ /dev/null @@ -1,92 +0,0 @@ -assertEquals($expr, $node->getNode('node')); - $this->assertEquals($args, $node->getNode('arguments')); - $this->assertEquals($name, $node->getAttribute('name')); - } - - public function getTests() - { - $environment = new Environment($this->createMock('\Twig\Loader\LoaderInterface')); - $environment->addTest(new TwigTest('barbar', 'Twig\Tests\Node\Expression\twig_tests_test_barbar', ['is_variadic' => true, 'need_context' => true])); - - $tests = []; - - $expr = new ConstantExpression('foo', 1); - $node = new NullTest($expr, 'null', new Node([]), 1); - $tests[] = [$node, '(null === "foo")']; - - // test as an anonymous function - if (\PHP_VERSION_ID >= 50300) { - $node = $this->createTest(new ConstantExpression('foo', 1), 'anonymous', [new ConstantExpression('foo', 1)]); - $tests[] = [$node, 'call_user_func_array($this->env->getTest(\'anonymous\')->getCallable(), ["foo", "foo"])']; - } - - // arbitrary named arguments - $string = new ConstantExpression('abc', 1); - $node = $this->createTest($string, 'barbar'); - $tests[] = [$node, 'Twig\Tests\Node\Expression\twig_tests_test_barbar("abc")', $environment]; - - $node = $this->createTest($string, 'barbar', ['foo' => new ConstantExpression('bar', 1)]); - $tests[] = [$node, 'Twig\Tests\Node\Expression\twig_tests_test_barbar("abc", null, null, ["foo" => "bar"])', $environment]; - - $node = $this->createTest($string, 'barbar', ['arg2' => new ConstantExpression('bar', 1)]); - $tests[] = [$node, 'Twig\Tests\Node\Expression\twig_tests_test_barbar("abc", null, "bar")', $environment]; - - $node = $this->createTest($string, 'barbar', [ - new ConstantExpression('1', 1), - new ConstantExpression('2', 1), - new ConstantExpression('3', 1), - 'foo' => new ConstantExpression('bar', 1), - ]); - $tests[] = [$node, 'Twig\Tests\Node\Expression\twig_tests_test_barbar("abc", "1", "2", [0 => "3", "foo" => "bar"])', $environment]; - - return $tests; - } - - protected function createTest($node, $name, array $arguments = []) - { - return new TestExpression($node, $name, new Node($arguments), 1); - } - - protected function getEnvironment() - { - if (\PHP_VERSION_ID >= 50300) { - return include 'PHP53/TestInclude.php'; - } - - return parent::getEnvironment(); - } -} - -function twig_tests_test_barbar($string, $arg1 = null, $arg2 = null, array $args = []) -{ -} diff --git a/vendor/twig/twig/tests/Node/Expression/Unary/NegTest.php b/vendor/twig/twig/tests/Node/Expression/Unary/NegTest.php deleted file mode 100644 index fcbf66e..0000000 --- a/vendor/twig/twig/tests/Node/Expression/Unary/NegTest.php +++ /dev/null @@ -1,38 +0,0 @@ -assertEquals($expr, $node->getNode('node')); - } - - public function getTests() - { - $node = new ConstantExpression(1, 1); - $node = new NegUnary($node, 1); - - return [ - [$node, '-1'], - [new NegUnary($node, 1), '- -1'], - ]; - } -} diff --git a/vendor/twig/twig/tests/Node/Expression/Unary/NotTest.php b/vendor/twig/twig/tests/Node/Expression/Unary/NotTest.php deleted file mode 100644 index 8197111..0000000 --- a/vendor/twig/twig/tests/Node/Expression/Unary/NotTest.php +++ /dev/null @@ -1,37 +0,0 @@ -assertEquals($expr, $node->getNode('node')); - } - - public function getTests() - { - $node = new ConstantExpression(1, 1); - $node = new NotUnary($node, 1); - - return [ - [$node, '!1'], - ]; - } -} diff --git a/vendor/twig/twig/tests/Node/Expression/Unary/PosTest.php b/vendor/twig/twig/tests/Node/Expression/Unary/PosTest.php deleted file mode 100644 index 780e339..0000000 --- a/vendor/twig/twig/tests/Node/Expression/Unary/PosTest.php +++ /dev/null @@ -1,37 +0,0 @@ -assertEquals($expr, $node->getNode('node')); - } - - public function getTests() - { - $node = new ConstantExpression(1, 1); - $node = new PosUnary($node, 1); - - return [ - [$node, '+1'], - ]; - } -} diff --git a/vendor/twig/twig/tests/Node/ForTest.php b/vendor/twig/twig/tests/Node/ForTest.php deleted file mode 100644 index d960ed6..0000000 --- a/vendor/twig/twig/tests/Node/ForTest.php +++ /dev/null @@ -1,201 +0,0 @@ -setAttribute('with_loop', false); - - $this->assertEquals($keyTarget, $node->getNode('key_target')); - $this->assertEquals($valueTarget, $node->getNode('value_target')); - $this->assertEquals($seq, $node->getNode('seq')); - $this->assertTrue($node->getAttribute('ifexpr')); - $this->assertInstanceOf('\Twig\Node\IfNode', $node->getNode('body')); - $this->assertEquals($body, $node->getNode('body')->getNode('tests')->getNode(1)->getNode(0)); - $this->assertFalse($node->hasNode('else')); - - $else = new PrintNode(new NameExpression('foo', 1), 1); - $node = new ForNode($keyTarget, $valueTarget, $seq, $ifexpr, $body, $else, 1); - $node->setAttribute('with_loop', false); - $this->assertEquals($else, $node->getNode('else')); - } - - public function getTests() - { - $tests = []; - - $keyTarget = new AssignNameExpression('key', 1); - $valueTarget = new AssignNameExpression('item', 1); - $seq = new NameExpression('items', 1); - $ifexpr = null; - $body = new Node([new PrintNode(new NameExpression('foo', 1), 1)], [], 1); - $else = null; - $node = new ForNode($keyTarget, $valueTarget, $seq, $ifexpr, $body, $else, 1); - $node->setAttribute('with_loop', false); - - $tests[] = [$node, <<getVariableGetter('items')}); -foreach (\$context['_seq'] as \$context["key"] => \$context["item"]) { - echo {$this->getVariableGetter('foo')}; -} -\$_parent = \$context['_parent']; -unset(\$context['_seq'], \$context['_iterated'], \$context['key'], \$context['item'], \$context['_parent'], \$context['loop']); -\$context = array_intersect_key(\$context, \$_parent) + \$_parent; -EOF - ]; - - $keyTarget = new AssignNameExpression('k', 1); - $valueTarget = new AssignNameExpression('v', 1); - $seq = new NameExpression('values', 1); - $ifexpr = null; - $body = new Node([new PrintNode(new NameExpression('foo', 1), 1)], [], 1); - $else = null; - $node = new ForNode($keyTarget, $valueTarget, $seq, $ifexpr, $body, $else, 1); - $node->setAttribute('with_loop', true); - - $tests[] = [$node, <<getVariableGetter('values')}); -\$context['loop'] = [ - 'parent' => \$context['_parent'], - 'index0' => 0, - 'index' => 1, - 'first' => true, -]; -if (is_array(\$context['_seq']) || (is_object(\$context['_seq']) && \$context['_seq'] instanceof \Countable)) { - \$length = count(\$context['_seq']); - \$context['loop']['revindex0'] = \$length - 1; - \$context['loop']['revindex'] = \$length; - \$context['loop']['length'] = \$length; - \$context['loop']['last'] = 1 === \$length; -} -foreach (\$context['_seq'] as \$context["k"] => \$context["v"]) { - echo {$this->getVariableGetter('foo')}; - ++\$context['loop']['index0']; - ++\$context['loop']['index']; - \$context['loop']['first'] = false; - if (isset(\$context['loop']['length'])) { - --\$context['loop']['revindex0']; - --\$context['loop']['revindex']; - \$context['loop']['last'] = 0 === \$context['loop']['revindex0']; - } -} -\$_parent = \$context['_parent']; -unset(\$context['_seq'], \$context['_iterated'], \$context['k'], \$context['v'], \$context['_parent'], \$context['loop']); -\$context = array_intersect_key(\$context, \$_parent) + \$_parent; -EOF - ]; - - $keyTarget = new AssignNameExpression('k', 1); - $valueTarget = new AssignNameExpression('v', 1); - $seq = new NameExpression('values', 1); - $ifexpr = new ConstantExpression(true, 1); - $body = new Node([new PrintNode(new NameExpression('foo', 1), 1)], [], 1); - $else = null; - $node = new ForNode($keyTarget, $valueTarget, $seq, $ifexpr, $body, $else, 1); - $node->setAttribute('with_loop', true); - - $tests[] = [$node, <<getVariableGetter('values')}); -\$context['loop'] = [ - 'parent' => \$context['_parent'], - 'index0' => 0, - 'index' => 1, - 'first' => true, -]; -foreach (\$context['_seq'] as \$context["k"] => \$context["v"]) { - if (true) { - echo {$this->getVariableGetter('foo')}; - ++\$context['loop']['index0']; - ++\$context['loop']['index']; - \$context['loop']['first'] = false; - } -} -\$_parent = \$context['_parent']; -unset(\$context['_seq'], \$context['_iterated'], \$context['k'], \$context['v'], \$context['_parent'], \$context['loop']); -\$context = array_intersect_key(\$context, \$_parent) + \$_parent; -EOF - ]; - - $keyTarget = new AssignNameExpression('k', 1); - $valueTarget = new AssignNameExpression('v', 1); - $seq = new NameExpression('values', 1); - $ifexpr = null; - $body = new Node([new PrintNode(new NameExpression('foo', 1), 1)], [], 1); - $else = new PrintNode(new NameExpression('foo', 1), 1); - $node = new ForNode($keyTarget, $valueTarget, $seq, $ifexpr, $body, $else, 1); - $node->setAttribute('with_loop', true); - - $tests[] = [$node, <<getVariableGetter('values')}); -\$context['_iterated'] = false; -\$context['loop'] = [ - 'parent' => \$context['_parent'], - 'index0' => 0, - 'index' => 1, - 'first' => true, -]; -if (is_array(\$context['_seq']) || (is_object(\$context['_seq']) && \$context['_seq'] instanceof \Countable)) { - \$length = count(\$context['_seq']); - \$context['loop']['revindex0'] = \$length - 1; - \$context['loop']['revindex'] = \$length; - \$context['loop']['length'] = \$length; - \$context['loop']['last'] = 1 === \$length; -} -foreach (\$context['_seq'] as \$context["k"] => \$context["v"]) { - echo {$this->getVariableGetter('foo')}; - \$context['_iterated'] = true; - ++\$context['loop']['index0']; - ++\$context['loop']['index']; - \$context['loop']['first'] = false; - if (isset(\$context['loop']['length'])) { - --\$context['loop']['revindex0']; - --\$context['loop']['revindex']; - \$context['loop']['last'] = 0 === \$context['loop']['revindex0']; - } -} -if (!\$context['_iterated']) { - echo {$this->getVariableGetter('foo')}; -} -\$_parent = \$context['_parent']; -unset(\$context['_seq'], \$context['_iterated'], \$context['k'], \$context['v'], \$context['_parent'], \$context['loop']); -\$context = array_intersect_key(\$context, \$_parent) + \$_parent; -EOF - ]; - - return $tests; - } -} diff --git a/vendor/twig/twig/tests/Node/IfTest.php b/vendor/twig/twig/tests/Node/IfTest.php deleted file mode 100644 index d5a6eac..0000000 --- a/vendor/twig/twig/tests/Node/IfTest.php +++ /dev/null @@ -1,97 +0,0 @@ -assertEquals($t, $node->getNode('tests')); - $this->assertFalse($node->hasNode('else')); - - $else = new PrintNode(new NameExpression('bar', 1), 1); - $node = new IfNode($t, $else, 1); - $this->assertEquals($else, $node->getNode('else')); - } - - public function getTests() - { - $tests = []; - - $t = new Node([ - new ConstantExpression(true, 1), - new PrintNode(new NameExpression('foo', 1), 1), - ], [], 1); - $else = null; - $node = new IfNode($t, $else, 1); - - $tests[] = [$node, <<getVariableGetter('foo')}; -} -EOF - ]; - - $t = new Node([ - new ConstantExpression(true, 1), - new PrintNode(new NameExpression('foo', 1), 1), - new ConstantExpression(false, 1), - new PrintNode(new NameExpression('bar', 1), 1), - ], [], 1); - $else = null; - $node = new IfNode($t, $else, 1); - - $tests[] = [$node, <<getVariableGetter('foo')}; -} elseif (false) { - echo {$this->getVariableGetter('bar')}; -} -EOF - ]; - - $t = new Node([ - new ConstantExpression(true, 1), - new PrintNode(new NameExpression('foo', 1), 1), - ], [], 1); - $else = new PrintNode(new NameExpression('bar', 1), 1); - $node = new IfNode($t, $else, 1); - - $tests[] = [$node, <<getVariableGetter('foo')}; -} else { - echo {$this->getVariableGetter('bar')}; -} -EOF - ]; - - return $tests; - } -} diff --git a/vendor/twig/twig/tests/Node/ImportTest.php b/vendor/twig/twig/tests/Node/ImportTest.php deleted file mode 100644 index dbb49ab..0000000 --- a/vendor/twig/twig/tests/Node/ImportTest.php +++ /dev/null @@ -1,47 +0,0 @@ -assertEquals($macro, $node->getNode('expr')); - $this->assertEquals($var, $node->getNode('var')); - } - - public function getTests() - { - $tests = []; - - $macro = new ConstantExpression('foo.twig', 1); - $var = new AssignNameExpression('macro', 1); - $node = new ImportNode($macro, $var, 1); - - $tests[] = [$node, <<loadTemplate("foo.twig", null, 1)->unwrap(); -EOF - ]; - - return $tests; - } -} diff --git a/vendor/twig/twig/tests/Node/IncludeTest.php b/vendor/twig/twig/tests/Node/IncludeTest.php deleted file mode 100644 index ab1fdf0..0000000 --- a/vendor/twig/twig/tests/Node/IncludeTest.php +++ /dev/null @@ -1,95 +0,0 @@ -assertFalse($node->hasNode('variables')); - $this->assertEquals($expr, $node->getNode('expr')); - $this->assertFalse($node->getAttribute('only')); - - $vars = new ArrayExpression([new ConstantExpression('foo', 1), new ConstantExpression(true, 1)], 1); - $node = new IncludeNode($expr, $vars, true, false, 1); - $this->assertEquals($vars, $node->getNode('variables')); - $this->assertTrue($node->getAttribute('only')); - } - - public function getTests() - { - $tests = []; - - $expr = new ConstantExpression('foo.twig', 1); - $node = new IncludeNode($expr, null, false, false, 1); - $tests[] = [$node, <<loadTemplate("foo.twig", null, 1)->display(\$context); -EOF - ]; - - $expr = new ConditionalExpression( - new ConstantExpression(true, 1), - new ConstantExpression('foo', 1), - new ConstantExpression('foo', 1), - 0 - ); - $node = new IncludeNode($expr, null, false, false, 1); - $tests[] = [$node, <<loadTemplate(((true) ? ("foo") : ("foo")), null, 1)->display(\$context); -EOF - ]; - - $expr = new ConstantExpression('foo.twig', 1); - $vars = new ArrayExpression([new ConstantExpression('foo', 1), new ConstantExpression(true, 1)], 1); - $node = new IncludeNode($expr, $vars, false, false, 1); - $tests[] = [$node, <<loadTemplate("foo.twig", null, 1)->display(twig_array_merge(\$context, ["foo" => true])); -EOF - ]; - - $node = new IncludeNode($expr, $vars, true, false, 1); - $tests[] = [$node, <<loadTemplate("foo.twig", null, 1)->display(twig_to_array(["foo" => true])); -EOF - ]; - - $node = new IncludeNode($expr, $vars, true, true, 1); - $tests[] = [$node, <<loadTemplate("foo.twig", null, 1); -} catch (LoaderError \$e) { - // ignore missing template -} -if (\$__internal_%s) { - \$__internal_%s->display(twig_to_array(["foo" => true])); -} -EOF - , null, true]; - - return $tests; - } -} diff --git a/vendor/twig/twig/tests/Node/MacroTest.php b/vendor/twig/twig/tests/Node/MacroTest.php deleted file mode 100644 index 82fc999..0000000 --- a/vendor/twig/twig/tests/Node/MacroTest.php +++ /dev/null @@ -1,83 +0,0 @@ -assertEquals($body, $node->getNode('body')); - $this->assertEquals($arguments, $node->getNode('arguments')); - $this->assertEquals('foo', $node->getAttribute('name')); - } - - public function getTests() - { - $body = new TextNode('foo', 1); - $arguments = new Node([ - 'foo' => new ConstantExpression(null, 1), - 'bar' => new ConstantExpression('Foo', 1), - ], [], 1); - $node = new MacroNode('foo', $body, $arguments, 1); - - if (\PHP_VERSION_ID >= 50600) { - $declaration = ', ...$__varargs__'; - $varargs = '$__varargs__'; - } else { - $declaration = ''; - $varargs = 'func_num_args() > 2 ? array_slice(func_get_args(), 2) : []'; - } - - return [ - [$node, <<env->mergeGlobals([ - "foo" => \$__foo__, - "bar" => \$__bar__, - "varargs" => $varargs, - ]); - - \$blocks = []; - - ob_start(function () { return ''; }); - try { - echo "foo"; - } catch (\Exception \$e) { - ob_end_clean(); - - throw \$e; - } catch (\Throwable \$e) { - ob_end_clean(); - - throw \$e; - } - - return ('' === \$tmp = ob_get_clean()) ? '' : new Markup(\$tmp, \$this->env->getCharset()); -} -EOF - ], - ]; - } -} diff --git a/vendor/twig/twig/tests/Node/ModuleTest.php b/vendor/twig/twig/tests/Node/ModuleTest.php deleted file mode 100644 index aa000d3..0000000 --- a/vendor/twig/twig/tests/Node/ModuleTest.php +++ /dev/null @@ -1,270 +0,0 @@ -assertEquals($body, $node->getNode('body')); - $this->assertEquals($blocks, $node->getNode('blocks')); - $this->assertEquals($macros, $node->getNode('macros')); - $this->assertEquals($parent, $node->getNode('parent')); - $this->assertEquals($source->getName(), $node->getTemplateName()); - } - - public function getTests() - { - $twig = new Environment($this->createMock('\Twig\Loader\LoaderInterface')); - - $tests = []; - - $body = new TextNode('foo', 1); - $extends = null; - $blocks = new Node(); - $macros = new Node(); - $traits = new Node(); - $source = new Source('{{ foo }}', 'foo.twig'); - - $node = new ModuleNode($body, $extends, $blocks, $macros, $traits, new Node([]), $source); - $tests[] = [$node, <<parent = false; - - \$this->blocks = [ - ]; - } - - protected function doDisplay(array \$context, array \$blocks = []) - { - // line 1 - echo "foo"; - } - - public function getTemplateName() - { - return "foo.twig"; - } - - public function getDebugInfo() - { - return array ( 30 => 1,); - } - - /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */ - public function getSource() - { - @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED); - - return \$this->getSourceContext()->getCode(); - } - - public function getSourceContext() - { - return new Source("", "foo.twig", ""); - } -} -EOF - , $twig, true]; - - $import = new ImportNode(new ConstantExpression('foo.twig', 1), new AssignNameExpression('macro', 1), 2); - - $body = new Node([$import]); - $extends = new ConstantExpression('layout.twig', 1); - - $node = new ModuleNode($body, $extends, $blocks, $macros, $traits, new Node([]), $source); - $tests[] = [$node, <<blocks = [ - ]; - } - - protected function doGetParent(array \$context) - { - // line 1 - return "layout.twig"; - } - - protected function doDisplay(array \$context, array \$blocks = []) - { - // line 2 - \$context["macro"] = \$this->loadTemplate("foo.twig", "foo.twig", 2)->unwrap(); - // line 1 - \$this->parent = \$this->loadTemplate("layout.twig", "foo.twig", 1); - \$this->parent->display(\$context, array_merge(\$this->blocks, \$blocks)); - } - - public function getTemplateName() - { - return "foo.twig"; - } - - public function isTraitable() - { - return false; - } - - public function getDebugInfo() - { - return array ( 36 => 1, 34 => 2, 28 => 1,); - } - - /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */ - public function getSource() - { - @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED); - - return \$this->getSourceContext()->getCode(); - } - - public function getSourceContext() - { - return new Source("", "foo.twig", ""); - } -} -EOF - , $twig, true]; - - $set = new SetNode(false, new Node([new AssignNameExpression('foo', 4)]), new Node([new ConstantExpression('foo', 4)]), 4); - $body = new Node([$set]); - $extends = new ConditionalExpression( - new ConstantExpression(true, 2), - new ConstantExpression('foo', 2), - new ConstantExpression('foo', 2), - 2 - ); - - $twig = new Environment($this->createMock('\Twig\Loader\LoaderInterface'), ['debug' => true]); - $node = new ModuleNode($body, $extends, $blocks, $macros, $traits, new Node([]), $source); - $tests[] = [$node, <<loadTemplate(((true) ? ("foo") : ("foo")), "foo.twig", 2); - } - - protected function doDisplay(array \$context, array \$blocks = []) - { - // line 4 - \$context["foo"] = "foo"; - // line 2 - \$this->getParent(\$context)->display(\$context, array_merge(\$this->blocks, \$blocks)); - } - - public function getTemplateName() - { - return "foo.twig"; - } - - public function isTraitable() - { - return false; - } - - public function getDebugInfo() - { - return array ( 28 => 2, 26 => 4, 20 => 2,); - } - - /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */ - public function getSource() - { - @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED); - - return \$this->getSourceContext()->getCode(); - } - - public function getSourceContext() - { - return new Source("{{ foo }}", "foo.twig", ""); - } -} -EOF - , $twig, true]; - - return $tests; - } -} diff --git a/vendor/twig/twig/tests/Node/PrintTest.php b/vendor/twig/twig/tests/Node/PrintTest.php deleted file mode 100644 index 49f8eb4..0000000 --- a/vendor/twig/twig/tests/Node/PrintTest.php +++ /dev/null @@ -1,35 +0,0 @@ -assertEquals($expr, $node->getNode('expr')); - } - - public function getTests() - { - $tests = []; - $tests[] = [new PrintNode(new ConstantExpression('foo', 1), 1), "// line 1\necho \"foo\";"]; - - return $tests; - } -} diff --git a/vendor/twig/twig/tests/Node/SandboxTest.php b/vendor/twig/twig/tests/Node/SandboxTest.php deleted file mode 100644 index b81781e..0000000 --- a/vendor/twig/twig/tests/Node/SandboxTest.php +++ /dev/null @@ -1,49 +0,0 @@ -assertEquals($body, $node->getNode('body')); - } - - public function getTests() - { - $tests = []; - - $body = new TextNode('foo', 1); - $node = new SandboxNode($body, 1); - - $tests[] = [$node, <<sandbox->isSandboxed()) { - \$this->sandbox->enableSandbox(); -} -echo "foo"; -if (!\$alreadySandboxed) { - \$this->sandbox->disableSandbox(); -} -EOF - ]; - - return $tests; - } -} diff --git a/vendor/twig/twig/tests/Node/SetTest.php b/vendor/twig/twig/tests/Node/SetTest.php deleted file mode 100644 index 370af95..0000000 --- a/vendor/twig/twig/tests/Node/SetTest.php +++ /dev/null @@ -1,80 +0,0 @@ -assertEquals($names, $node->getNode('names')); - $this->assertEquals($values, $node->getNode('values')); - $this->assertFalse($node->getAttribute('capture')); - } - - public function getTests() - { - $tests = []; - - $names = new Node([new AssignNameExpression('foo', 1)], [], 1); - $values = new Node([new ConstantExpression('foo', 1)], [], 1); - $node = new SetNode(false, $names, $values, 1); - $tests[] = [$node, <<env->getCharset()); -EOF - ]; - - $names = new Node([new AssignNameExpression('foo', 1)], [], 1); - $values = new TextNode('foo', 1); - $node = new SetNode(true, $names, $values, 1); - $tests[] = [$node, <<env->getCharset()); -EOF - ]; - - $names = new Node([new AssignNameExpression('foo', 1), new AssignNameExpression('bar', 1)], [], 1); - $values = new Node([new ConstantExpression('foo', 1), new NameExpression('bar', 1)], [], 1); - $node = new SetNode(false, $names, $values, 1); - $tests[] = [$node, <<getVariableGetter('bar')}]; -EOF - ]; - - return $tests; - } -} diff --git a/vendor/twig/twig/tests/Node/SpacelessTest.php b/vendor/twig/twig/tests/Node/SpacelessTest.php deleted file mode 100644 index 5f3c814..0000000 --- a/vendor/twig/twig/tests/Node/SpacelessTest.php +++ /dev/null @@ -1,44 +0,0 @@ -
    foo
    ', 1)]); - $node = new SpacelessNode($body, 1); - - $this->assertEquals($body, $node->getNode('body')); - } - - public function getTests() - { - $body = new Node([new TextNode('
    foo
    ', 1)]); - $node = new SpacelessNode($body, 1); - - return [ - [$node, <<
    foo
    "; -echo trim(preg_replace('/>\s+<', ob_get_clean())); -EOF - ], - ]; - } -} diff --git a/vendor/twig/twig/tests/Node/TextTest.php b/vendor/twig/twig/tests/Node/TextTest.php deleted file mode 100644 index ace1912..0000000 --- a/vendor/twig/twig/tests/Node/TextTest.php +++ /dev/null @@ -1,33 +0,0 @@ -assertEquals('foo', $node->getAttribute('data')); - } - - public function getTests() - { - $tests = []; - $tests[] = [new TextNode('foo', 1), "// line 1\necho \"foo\";"]; - - return $tests; - } -} diff --git a/vendor/twig/twig/tests/NodeTraverserTest.php b/vendor/twig/twig/tests/NodeTraverserTest.php deleted file mode 100644 index 7136ae7..0000000 --- a/vendor/twig/twig/tests/NodeTraverserTest.php +++ /dev/null @@ -1,49 +0,0 @@ -createMock('\Twig\Loader\LoaderInterface')); - $traverser = new NodeTraverser($env, [new IdentityVisitor()]); - $n = new Node([new Node([]), null, new Node([])]); - $this->assertCount(3, $traverser->traverse($n)); - } -} - -class IdentityVisitor implements NodeVisitorInterface -{ - public function enterNode(\Twig_NodeInterface $node, Environment $env) - { - return $node; - } - - public function leaveNode(\Twig_NodeInterface $node, Environment $env) - { - return $node; - } - - public function getPriority() - { - return 0; - } -} diff --git a/vendor/twig/twig/tests/NodeVisitor/OptimizerTest.php b/vendor/twig/twig/tests/NodeVisitor/OptimizerTest.php deleted file mode 100644 index 6bcc828..0000000 --- a/vendor/twig/twig/tests/NodeVisitor/OptimizerTest.php +++ /dev/null @@ -1,116 +0,0 @@ -createMock('\Twig\Loader\LoaderInterface'), ['cache' => false, 'autoescape' => false]); - - $stream = $env->parse($env->tokenize(new Source('{{ block("foo") }}', 'index'))); - - $node = $stream->getNode('body')->getNode(0); - - $this->assertInstanceOf('\Twig\Node\Expression\BlockReferenceExpression', $node); - $this->assertTrue($node->getAttribute('output')); - } - - public function testRenderParentBlockOptimizer() - { - $env = new Environment($this->createMock('\Twig\Loader\LoaderInterface'), ['cache' => false, 'autoescape' => false]); - - $stream = $env->parse($env->tokenize(new Source('{% extends "foo" %}{% block content %}{{ parent() }}{% endblock %}', 'index'))); - - $node = $stream->getNode('blocks')->getNode('content')->getNode(0)->getNode('body'); - - $this->assertInstanceOf('\Twig\Node\Expression\ParentExpression', $node); - $this->assertTrue($node->getAttribute('output')); - } - - /** - * @dataProvider getTestsForForOptimizer - */ - public function testForOptimizer($template, $expected) - { - $env = new Environment($this->createMock('\Twig\Loader\LoaderInterface'), ['cache' => false]); - - $stream = $env->parse($env->tokenize(new Source($template, 'index'))); - - foreach ($expected as $target => $withLoop) { - $this->assertTrue($this->checkForConfiguration($stream, $target, $withLoop), sprintf('variable %s is %soptimized', $target, $withLoop ? 'not ' : '')); - } - } - - public function getTestsForForOptimizer() - { - return [ - ['{% for i in foo %}{% endfor %}', ['i' => false]], - - ['{% for i in foo %}{{ loop.index }}{% endfor %}', ['i' => true]], - - ['{% for i in foo %}{% for j in foo %}{% endfor %}{% endfor %}', ['i' => false, 'j' => false]], - - ['{% for i in foo %}{% include "foo" %}{% endfor %}', ['i' => true]], - - ['{% for i in foo %}{% include "foo" only %}{% endfor %}', ['i' => false]], - - ['{% for i in foo %}{% include "foo" with { "foo": "bar" } only %}{% endfor %}', ['i' => false]], - - ['{% for i in foo %}{% include "foo" with { "foo": loop.index } only %}{% endfor %}', ['i' => true]], - - ['{% for i in foo %}{% for j in foo %}{{ loop.index }}{% endfor %}{% endfor %}', ['i' => false, 'j' => true]], - - ['{% for i in foo %}{% for j in foo %}{{ loop.parent.loop.index }}{% endfor %}{% endfor %}', ['i' => true, 'j' => true]], - - ['{% for i in foo %}{% set l = loop %}{% for j in foo %}{{ l.index }}{% endfor %}{% endfor %}', ['i' => true, 'j' => false]], - - ['{% for i in foo %}{% for j in foo %}{{ foo.parent.loop.index }}{% endfor %}{% endfor %}', ['i' => false, 'j' => false]], - - ['{% for i in foo %}{% for j in foo %}{{ loop["parent"].loop.index }}{% endfor %}{% endfor %}', ['i' => true, 'j' => true]], - - ['{% for i in foo %}{{ include("foo") }}{% endfor %}', ['i' => true]], - - ['{% for i in foo %}{{ include("foo", with_context = false) }}{% endfor %}', ['i' => false]], - - ['{% for i in foo %}{{ include("foo", with_context = true) }}{% endfor %}', ['i' => true]], - - ['{% for i in foo %}{{ include("foo", { "foo": "bar" }, with_context = false) }}{% endfor %}', ['i' => false]], - - ['{% for i in foo %}{{ include("foo", { "foo": loop.index }, with_context = false) }}{% endfor %}', ['i' => true]], - ]; - } - - public function checkForConfiguration(\Twig_NodeInterface $node = null, $target, $withLoop) - { - if (null === $node) { - return; - } - - foreach ($node as $n) { - if ($n instanceof ForNode) { - if ($target === $n->getNode('value_target')->getAttribute('name')) { - return $withLoop == $n->getAttribute('with_loop'); - } - } - - $ret = $this->checkForConfiguration($n, $target, $withLoop); - if (null !== $ret) { - return $ret; - } - } - } -} diff --git a/vendor/twig/twig/tests/ParserTest.php b/vendor/twig/twig/tests/ParserTest.php deleted file mode 100644 index 917d5de..0000000 --- a/vendor/twig/twig/tests/ParserTest.php +++ /dev/null @@ -1,218 +0,0 @@ -expectException('\Twig\Error\SyntaxError'); - - $parser = $this->getParser(); - $parser->setMacro('parent', new MacroNode('foo', new Node(), new Node(), 1)); - } - - public function testUnknownTag() - { - $this->expectException('\Twig\Error\SyntaxError'); - $this->expectExceptionMessage('Unknown "foo" tag. Did you mean "for" at line 1?'); - - $stream = new TokenStream([ - new Token(Token::BLOCK_START_TYPE, '', 1), - new Token(Token::NAME_TYPE, 'foo', 1), - new Token(Token::BLOCK_END_TYPE, '', 1), - new Token(Token::EOF_TYPE, '', 1), - ]); - $parser = new Parser(new Environment($this->createMock('\Twig\Loader\LoaderInterface'))); - $parser->parse($stream); - } - - public function testUnknownTagWithoutSuggestions() - { - $this->expectException('\Twig\Error\SyntaxError'); - $this->expectExceptionMessage('Unknown "foobar" tag at line 1.'); - - $stream = new TokenStream([ - new Token(Token::BLOCK_START_TYPE, '', 1), - new Token(Token::NAME_TYPE, 'foobar', 1), - new Token(Token::BLOCK_END_TYPE, '', 1), - new Token(Token::EOF_TYPE, '', 1), - ]); - $parser = new Parser(new Environment($this->createMock('\Twig\Loader\LoaderInterface'))); - $parser->parse($stream); - } - - /** - * @dataProvider getFilterBodyNodesData - */ - public function testFilterBodyNodes($input, $expected) - { - $parser = $this->getParser(); - - $this->assertEquals($expected, $parser->filterBodyNodes($input)); - } - - public function getFilterBodyNodesData() - { - return [ - [ - new Node([new TextNode(' ', 1)]), - new Node([]), - ], - [ - $input = new Node([new SetNode(false, new Node(), new Node(), 1)]), - $input, - ], - [ - $input = new Node([new SetNode(true, new Node(), new Node([new Node([new TextNode('foo', 1)])]), 1)]), - $input, - ], - ]; - } - - /** - * @dataProvider getFilterBodyNodesDataThrowsException - */ - public function testFilterBodyNodesThrowsException($input) - { - $this->expectException('\Twig\Error\SyntaxError'); - - $parser = $this->getParser(); - - $parser->filterBodyNodes($input); - } - - public function getFilterBodyNodesDataThrowsException() - { - return [ - [new TextNode('foo', 1)], - [new Node([new Node([new TextNode('foo', 1)])])], - ]; - } - - /** - * @dataProvider getFilterBodyNodesWithBOMData - */ - public function testFilterBodyNodesWithBOM($emptyNode) - { - $this->assertNull($this->getParser()->filterBodyNodes(new TextNode(\chr(0xEF).\chr(0xBB).\chr(0xBF).$emptyNode, 1))); - } - - public function getFilterBodyNodesWithBOMData() - { - return [ - [' '], - ["\t"], - ["\n"], - ["\n\t\n "], - ]; - } - - public function testParseIsReentrant() - { - $twig = new Environment($this->createMock('\Twig\Loader\LoaderInterface'), [ - 'autoescape' => false, - 'optimizations' => 0, - ]); - $twig->addTokenParser(new TestTokenParser()); - - $parser = new Parser($twig); - - $parser->parse(new TokenStream([ - new Token(Token::BLOCK_START_TYPE, '', 1), - new Token(Token::NAME_TYPE, 'test', 1), - new Token(Token::BLOCK_END_TYPE, '', 1), - new Token(Token::VAR_START_TYPE, '', 1), - new Token(Token::NAME_TYPE, 'foo', 1), - new Token(Token::VAR_END_TYPE, '', 1), - new Token(Token::EOF_TYPE, '', 1), - ])); - - $this->assertNull($parser->getParent()); - } - - public function testGetVarName() - { - $twig = new Environment($this->createMock('\Twig\Loader\LoaderInterface'), [ - 'autoescape' => false, - 'optimizations' => 0, - ]); - - $twig->parse($twig->tokenize(new Source(<<addToAssertionCount(1); - } - - protected function getParser() - { - $parser = new TestParser(new Environment($this->createMock('\Twig\Loader\LoaderInterface'))); - $parser->setParent(new Node()); - $parser->stream = new TokenStream([]); - - return $parser; - } -} - -class TestParser extends Parser -{ - public $stream; - - public function filterBodyNodes(\Twig_NodeInterface $node) - { - return parent::filterBodyNodes($node); - } -} - -class TestTokenParser extends AbstractTokenParser -{ - public function parse(Token $token) - { - // simulate the parsing of another template right in the middle of the parsing of the current template - $this->parser->parse(new TokenStream([ - new Token(Token::BLOCK_START_TYPE, '', 1), - new Token(Token::NAME_TYPE, 'extends', 1), - new Token(Token::STRING_TYPE, 'base', 1), - new Token(Token::BLOCK_END_TYPE, '', 1), - new Token(Token::EOF_TYPE, '', 1), - ])); - - $this->parser->getStream()->expect(Token::BLOCK_END_TYPE); - - return new Node([]); - } - - public function getTag() - { - return 'test'; - } -} diff --git a/vendor/twig/twig/tests/Profiler/Dumper/AbstractTest.php b/vendor/twig/twig/tests/Profiler/Dumper/AbstractTest.php deleted file mode 100644 index a55bfa0..0000000 --- a/vendor/twig/twig/tests/Profiler/Dumper/AbstractTest.php +++ /dev/null @@ -1,107 +0,0 @@ -getIndexProfile( - [ - $this->getEmbeddedBlockProfile(), - $this->getEmbeddedTemplateProfile( - [ - $this->getIncludedTemplateProfile(), - ] - ), - $this->getMacroProfile(), - $this->getEmbeddedTemplateProfile( - [ - $this->getIncludedTemplateProfile(), - ] - ), - ] - ), - ]; - - $p = new \ReflectionProperty($profile, 'profiles'); - $p->setAccessible(true); - $p->setValue($profile, $subProfiles); - - return $profile; - } - - private function getIndexProfile(array $subProfiles = []) - { - return $this->generateProfile('main', 1, 'template', 'index.twig', $subProfiles); - } - - private function getEmbeddedBlockProfile(array $subProfiles = []) - { - return $this->generateProfile('body', 0.0001, 'block', 'embedded.twig', $subProfiles); - } - - private function getEmbeddedTemplateProfile(array $subProfiles = []) - { - return $this->generateProfile('main', 0.0001, 'template', 'embedded.twig', $subProfiles); - } - - private function getIncludedTemplateProfile(array $subProfiles = []) - { - return $this->generateProfile('main', 0.0001, 'template', 'included.twig', $subProfiles); - } - - private function getMacroProfile(array $subProfiles = []) - { - return $this->generateProfile('foo', 0.0001, 'macro', 'index.twig', $subProfiles); - } - - /** - * @param string $name - * @param float $duration - * @param bool $isTemplate - * @param string $type - * @param string $templateName - * @param array $subProfiles - * - * @return Profile - */ - private function generateProfile($name, $duration, $type, $templateName, array $subProfiles = []) - { - $profile = new Profile($templateName, $type, $name); - - $p = new \ReflectionProperty($profile, 'profiles'); - $p->setAccessible(true); - $p->setValue($profile, $subProfiles); - - $starts = new \ReflectionProperty($profile, 'starts'); - $starts->setAccessible(true); - $starts->setValue($profile, [ - 'wt' => 0, - 'mu' => 0, - 'pmu' => 0, - ]); - $ends = new \ReflectionProperty($profile, 'ends'); - $ends->setAccessible(true); - $ends->setValue($profile, [ - 'wt' => $duration, - 'mu' => 0, - 'pmu' => 0, - ]); - - return $profile; - } -} diff --git a/vendor/twig/twig/tests/Profiler/Dumper/BlackfireTest.php b/vendor/twig/twig/tests/Profiler/Dumper/BlackfireTest.php deleted file mode 100644 index b1c2cd7..0000000 --- a/vendor/twig/twig/tests/Profiler/Dumper/BlackfireTest.php +++ /dev/null @@ -1,36 +0,0 @@ -assertStringMatchesFormat(<<index.twig//1 %d %d %d -index.twig==>embedded.twig::block(body)//1 %d %d 0 -index.twig==>embedded.twig//2 %d %d %d -embedded.twig==>included.twig//2 %d %d %d -index.twig==>index.twig::macro(foo)//1 %d %d %d -EOF - , $dumper->dump($this->getProfile())); - } -} diff --git a/vendor/twig/twig/tests/Profiler/Dumper/HtmlTest.php b/vendor/twig/twig/tests/Profiler/Dumper/HtmlTest.php deleted file mode 100644 index 20a1ab4..0000000 --- a/vendor/twig/twig/tests/Profiler/Dumper/HtmlTest.php +++ /dev/null @@ -1,34 +0,0 @@ -assertStringMatchesFormat(<<main %d.%dms/%d% -└ index.twig %d.%dms/%d% - └ embedded.twig::block(body) - └ embedded.twig - │ └ included.twig - └ index.twig::macro(foo) - └ embedded.twig - └ included.twig - -EOF - , $dumper->dump($this->getProfile())); - } -} diff --git a/vendor/twig/twig/tests/Profiler/Dumper/TextTest.php b/vendor/twig/twig/tests/Profiler/Dumper/TextTest.php deleted file mode 100644 index 8240e35..0000000 --- a/vendor/twig/twig/tests/Profiler/Dumper/TextTest.php +++ /dev/null @@ -1,34 +0,0 @@ -assertStringMatchesFormat(<<dump($this->getProfile())); - } -} diff --git a/vendor/twig/twig/tests/Profiler/ProfileTest.php b/vendor/twig/twig/tests/Profiler/ProfileTest.php deleted file mode 100644 index 0b7fd27..0000000 --- a/vendor/twig/twig/tests/Profiler/ProfileTest.php +++ /dev/null @@ -1,114 +0,0 @@ -assertEquals('template', $profile->getTemplate()); - $this->assertEquals('type', $profile->getType()); - $this->assertEquals('name', $profile->getName()); - } - - public function testIsRoot() - { - $profile = new Profile('template', Profile::ROOT); - $this->assertTrue($profile->isRoot()); - - $profile = new Profile('template', Profile::TEMPLATE); - $this->assertFalse($profile->isRoot()); - } - - public function testIsTemplate() - { - $profile = new Profile('template', Profile::TEMPLATE); - $this->assertTrue($profile->isTemplate()); - - $profile = new Profile('template', Profile::ROOT); - $this->assertFalse($profile->isTemplate()); - } - - public function testIsBlock() - { - $profile = new Profile('template', Profile::BLOCK); - $this->assertTrue($profile->isBlock()); - - $profile = new Profile('template', Profile::ROOT); - $this->assertFalse($profile->isBlock()); - } - - public function testIsMacro() - { - $profile = new Profile('template', Profile::MACRO); - $this->assertTrue($profile->isMacro()); - - $profile = new Profile('template', Profile::ROOT); - $this->assertFalse($profile->isMacro()); - } - - public function testGetAddProfile() - { - $profile = new Profile(); - $profile->addProfile($a = new Profile()); - $profile->addProfile($b = new Profile()); - - $this->assertSame([$a, $b], $profile->getProfiles()); - $this->assertSame([$a, $b], iterator_to_array($profile)); - } - - public function testGetDuration() - { - $profile = new Profile(); - usleep(1); - $profile->leave(); - - $this->assertTrue($profile->getDuration() > 0, sprintf('Expected duration > 0, got: %f', $profile->getDuration())); - } - - public function testSerialize() - { - $profile = new Profile('template', 'type', 'name'); - $profile1 = new Profile('template1', 'type1', 'name1'); - $profile->addProfile($profile1); - $profile->leave(); - $profile1->leave(); - - $profile2 = unserialize(serialize($profile)); - $profiles = $profile->getProfiles(); - $this->assertCount(1, $profiles); - $profile3 = $profiles[0]; - - $this->assertEquals($profile->getTemplate(), $profile2->getTemplate()); - $this->assertEquals($profile->getType(), $profile2->getType()); - $this->assertEquals($profile->getName(), $profile2->getName()); - $this->assertEquals($profile->getDuration(), $profile2->getDuration()); - - $this->assertEquals($profile1->getTemplate(), $profile3->getTemplate()); - $this->assertEquals($profile1->getType(), $profile3->getType()); - $this->assertEquals($profile1->getName(), $profile3->getName()); - } - - public function testReset() - { - $profile = new Profile(); - usleep(1); - $profile->leave(); - $profile->reset(); - - $this->assertEquals(0, $profile->getDuration()); - } -} diff --git a/vendor/twig/twig/tests/TemplateTest.php b/vendor/twig/twig/tests/TemplateTest.php deleted file mode 100644 index 41f8d1b..0000000 --- a/vendor/twig/twig/tests/TemplateTest.php +++ /dev/null @@ -1,809 +0,0 @@ -expectException('\LogicException'); - - $twig = new Environment($this->createMock('\Twig\Loader\LoaderInterface')); - $template = new TemplateForTest($twig); - $template->displayBlock('foo', [], ['foo' => [new \stdClass(), 'foo']]); - } - - /** - * @dataProvider getAttributeExceptions - */ - public function testGetAttributeExceptions($template, $message) - { - $templates = ['index' => $template]; - $env = new Environment(new ArrayLoader($templates), ['strict_variables' => true]); - $template = $env->load('index'); - - $context = [ - 'string' => 'foo', - 'null' => null, - 'empty_array' => [], - 'array' => ['foo' => 'foo'], - 'array_access' => new TemplateArrayAccessObject(), - 'magic_exception' => new TemplateMagicPropertyObjectWithException(), - 'object' => new \stdClass(), - ]; - - try { - $template->render($context); - $this->fail('Accessing an invalid attribute should throw an exception.'); - } catch (RuntimeError $e) { - $this->assertSame(sprintf($message, 'index'), $e->getMessage()); - } - } - - public function getAttributeExceptions() - { - return [ - ['{{ string["a"] }}', 'Impossible to access a key ("a") on a string variable ("foo") in "%s" at line 1.'], - ['{{ null["a"] }}', 'Impossible to access a key ("a") on a null variable in "%s" at line 1.'], - ['{{ empty_array["a"] }}', 'Key "a" does not exist as the array is empty in "%s" at line 1.'], - ['{{ array["a"] }}', 'Key "a" for array with keys "foo" does not exist in "%s" at line 1.'], - ['{{ array_access["a"] }}', 'Key "a" in object with ArrayAccess of class "Twig\Tests\TemplateArrayAccessObject" does not exist in "%s" at line 1.'], - ['{{ string.a }}', 'Impossible to access an attribute ("a") on a string variable ("foo") in "%s" at line 1.'], - ['{{ string.a() }}', 'Impossible to invoke a method ("a") on a string variable ("foo") in "%s" at line 1.'], - ['{{ null.a }}', 'Impossible to access an attribute ("a") on a null variable in "%s" at line 1.'], - ['{{ null.a() }}', 'Impossible to invoke a method ("a") on a null variable in "%s" at line 1.'], - ['{{ array.a() }}', 'Impossible to invoke a method ("a") on an array in "%s" at line 1.'], - ['{{ empty_array.a }}', 'Key "a" does not exist as the array is empty in "%s" at line 1.'], - ['{{ array.a }}', 'Key "a" for array with keys "foo" does not exist in "%s" at line 1.'], - ['{{ attribute(array, -10) }}', 'Key "-10" for array with keys "foo" does not exist in "%s" at line 1.'], - ['{{ array_access.a }}', 'Neither the property "a" nor one of the methods "a()", "geta()"/"isa()" or "__call()" exist and have public access in class "Twig\Tests\TemplateArrayAccessObject" in "%s" at line 1.'], - ['{% from _self import foo %}{% macro foo(obj) %}{{ obj.missing_method() }}{% endmacro %}{{ foo(array_access) }}', 'Neither the property "missing_method" nor one of the methods "missing_method()", "getmissing_method()"/"ismissing_method()" or "__call()" exist and have public access in class "Twig\Tests\TemplateArrayAccessObject" in "%s" at line 1.'], - ['{{ magic_exception.test }}', 'An exception has been thrown during the rendering of a template ("Hey! Don\'t try to isset me!") in "%s" at line 1.'], - ['{{ object["a"] }}', 'Impossible to access a key "a" on an object of class "stdClass" that does not implement ArrayAccess interface in "%s" at line 1.'], - ]; - } - - /** - * @dataProvider getGetAttributeWithSandbox - */ - public function testGetAttributeWithSandbox($object, $item, $allowed) - { - $twig = new Environment($this->createMock('\Twig\Loader\LoaderInterface')); - $policy = new SecurityPolicy([], [], [/*method*/], [/*prop*/], []); - $twig->addExtension(new SandboxExtension($policy, !$allowed)); - $template = new TemplateForTest($twig); - - try { - $template->getAttribute($object, $item, [], 'any'); - - if (!$allowed) { - $this->fail(); - } else { - $this->addToAssertionCount(1); - } - } catch (SecurityError $e) { - if ($allowed) { - $this->fail(); - } else { - $this->addToAssertionCount(1); - } - - $this->assertStringContainsString('is not allowed', $e->getMessage()); - } - } - - public function getGetAttributeWithSandbox() - { - return [ - [new TemplatePropertyObject(), 'defined', false], - [new TemplatePropertyObject(), 'defined', true], - [new TemplateMethodObject(), 'defined', false], - [new TemplateMethodObject(), 'defined', true], - ]; - } - - /** - * @group legacy - */ - public function testGetAttributeWithTemplateAsObject() - { - // to be removed in 2.0 - $twig = new Environment($this->createMock('Twig\Tests\TemplateTestLoaderInterface')); - //$twig = new Environment($this->createMock('\Twig\Loader\LoaderInterface', '\Twig\Loader\SourceContextLoaderInterface')); - - $template = new TemplateForTest($twig, 'index.twig'); - $template1 = new TemplateForTest($twig, 'index1.twig'); - - $this->assertInstanceOf('\Twig\Markup', $template->getAttribute($template1, 'string')); - $this->assertEquals('some_string', $template->getAttribute($template1, 'string')); - - $this->assertInstanceOf('\Twig\Markup', $template->getAttribute($template1, 'true')); - $this->assertEquals('1', $template->getAttribute($template1, 'true')); - - $this->assertInstanceOf('\Twig\Markup', $template->getAttribute($template1, 'zero')); - $this->assertEquals('0', $template->getAttribute($template1, 'zero')); - - $this->assertNotInstanceof('\Twig\Markup', $template->getAttribute($template1, 'empty')); - $this->assertSame('', $template->getAttribute($template1, 'empty')); - - $this->assertFalse($template->getAttribute($template1, 'env', [], Template::ANY_CALL, true)); - $this->assertFalse($template->getAttribute($template1, 'environment', [], Template::ANY_CALL, true)); - $this->assertFalse($template->getAttribute($template1, 'getEnvironment', [], Template::METHOD_CALL, true)); - $this->assertFalse($template->getAttribute($template1, 'displayWithErrorHandling', [], Template::METHOD_CALL, true)); - } - - /** - * @group legacy - * @expectedDeprecation Calling "string" on template "index1.twig" from template "index.twig" is deprecated since version 1.28 and won't be supported anymore in 2.0. - * @expectedDeprecation Calling "string" on template "index1.twig" from template "index.twig" is deprecated since version 1.28 and won't be supported anymore in 2.0. - * @expectedDeprecation Calling "true" on template "index1.twig" from template "index.twig" is deprecated since version 1.28 and won't be supported anymore in 2.0. - * @expectedDeprecation Calling "true" on template "index1.twig" from template "index.twig" is deprecated since version 1.28 and won't be supported anymore in 2.0. - * @expectedDeprecation Calling "zero" on template "index1.twig" from template "index.twig" is deprecated since version 1.28 and won't be supported anymore in 2.0. - * @expectedDeprecation Calling "zero" on template "index1.twig" from template "index.twig" is deprecated since version 1.28 and won't be supported anymore in 2.0. - * @expectedDeprecation Calling "empty" on template "index1.twig" from template "index.twig" is deprecated since version 1.28 and won't be supported anymore in 2.0. - * @expectedDeprecation Calling "empty" on template "index1.twig" from template "index.twig" is deprecated since version 1.28 and won't be supported anymore in 2.0. - * @expectedDeprecation Calling "renderBlock" on template "index.twig" from template "index.twig" is deprecated since version 1.28 and won't be supported anymore in 2.0. Use block("name") instead). - * @expectedDeprecation Calling "displayBlock" on template "index.twig" from template "index.twig" is deprecated since version 1.28 and won't be supported anymore in 2.0. Use block("name") instead). - * @expectedDeprecation Calling "hasBlock" on template "index.twig" from template "index.twig" is deprecated since version 1.28 and won't be supported anymore in 2.0. Use "block("name") is defined" instead). - * @expectedDeprecation Calling "render" on template "index.twig" from template "index.twig" is deprecated since version 1.28 and won't be supported anymore in 2.0. Use include("index.twig") instead). - * @expectedDeprecation Calling "display" on template "index.twig" from template "index.twig" is deprecated since version 1.28 and won't be supported anymore in 2.0. Use include("index.twig") instead). - * @expectedDeprecation Calling "renderBlock" on template "index1.twig" from template "index.twig" is deprecated since version 1.28 and won't be supported anymore in 2.0. Use block("name", template) instead). - * @expectedDeprecation Calling "displayBlock" on template "index1.twig" from template "index.twig" is deprecated since version 1.28 and won't be supported anymore in 2.0. Use block("name", template) instead). - * @expectedDeprecation Calling "hasBlock" on template "index1.twig" from template "index.twig" is deprecated since version 1.28 and won't be supported anymore in 2.0. Use "block("name", template) is defined" instead). - * @expectedDeprecation Calling "render" on template "index1.twig" from template "index.twig" is deprecated since version 1.28 and won't be supported anymore in 2.0. Use include("index1.twig") instead). - * @expectedDeprecation Calling "display" on template "index1.twig" from template "index.twig" is deprecated since version 1.28 and won't be supported anymore in 2.0. Use include("index1.twig") instead). - */ - public function testGetAttributeWithTemplateAsObjectForDeprecations() - { - // to be removed in 2.0 - $twig = new Environment($this->createMock('Twig\Tests\TemplateTestLoaderInterface')); - //$twig = new Environment($this->createMock('\Twig\Loader\LoaderInterface', '\Twig\Loader\SourceContextLoaderInterface')); - - $template = new TemplateForTest($twig, 'index.twig'); - $template1 = new TemplateForTest($twig, 'index1.twig'); - - $this->assertInstanceOf('\Twig\Markup', $template->getAttribute($template1, 'string')); - $this->assertEquals('some_string', $template->getAttribute($template1, 'string')); - - $this->assertInstanceOf('\Twig\Markup', $template->getAttribute($template1, 'true')); - $this->assertEquals('1', $template->getAttribute($template1, 'true')); - - $this->assertInstanceOf('\Twig\Markup', $template->getAttribute($template1, 'zero')); - $this->assertEquals('0', $template->getAttribute($template1, 'zero')); - - $this->assertNotInstanceof('\Twig\Markup', $template->getAttribute($template1, 'empty')); - $this->assertSame('', $template->getAttribute($template1, 'empty')); - - $blocks = ['name' => [$template1, 'block_name']]; - - // trigger some deprecation notice messages to check them with @expectedDeprecation - $template->getAttribute($template, 'renderBlock', ['name', [], $blocks]); - $template->getAttribute($template, 'displayBlock', ['name', [], $blocks]); - $template->getAttribute($template, 'hasBlock', ['name', []]); - $template->getAttribute($template, 'render', [[]]); - $template->getAttribute($template, 'display', [[]]); - - $template->getAttribute($template1, 'renderBlock', ['name', [], $blocks]); - $template->getAttribute($template1, 'displayBlock', ['name', [], $blocks]); - $template->getAttribute($template1, 'hasBlock', ['name', []]); - $template->getAttribute($template1, 'render', [[]]); - $template->getAttribute($template1, 'display', [[]]); - - $this->assertFalse($template->getAttribute($template1, 'env', [], Template::ANY_CALL, true)); - $this->assertFalse($template->getAttribute($template1, 'environment', [], Template::ANY_CALL, true)); - $this->assertFalse($template->getAttribute($template1, 'getEnvironment', [], Template::METHOD_CALL, true)); - $this->assertFalse($template->getAttribute($template1, 'displayWithErrorHandling', [], Template::METHOD_CALL, true)); - } - - /** - * @group legacy - * @expectedDeprecation Silent display of undefined block "unknown" in template "index.twig" is deprecated since version 1.29 and will throw an exception in 2.0. Use the "block('unknown') is defined" expression to test for block existence. - * @expectedDeprecation Silent display of undefined block "unknown" in template "index.twig" is deprecated since version 1.29 and will throw an exception in 2.0. Use the "block('unknown') is defined" expression to test for block existence. - */ - public function testRenderBlockWithUndefinedBlock() - { - $twig = new Environment($this->createMock('Twig\Tests\TemplateTestLoaderInterface')); - - $template = new TemplateForTest($twig, 'index.twig'); - $template->renderBlock('unknown', []); - $template->displayBlock('unknown', []); - } - - public function testGetAttributeOnArrayWithConfusableKey() - { - $template = new TemplateForTest(new Environment($this->createMock('\Twig\Loader\LoaderInterface'))); - - $array = ['Zero', 'One', -1 => 'MinusOne', '' => 'EmptyString', '1.5' => 'FloatButString', '01' => 'IntegerButStringWithLeadingZeros']; - - $this->assertSame('Zero', $array[false]); - $this->assertSame('One', $array[true]); - $this->assertSame('One', $array[1.5]); - $this->assertSame('One', $array['1']); - $this->assertSame('MinusOne', $array[-1.5]); - $this->assertSame('FloatButString', $array['1.5']); - $this->assertSame('IntegerButStringWithLeadingZeros', $array['01']); - $this->assertSame('EmptyString', $array[null]); - - $this->assertSame('Zero', $template->getAttribute($array, false), 'false is treated as 0 when accessing an array (equals PHP behavior)'); - $this->assertSame('One', $template->getAttribute($array, true), 'true is treated as 1 when accessing an array (equals PHP behavior)'); - $this->assertSame('One', $template->getAttribute($array, 1.5), 'float is casted to int when accessing an array (equals PHP behavior)'); - $this->assertSame('One', $template->getAttribute($array, '1'), '"1" is treated as integer 1 when accessing an array (equals PHP behavior)'); - $this->assertSame('MinusOne', $template->getAttribute($array, -1.5), 'negative float is casted to int when accessing an array (equals PHP behavior)'); - $this->assertSame('FloatButString', $template->getAttribute($array, '1.5'), '"1.5" is treated as-is when accessing an array (equals PHP behavior)'); - $this->assertSame('IntegerButStringWithLeadingZeros', $template->getAttribute($array, '01'), '"01" is treated as-is when accessing an array (equals PHP behavior)'); - $this->assertSame('EmptyString', $template->getAttribute($array, null), 'null is treated as "" when accessing an array (equals PHP behavior)'); - } - - /** - * @dataProvider getGetAttributeTests - */ - public function testGetAttribute($defined, $value, $object, $item, $arguments, $type) - { - $template = new TemplateForTest(new Environment($this->createMock('\Twig\Loader\LoaderInterface'))); - - $this->assertEquals($value, $template->getAttribute($object, $item, $arguments, $type)); - } - - /** - * @dataProvider getGetAttributeTests - */ - public function testGetAttributeStrict($defined, $value, $object, $item, $arguments, $type, $exceptionMessage = null) - { - $template = new TemplateForTest(new Environment($this->createMock('\Twig\Loader\LoaderInterface'), ['strict_variables' => true])); - - if ($defined) { - $this->assertEquals($value, $template->getAttribute($object, $item, $arguments, $type)); - } else { - $this->expectException('\Twig\Error\RuntimeError'); - if (null !== $exceptionMessage) { - $this->expectExceptionMessage($exceptionMessage); - } - $this->assertEquals($value, $template->getAttribute($object, $item, $arguments, $type)); - } - } - - /** - * @dataProvider getGetAttributeTests - */ - public function testGetAttributeDefined($defined, $value, $object, $item, $arguments, $type) - { - $template = new TemplateForTest(new Environment($this->createMock('\Twig\Loader\LoaderInterface'))); - - $this->assertEquals($defined, $template->getAttribute($object, $item, $arguments, $type, true)); - } - - /** - * @dataProvider getGetAttributeTests - */ - public function testGetAttributeDefinedStrict($defined, $value, $object, $item, $arguments, $type) - { - $template = new TemplateForTest(new Environment($this->createMock('\Twig\Loader\LoaderInterface'), ['strict_variables' => true])); - - $this->assertEquals($defined, $template->getAttribute($object, $item, $arguments, $type, true)); - } - - public function testGetAttributeCallExceptions() - { - $template = new TemplateForTest(new Environment($this->createMock('\Twig\Loader\LoaderInterface'))); - - $object = new TemplateMagicMethodExceptionObject(); - - $this->assertNull($template->getAttribute($object, 'foo')); - } - - public function getGetAttributeTests() - { - $array = [ - 'defined' => 'defined', - 'zero' => 0, - 'null' => null, - '1' => 1, - 'bar' => true, - 'baz' => 'baz', - '09' => '09', - '+4' => '+4', - ]; - - $objectArray = new TemplateArrayAccessObject(); - $arrayObject = new \ArrayObject($array); - $stdObject = (object) $array; - $magicPropertyObject = new TemplateMagicPropertyObject(); - $propertyObject = new TemplatePropertyObject(); - $propertyObject1 = new TemplatePropertyObjectAndIterator(); - $propertyObject2 = new TemplatePropertyObjectAndArrayAccess(); - $propertyObject3 = new TemplatePropertyObjectDefinedWithUndefinedValue(); - $methodObject = new TemplateMethodObject(); - $magicMethodObject = new TemplateMagicMethodObject(); - - $anyType = Template::ANY_CALL; - $methodType = Template::METHOD_CALL; - $arrayType = Template::ARRAY_CALL; - - $basicTests = [ - // array(defined, value, property to fetch) - [true, 'defined', 'defined'], - [false, null, 'undefined'], - [false, null, 'protected'], - [true, 0, 'zero'], - [true, 1, 1], - [true, 1, 1.0], - [true, null, 'null'], - [true, true, 'bar'], - [true, 'baz', 'baz'], - [true, '09', '09'], - [true, '+4', '+4'], - ]; - $testObjects = [ - // array(object, type of fetch) - [$array, $arrayType], - [$objectArray, $arrayType], - [$arrayObject, $anyType], - [$stdObject, $anyType], - [$magicPropertyObject, $anyType], - [$methodObject, $methodType], - [$methodObject, $anyType], - [$propertyObject, $anyType], - [$propertyObject1, $anyType], - [$propertyObject2, $anyType], - ]; - - $tests = []; - foreach ($testObjects as $testObject) { - foreach ($basicTests as $test) { - // properties cannot be numbers - if (($testObject[0] instanceof \stdClass || $testObject[0] instanceof TemplatePropertyObject) && is_numeric($test[2])) { - continue; - } - - if ('+4' === $test[2] && $methodObject === $testObject[0]) { - continue; - } - - $tests[] = [$test[0], $test[1], $testObject[0], $test[2], [], $testObject[1]]; - } - } - - // additional properties tests - $tests = array_merge($tests, [ - [true, null, $propertyObject3, 'foo', [], $anyType], - ]); - - // additional method tests - $tests = array_merge($tests, [ - [true, 'defined', $methodObject, 'defined', [], $methodType], - [true, 'defined', $methodObject, 'DEFINED', [], $methodType], - [true, 'defined', $methodObject, 'getDefined', [], $methodType], - [true, 'defined', $methodObject, 'GETDEFINED', [], $methodType], - [true, 'static', $methodObject, 'static', [], $methodType], - [true, 'static', $methodObject, 'getStatic', [], $methodType], - - [true, '__call_undefined', $magicMethodObject, 'undefined', [], $methodType], - [true, '__call_UNDEFINED', $magicMethodObject, 'UNDEFINED', [], $methodType], - ]); - - // add the same tests for the any type - foreach ($tests as $test) { - if ($anyType !== $test[5]) { - $test[5] = $anyType; - $tests[] = $test; - } - } - - $methodAndPropObject = new TemplateMethodAndPropObject(); - - // additional method tests - $tests = array_merge($tests, [ - [true, 'a', $methodAndPropObject, 'a', [], $anyType], - [true, 'a', $methodAndPropObject, 'a', [], $methodType], - [false, null, $methodAndPropObject, 'a', [], $arrayType], - - [true, 'b_prop', $methodAndPropObject, 'b', [], $anyType], - [true, 'b', $methodAndPropObject, 'B', [], $anyType], - [true, 'b', $methodAndPropObject, 'b', [], $methodType], - [true, 'b', $methodAndPropObject, 'B', [], $methodType], - [false, null, $methodAndPropObject, 'b', [], $arrayType], - - [false, null, $methodAndPropObject, 'c', [], $anyType], - [false, null, $methodAndPropObject, 'c', [], $methodType], - [false, null, $methodAndPropObject, 'c', [], $arrayType], - ]); - - $arrayAccess = new TemplateArrayAccess(); - $tests = array_merge($tests, [ - [true, ['foo' => 'bar'], $arrayAccess, 'vars', [], $anyType], - ]); - - // tests when input is not an array or object - $tests = array_merge($tests, [ - [false, null, 42, 'a', [], $anyType, 'Impossible to access an attribute ("a") on a integer variable ("42") in "index.twig".'], - [false, null, 'string', 'a', [], $anyType, 'Impossible to access an attribute ("a") on a string variable ("string") in "index.twig".'], - [false, null, [], 'a', [], $anyType, 'Key "a" does not exist as the array is empty in "index.twig".'], - ]); - - return $tests; - } - - public function testGetIsMethods() - { - $this->expectException('\Twig\Error\RuntimeError'); - - $getIsObject = new TemplateGetIsMethods(); - $template = new TemplateForTest(new Environment($this->createMock('\Twig\Loader\LoaderInterface'), ['strict_variables' => true])); - // first time should not create a cache for "get" - $this->assertNull($template->getAttribute($getIsObject, 'get')); - // 0 should be in the method cache now, so this should fail - $this->assertNull($template->getAttribute($getIsObject, 0)); - } -} - -class TemplateForTest extends Template -{ - private $name; - - public function __construct(Environment $env, $name = 'index.twig') - { - parent::__construct($env); - self::$cache = []; - $this->name = $name; - } - - public function getZero() - { - return 0; - } - - public function getEmpty() - { - return ''; - } - - public function getString() - { - return 'some_string'; - } - - public function getTrue() - { - return true; - } - - public function getTemplateName() - { - return $this->name; - } - - public function getDebugInfo() - { - return []; - } - - protected function doGetParent(array $context) - { - return false; - } - - protected function doDisplay(array $context, array $blocks = []) - { - } - - public function getAttribute($object, $item, array $arguments = [], $type = Template::ANY_CALL, $isDefinedTest = false, $ignoreStrictCheck = false) - { - if (\function_exists('twig_template_get_attributes')) { - return twig_template_get_attributes($this, $object, $item, $arguments, $type, $isDefinedTest, $ignoreStrictCheck); - } else { - return parent::getAttribute($object, $item, $arguments, $type, $isDefinedTest, $ignoreStrictCheck); - } - } - - public function block_name($context, array $blocks = []) - { - } -} - -class TemplateArrayAccessObject implements \ArrayAccess -{ - protected $protected = 'protected'; - - public $attributes = [ - 'defined' => 'defined', - 'zero' => 0, - 'null' => null, - '1' => 1, - 'bar' => true, - 'baz' => 'baz', - '09' => '09', - '+4' => '+4', - ]; - - public function offsetExists($name) - { - return \array_key_exists($name, $this->attributes); - } - - public function offsetGet($name) - { - return \array_key_exists($name, $this->attributes) ? $this->attributes[$name] : null; - } - - public function offsetSet($name, $value) - { - } - - public function offsetUnset($name) - { - } -} - -class TemplateMagicPropertyObject -{ - public $defined = 'defined'; - - public $attributes = [ - 'zero' => 0, - 'null' => null, - '1' => 1, - 'bar' => true, - 'baz' => 'baz', - '09' => '09', - '+4' => '+4', - ]; - - protected $protected = 'protected'; - - public function __isset($name) - { - return \array_key_exists($name, $this->attributes); - } - - public function __get($name) - { - return \array_key_exists($name, $this->attributes) ? $this->attributes[$name] : null; - } -} - -class TemplateMagicPropertyObjectWithException -{ - public function __isset($key) - { - throw new \Exception('Hey! Don\'t try to isset me!'); - } -} - -class TemplatePropertyObject -{ - public $defined = 'defined'; - public $zero = 0; - public $null = null; - public $bar = true; - public $baz = 'baz'; - - protected $protected = 'protected'; -} - -class TemplatePropertyObjectAndIterator extends TemplatePropertyObject implements \IteratorAggregate -{ - public function getIterator() - { - return new \ArrayIterator(['foo', 'bar']); - } -} - -class TemplatePropertyObjectAndArrayAccess extends TemplatePropertyObject implements \ArrayAccess -{ - private $data = [ - 'defined' => 'defined', - 'zero' => 0, - 'null' => null, - 'bar' => true, - 'foo' => true, - 'baz' => 'baz', - 'baf' => 'baf', - ]; - - public function offsetExists($offset) - { - return \array_key_exists($offset, $this->data); - } - - public function offsetGet($offset) - { - return $this->offsetExists($offset) ? $this->data[$offset] : 'n/a'; - } - - public function offsetSet($offset, $value) - { - } - - public function offsetUnset($offset) - { - } -} - -class TemplatePropertyObjectDefinedWithUndefinedValue -{ - public $foo; - - public function __construct() - { - $this->foo = @$notExist; - } -} - -class TemplateMethodObject -{ - public function getDefined() - { - return 'defined'; - } - - public function get1() - { - return 1; - } - - public function get09() - { - return '09'; - } - - public function getZero() - { - return 0; - } - - public function getNull() - { - } - - public function isBar() - { - return true; - } - - public function isBaz() - { - return 'should never be returned'; - } - - public function getBaz() - { - return 'baz'; - } - - protected function getProtected() - { - return 'protected'; - } - - public static function getStatic() - { - return 'static'; - } -} - -class TemplateGetIsMethods -{ - public function get() - { - } - - public function is() - { - } -} - -class TemplateMethodAndPropObject -{ - private $a = 'a_prop'; - - public function getA() - { - return 'a'; - } - - public $b = 'b_prop'; - - public function getB() - { - return 'b'; - } - - private $c = 'c_prop'; - - private function getC() - { - return 'c'; - } -} - -class TemplateArrayAccess implements \ArrayAccess -{ - public $vars = [ - 'foo' => 'bar', - ]; - private $children = []; - - public function offsetExists($offset) - { - return \array_key_exists($offset, $this->children); - } - - public function offsetGet($offset) - { - return $this->children[$offset]; - } - - public function offsetSet($offset, $value) - { - $this->children[$offset] = $value; - } - - public function offsetUnset($offset) - { - unset($this->children[$offset]); - } -} - -class TemplateMagicMethodObject -{ - public function __call($method, $arguments) - { - return '__call_'.$method; - } -} - -class TemplateMagicMethodExceptionObject -{ - public function __call($method, $arguments) - { - throw new \BadMethodCallException(sprintf('Unknown method "%s".', $method)); - } -} - -class CExtDisablingNodeVisitor implements NodeVisitorInterface -{ - public function enterNode(\Twig_NodeInterface $node, Environment $env) - { - if ($node instanceof GetAttrExpression) { - $node->setAttribute('disable_c_ext', true); - } - - return $node; - } - - public function leaveNode(\Twig_NodeInterface $node, Environment $env) - { - return $node; - } - - public function getPriority() - { - return 0; - } -} - -// to be removed in 2.0 -interface TemplateTestLoaderInterface extends LoaderInterface, SourceContextLoaderInterface -{ -} diff --git a/vendor/twig/twig/tests/TemplateWrapperTest.php b/vendor/twig/twig/tests/TemplateWrapperTest.php deleted file mode 100644 index b4a0958..0000000 --- a/vendor/twig/twig/tests/TemplateWrapperTest.php +++ /dev/null @@ -1,70 +0,0 @@ - '{% block foo %}{% endblock %}', - 'index_with_use' => '{% use "imported" %}{% block foo %}{% endblock %}', - 'index_with_extends' => '{% extends "extended" %}{% block foo %}{% endblock %}', - 'imported' => '{% block imported %}{% endblock %}', - 'extended' => '{% block extended %}{% endblock %}', - ])); - - $wrapper = $twig->load('index'); - $this->assertTrue($wrapper->hasBlock('foo')); - $this->assertFalse($wrapper->hasBlock('bar')); - $this->assertEquals(['foo'], $wrapper->getBlockNames()); - - $wrapper = $twig->load('index_with_use'); - $this->assertTrue($wrapper->hasBlock('foo')); - $this->assertTrue($wrapper->hasBlock('imported')); - $this->assertEquals(['imported', 'foo'], $wrapper->getBlockNames()); - - $wrapper = $twig->load('index_with_extends'); - $this->assertTrue($wrapper->hasBlock('foo')); - $this->assertTrue($wrapper->hasBlock('extended')); - $this->assertEquals(['foo', 'extended'], $wrapper->getBlockNames()); - } - - public function testRenderBlock() - { - $twig = new Environment(new ArrayLoader([ - 'index' => '{% block foo %}{{ foo }}{{ bar }}{% endblock %}', - ])); - $twig->addGlobal('bar', 'BAR'); - - $wrapper = $twig->load('index'); - $this->assertEquals('FOOBAR', $wrapper->renderBlock('foo', ['foo' => 'FOO'])); - } - - public function testDisplayBlock() - { - $twig = new Environment(new ArrayLoader([ - 'index' => '{% block foo %}{{ foo }}{{ bar }}{% endblock %}', - ])); - $twig->addGlobal('bar', 'BAR'); - - $wrapper = $twig->load('index'); - - ob_start(); - $wrapper->displayBlock('foo', ['foo' => 'FOO']); - - $this->assertEquals('FOOBAR', ob_get_clean()); - } -} diff --git a/vendor/twig/twig/tests/TokenStreamTest.php b/vendor/twig/twig/tests/TokenStreamTest.php deleted file mode 100644 index c98e0f0..0000000 --- a/vendor/twig/twig/tests/TokenStreamTest.php +++ /dev/null @@ -1,85 +0,0 @@ -assertEquals('foo', $stream->getFilename()); - $this->assertEquals('{{ foo }}', $stream->getSource()); - $this->assertEquals('foo', $stream->getSourceContext()->getName()); - $this->assertEquals('{{ foo }}', $stream->getSourceContext()->getCode()); - } - - public function testNext() - { - $stream = new TokenStream(self::$tokens); - $repr = []; - while (!$stream->isEOF()) { - $token = $stream->next(); - - $repr[] = $token->getValue(); - } - $this->assertEquals('1, 2, 3, 4, 5, 6, 7', implode(', ', $repr), '->next() advances the pointer and returns the current token'); - } - - public function testEndOfTemplateNext() - { - $this->expectException('\Twig\Error\SyntaxError'); - $this->expectExceptionMessage('Unexpected end of template'); - - $stream = new TokenStream([ - new Token(Token::BLOCK_START_TYPE, 1, 1), - ]); - while (!$stream->isEOF()) { - $stream->next(); - } - } - - public function testEndOfTemplateLook() - { - $this->expectException('\Twig\Error\SyntaxError'); - $this->expectExceptionMessage('Unexpected end of template'); - - $stream = new TokenStream([ - new Token(Token::BLOCK_START_TYPE, 1, 1), - ]); - while (!$stream->isEOF()) { - $stream->look(); - $stream->next(); - } - } -} diff --git a/vendor/twig/twig/tests/Util/DeprecationCollectorTest.php b/vendor/twig/twig/tests/Util/DeprecationCollectorTest.php deleted file mode 100644 index e360dbb..0000000 --- a/vendor/twig/twig/tests/Util/DeprecationCollectorTest.php +++ /dev/null @@ -1,48 +0,0 @@ -createMock('\Twig\Loader\LoaderInterface')); - $twig->addFunction(new TwigFunction('deprec', [$this, 'deprec'], ['deprecated' => true])); - - $collector = new DeprecationCollector($twig); - $deprecations = $collector->collect(new Twig_Tests_Util_Iterator()); - - $this->assertEquals(['Twig Function "deprec" is deprecated in deprec.twig at line 1.'], $deprecations); - } - - public function deprec() - { - } -} - -class Twig_Tests_Util_Iterator implements \IteratorAggregate -{ - public function getIterator() - { - return new \ArrayIterator([ - 'ok.twig' => '{{ foo }}', - 'deprec.twig' => '{{ deprec("foo") }}', - ]); - } -} diff --git a/vendor/twig/twig/tests/escapingTest.php b/vendor/twig/twig/tests/escapingTest.php deleted file mode 100644 index 84759eb..0000000 --- a/vendor/twig/twig/tests/escapingTest.php +++ /dev/null @@ -1,327 +0,0 @@ - ''', - '"' => '"', - '<' => '<', - '>' => '>', - '&' => '&', - ]; - - protected $htmlAttrSpecialChars = [ - '\'' => ''', - /* Characters beyond ASCII value 255 to unicode escape */ - 'Ā' => 'Ā', - '😀' => '😀', - /* Immune chars excluded */ - ',' => ',', - '.' => '.', - '-' => '-', - '_' => '_', - /* Basic alnums excluded */ - 'a' => 'a', - 'A' => 'A', - 'z' => 'z', - 'Z' => 'Z', - '0' => '0', - '9' => '9', - /* Basic control characters and null */ - "\r" => ' ', - "\n" => ' ', - "\t" => ' ', - "\0" => '�', // should use Unicode replacement char - /* Encode chars as named entities where possible */ - '<' => '<', - '>' => '>', - '&' => '&', - '"' => '"', - /* Encode spaces for quoteless attribute protection */ - ' ' => ' ', - ]; - - protected $jsSpecialChars = [ - /* HTML special chars - escape without exception to hex */ - '<' => '\\u003C', - '>' => '\\u003E', - '\'' => '\\u0027', - '"' => '\\u0022', - '&' => '\\u0026', - '/' => '\\/', - /* Characters beyond ASCII value 255 to unicode escape */ - 'Ā' => '\\u0100', - '😀' => '\\uD83D\\uDE00', - /* Immune chars excluded */ - ',' => ',', - '.' => '.', - '_' => '_', - /* Basic alnums excluded */ - 'a' => 'a', - 'A' => 'A', - 'z' => 'z', - 'Z' => 'Z', - '0' => '0', - '9' => '9', - /* Basic control characters and null */ - "\r" => '\r', - "\n" => '\n', - "\x08" => '\b', - "\t" => '\t', - "\x0C" => '\f', - "\0" => '\\u0000', - /* Encode spaces for quoteless attribute protection */ - ' ' => '\\u0020', - ]; - - protected $urlSpecialChars = [ - /* HTML special chars - escape without exception to percent encoding */ - '<' => '%3C', - '>' => '%3E', - '\'' => '%27', - '"' => '%22', - '&' => '%26', - /* Characters beyond ASCII value 255 to hex sequence */ - 'Ā' => '%C4%80', - /* Punctuation and unreserved check */ - ',' => '%2C', - '.' => '.', - '_' => '_', - '-' => '-', - ':' => '%3A', - ';' => '%3B', - '!' => '%21', - /* Basic alnums excluded */ - 'a' => 'a', - 'A' => 'A', - 'z' => 'z', - 'Z' => 'Z', - '0' => '0', - '9' => '9', - /* Basic control characters and null */ - "\r" => '%0D', - "\n" => '%0A', - "\t" => '%09', - "\0" => '%00', - /* PHP quirks from the past */ - ' ' => '%20', - '~' => '~', - '+' => '%2B', - ]; - - protected $cssSpecialChars = [ - /* HTML special chars - escape without exception to hex */ - '<' => '\\3C ', - '>' => '\\3E ', - '\'' => '\\27 ', - '"' => '\\22 ', - '&' => '\\26 ', - /* Characters beyond ASCII value 255 to unicode escape */ - 'Ā' => '\\100 ', - /* Immune chars excluded */ - ',' => '\\2C ', - '.' => '\\2E ', - '_' => '\\5F ', - /* Basic alnums excluded */ - 'a' => 'a', - 'A' => 'A', - 'z' => 'z', - 'Z' => 'Z', - '0' => '0', - '9' => '9', - /* Basic control characters and null */ - "\r" => '\\D ', - "\n" => '\\A ', - "\t" => '\\9 ', - "\0" => '\\0 ', - /* Encode spaces for quoteless attribute protection */ - ' ' => '\\20 ', - ]; - - protected $env; - - protected function setUp() - { - $this->env = new \Twig\Environment($this->createMock('\Twig\Loader\LoaderInterface')); - } - - public function testHtmlEscapingConvertsSpecialChars() - { - foreach ($this->htmlSpecialChars as $key => $value) { - $this->assertEquals($value, twig_escape_filter($this->env, $key, 'html'), 'Failed to escape: '.$key); - } - } - - public function testHtmlAttributeEscapingConvertsSpecialChars() - { - foreach ($this->htmlAttrSpecialChars as $key => $value) { - $this->assertEquals($value, twig_escape_filter($this->env, $key, 'html_attr'), 'Failed to escape: '.$key); - } - } - - public function testJavascriptEscapingConvertsSpecialChars() - { - foreach ($this->jsSpecialChars as $key => $value) { - $this->assertEquals($value, twig_escape_filter($this->env, $key, 'js'), 'Failed to escape: '.$key); - } - } - - public function testJavascriptEscapingReturnsStringIfZeroLength() - { - $this->assertEquals('', twig_escape_filter($this->env, '', 'js')); - } - - public function testJavascriptEscapingReturnsStringIfContainsOnlyDigits() - { - $this->assertEquals('123', twig_escape_filter($this->env, '123', 'js')); - } - - public function testCssEscapingConvertsSpecialChars() - { - foreach ($this->cssSpecialChars as $key => $value) { - $this->assertEquals($value, twig_escape_filter($this->env, $key, 'css'), 'Failed to escape: '.$key); - } - } - - public function testCssEscapingReturnsStringIfZeroLength() - { - $this->assertEquals('', twig_escape_filter($this->env, '', 'css')); - } - - public function testCssEscapingReturnsStringIfContainsOnlyDigits() - { - $this->assertEquals('123', twig_escape_filter($this->env, '123', 'css')); - } - - public function testUrlEscapingConvertsSpecialChars() - { - foreach ($this->urlSpecialChars as $key => $value) { - $this->assertEquals($value, twig_escape_filter($this->env, $key, 'url'), 'Failed to escape: '.$key); - } - } - - /** - * Range tests to confirm escaped range of characters is within OWASP recommendation. - */ - - /** - * Only testing the first few 2 ranges on this prot. function as that's all these - * other range tests require. - */ - public function testUnicodeCodepointConversionToUtf8() - { - $expected = ' ~ޙ'; - $codepoints = [0x20, 0x7e, 0x799]; - $result = ''; - foreach ($codepoints as $value) { - $result .= $this->codepointToUtf8($value); - } - $this->assertEquals($expected, $result); - } - - /** - * Convert a Unicode Codepoint to a literal UTF-8 character. - * - * @param int $codepoint Unicode codepoint in hex notation - * - * @return string UTF-8 literal string - */ - protected function codepointToUtf8($codepoint) - { - if ($codepoint < 0x80) { - return \chr($codepoint); - } - if ($codepoint < 0x800) { - return \chr($codepoint >> 6 & 0x3f | 0xc0) - .\chr($codepoint & 0x3f | 0x80); - } - if ($codepoint < 0x10000) { - return \chr($codepoint >> 12 & 0x0f | 0xe0) - .\chr($codepoint >> 6 & 0x3f | 0x80) - .\chr($codepoint & 0x3f | 0x80); - } - if ($codepoint < 0x110000) { - return \chr($codepoint >> 18 & 0x07 | 0xf0) - .\chr($codepoint >> 12 & 0x3f | 0x80) - .\chr($codepoint >> 6 & 0x3f | 0x80) - .\chr($codepoint & 0x3f | 0x80); - } - throw new \Exception('Codepoint requested outside of Unicode range.'); - } - - public function testJavascriptEscapingEscapesOwaspRecommendedRanges() - { - $immune = [',', '.', '_']; // Exceptions to escaping ranges - for ($chr = 0; $chr < 0xFF; ++$chr) { - if ($chr >= 0x30 && $chr <= 0x39 - || $chr >= 0x41 && $chr <= 0x5A - || $chr >= 0x61 && $chr <= 0x7A) { - $literal = $this->codepointToUtf8($chr); - $this->assertEquals($literal, twig_escape_filter($this->env, $literal, 'js')); - } else { - $literal = $this->codepointToUtf8($chr); - if (\in_array($literal, $immune)) { - $this->assertEquals($literal, twig_escape_filter($this->env, $literal, 'js')); - } else { - $this->assertNotEquals( - $literal, - twig_escape_filter($this->env, $literal, 'js'), - "$literal should be escaped!"); - } - } - } - } - - public function testHtmlAttributeEscapingEscapesOwaspRecommendedRanges() - { - $immune = [',', '.', '-', '_']; // Exceptions to escaping ranges - for ($chr = 0; $chr < 0xFF; ++$chr) { - if ($chr >= 0x30 && $chr <= 0x39 - || $chr >= 0x41 && $chr <= 0x5A - || $chr >= 0x61 && $chr <= 0x7A) { - $literal = $this->codepointToUtf8($chr); - $this->assertEquals($literal, twig_escape_filter($this->env, $literal, 'html_attr')); - } else { - $literal = $this->codepointToUtf8($chr); - if (\in_array($literal, $immune)) { - $this->assertEquals($literal, twig_escape_filter($this->env, $literal, 'html_attr')); - } else { - $this->assertNotEquals( - $literal, - twig_escape_filter($this->env, $literal, 'html_attr'), - "$literal should be escaped!"); - } - } - } - } - - public function testCssEscapingEscapesOwaspRecommendedRanges() - { - // CSS has no exceptions to escaping ranges - for ($chr = 0; $chr < 0xFF; ++$chr) { - if ($chr >= 0x30 && $chr <= 0x39 - || $chr >= 0x41 && $chr <= 0x5A - || $chr >= 0x61 && $chr <= 0x7A) { - $literal = $this->codepointToUtf8($chr); - $this->assertEquals($literal, twig_escape_filter($this->env, $literal, 'css')); - } else { - $literal = $this->codepointToUtf8($chr); - $this->assertNotEquals( - $literal, - twig_escape_filter($this->env, $literal, 'css'), - "$literal should be escaped!"); - } - } - } -}