merged branch benbender/2.1 (PR #7344)

This PR was squashed before being merged into the 2.1 branch (closes #7344).

Commits
-------

c423f16 [2.1][TwigBridge] Fixes Issue #7342 in TwigBridge

Discussion
----------

[2.1][TwigBridge] Fixes Issue #7342 in TwigBridge

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #7342
| License       | MIT
| Doc PR        | --

---------------------------------------------------------------------------

by stof at 2013-03-12T13:28:15Z

Can you add a test to avoid regressions ?

---------------------------------------------------------------------------

by benbender at 2013-03-12T13:54:02Z

Done

---------------------------------------------------------------------------

by stevelacey at 2013-03-12T14:40:59Z

Looks good to me?

---------------------------------------------------------------------------

by pborreli at 2013-03-12T16:04:27Z

👍
This commit is contained in:
Fabien Potencier 2013-03-13 14:31:33 +01:00
commit 8f2c875750
2 changed files with 17 additions and 0 deletions

View File

@ -32,6 +32,7 @@ class Scope
*/
public function __construct(Scope $parent = null)
{
$this->data = array();
$this->parent = $parent;
$this->left = false;
$this->data = array();

View File

@ -0,0 +1,16 @@
<?php
namespace Symfony\Bridge\Twig\Tests\NodeVisitor;
use Symfony\Bridge\Twig\NodeVisitor\Scope;
use Symfony\Bridge\Twig\Tests\TestCase;
class ScopeTest extends TestCase
{
public function testScopeInitiation()
{
$scope = new Scope();
$scope->enter();
$this->assertNull($scope->get('test'));
}
}