Browse code

Merge branch '1.x' into 2.x

* 1.x:
Updated the vim-twig link
PHPUnit 6 compatability
Fix codeblock
Update Compiler.php

Fabien Potencier authored on 12/03/2017 15:30:20
Showing 7 changed files
... ...
@@ -31,7 +31,7 @@
31 31
         "symfony/polyfill-mbstring": "~1.0"
32 32
     },
33 33
     "require-dev": {
34
-        "symfony/phpunit-bridge": "~3.2",
34
+        "symfony/phpunit-bridge": "~3.3@dev",
35 35
         "symfony/debug": "~2.7",
36 36
         "psr/container": "^1.0"
37 37
     },
... ...
@@ -510,7 +510,7 @@ include in your templates:
510 510
     ``interpolateProvider`` service, for instance at the module initialization
511 511
     time:
512 512
 
513
-    ..code-block:: javascript
513
+    ..  code-block:: javascript
514 514
 
515 515
         angular.module('myApp', []).config(function($interpolateProvider) {
516 516
             $interpolateProvider.startSymbol('{[').endSymbol(']}');
... ...
@@ -518,7 +518,7 @@ include in your templates:
518 518
 
519 519
   * For Twig, change the delimiters via the ``tag_variable`` Lexer option:
520 520
 
521
-    ..code-block:: php
521
+    ..  code-block:: php
522 522
 
523 523
         $env->setLexer(new Twig_Lexer($env, array(
524 524
             'tag_variable' => array('{[', ']}'),
... ...
@@ -874,7 +874,7 @@ Extension<creating_extensions>` chapter.
874 874
 
875 875
 .. _`Twig bundle`:                https://github.com/Anomareh/PHP-Twig.tmbundle
876 876
 .. _`Jinja syntax plugin`:        http://jinja.pocoo.org/docs/integration/#vim
877
-.. _`vim-twig plugin`:            https://github.com/evidens/vim-twig
877
+.. _`vim-twig plugin`:            https://github.com/lumiliet/vim-twig
878 878
 .. _`Twig syntax plugin`:         http://plugins.netbeans.org/plugin/37069/php-twig
879 879
 .. _`Twig plugin`:                https://github.com/pulse00/Twig-Eclipse-Plugin
880 880
 .. _`Twig language definition`:   https://github.com/gabrielcorpse/gedit-twig-template-language
... ...
@@ -136,7 +136,7 @@ class Twig_Compiler
136 136
     public function repr($value)
137 137
     {
138 138
         if (is_int($value) || is_float($value)) {
139
-            if (false !== $locale = setlocale(LC_NUMERIC, 0)) {
139
+            if (false !== $locale = setlocale(LC_NUMERIC, '0')) {
140 140
                 setlocale(LC_NUMERIC, 'C');
141 141
             }
142 142
 
... ...
@@ -9,7 +9,7 @@
9 9
          processIsolation="false"
10 10
          stopOnFailure="false"
11 11
          syntaxCheck="false"
12
-         bootstrap="vendor/autoload.php"
12
+         bootstrap="test/bootstrap.php"
13 13
 >
14 14
   <testsuites>
15 15
     <testsuite name="Twig Test Suite">
... ...
@@ -16,7 +16,12 @@ class CustomExtensionTest extends PHPUnit_Framework_TestCase
16 16
      */
17 17
     public function testGetInvalidOperators(Twig_ExtensionInterface $extension, $expectedExceptionMessage)
18 18
     {
19
-        $this->setExpectedException('InvalidArgumentException', $expectedExceptionMessage);
19
+        if (method_exists($this, 'expectException')) {
20
+            $this->expectException('InvalidArgumentException');
21
+            $this->expectExceptionMessage($expectedExceptionMessage);
22
+        } else {
23
+            $this->setExpectedException('InvalidArgumentException', $expectedExceptionMessage);
24
+        }
20 25
 
21 26
         $env = new Twig_Environment($this->getMockBuilder('Twig_LoaderInterface')->getMock());
22 27
         $env->addExtension($extension);
23 28
new file mode 100644
... ...
@@ -0,0 +1,16 @@
1
+<?php
2
+
3
+/*
4
+ * This file is part of Twig.
5
+ *
6
+ * (c) Fabien Potencier
7
+ *
8
+ * For the full copyright and license information, please view the LICENSE
9
+ * file that was distributed with this source code.
10
+ */
11
+
12
+require __DIR__.'/../vendor/autoload.php';
13
+
14
+if (!class_exists('\PHPUnit_Framework_TestCase') && class_exists('\PHPUnit\Framework\TestCase')) {
15
+    class_alias('\PHPUnit\Framework\TestCase', '\PHPUnit_Framework_TestCase');
16
+}