Merge branch '1.x' into 2.x

* 1.x:
  Updated the vim-twig link
  PHPUnit 6 compatability
  Fix codeblock
  Update Compiler.php
This commit is contained in:
Fabien Potencier
2017-03-12 08:30:20 -07:00
7 changed files with 28 additions and 7 deletions
+1 -1
View File
@@ -31,7 +31,7 @@
"symfony/polyfill-mbstring": "~1.0"
},
"require-dev": {
"symfony/phpunit-bridge": "~3.2",
"symfony/phpunit-bridge": "~3.3@dev",
"symfony/debug": "~2.7",
"psr/container": "^1.0"
},
+2 -2
View File
@@ -510,7 +510,7 @@ include in your templates:
``interpolateProvider`` service, for instance at the module initialization
time:
..code-block:: javascript
.. code-block:: javascript
angular.module('myApp', []).config(function($interpolateProvider) {
$interpolateProvider.startSymbol('{[').endSymbol(']}');
@@ -518,7 +518,7 @@ include in your templates:
* For Twig, change the delimiters via the ``tag_variable`` Lexer option:
..code-block:: php
.. code-block:: php
$env->setLexer(new Twig_Lexer($env, array(
'tag_variable' => array('{[', ']}'),
+1 -1
View File
@@ -874,7 +874,7 @@ Extension<creating_extensions>` chapter.
.. _`Twig bundle`: https://github.com/Anomareh/PHP-Twig.tmbundle
.. _`Jinja syntax plugin`: http://jinja.pocoo.org/docs/integration/#vim
.. _`vim-twig plugin`: https://github.com/evidens/vim-twig
.. _`vim-twig plugin`: https://github.com/lumiliet/vim-twig
.. _`Twig syntax plugin`: http://plugins.netbeans.org/plugin/37069/php-twig
.. _`Twig plugin`: https://github.com/pulse00/Twig-Eclipse-Plugin
.. _`Twig language definition`: https://github.com/gabrielcorpse/gedit-twig-template-language
+1 -1
View File
@@ -136,7 +136,7 @@ class Twig_Compiler
public function repr($value)
{
if (is_int($value) || is_float($value)) {
if (false !== $locale = setlocale(LC_NUMERIC, 0)) {
if (false !== $locale = setlocale(LC_NUMERIC, '0')) {
setlocale(LC_NUMERIC, 'C');
}
+1 -1
View File
@@ -9,7 +9,7 @@
processIsolation="false"
stopOnFailure="false"
syntaxCheck="false"
bootstrap="vendor/autoload.php"
bootstrap="test/bootstrap.php"
>
<testsuites>
<testsuite name="Twig Test Suite">
+6 -1
View File
@@ -16,7 +16,12 @@ class CustomExtensionTest extends PHPUnit_Framework_TestCase
*/
public function testGetInvalidOperators(Twig_ExtensionInterface $extension, $expectedExceptionMessage)
{
$this->setExpectedException('InvalidArgumentException', $expectedExceptionMessage);
if (method_exists($this, 'expectException')) {
$this->expectException('InvalidArgumentException');
$this->expectExceptionMessage($expectedExceptionMessage);
} else {
$this->setExpectedException('InvalidArgumentException', $expectedExceptionMessage);
}
$env = new Twig_Environment($this->getMockBuilder('Twig_LoaderInterface')->getMock());
$env->addExtension($extension);
+16
View File
@@ -0,0 +1,16 @@
<?php
/*
* This file is part of Twig.
*
* (c) Fabien Potencier
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
require __DIR__.'/../vendor/autoload.php';
if (!class_exists('\PHPUnit_Framework_TestCase') && class_exists('\PHPUnit\Framework\TestCase')) {
class_alias('\PHPUnit\Framework\TestCase', '\PHPUnit_Framework_TestCase');
}