[ Avaa Bypassed ]




Upload:

Command:

hmhc3928@3.144.16.40: ~ $
<?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.
 */

use Twig\Environment;
use Twig\Loader\LoaderInterface;
use Twig\Node\Expression\NameExpression;
use Twig\Test\NodeTestCase;

class Twig_Tests_Node_Expression_NameTest extends NodeTestCase
{
    public function testConstructor()
    {
        $node = new NameExpression('foo', 1);

        $this->assertEquals('foo', $node->getAttribute('name'));
    }

    public function getTests()
    {
        $node = new NameExpression('foo', 1);
        $self = new NameExpression('_self', 1);
        $context = new NameExpression('_context', 1);

        $env = new Environment($this->getMockBuilder(LoaderInterface::class)->getMock(), ['strict_variables' => true]);
        $env1 = new Environment($this->getMockBuilder(LoaderInterface::class)->getMock(), ['strict_variables' => false]);

        $output = '(isset($context["foo"]) || array_key_exists("foo", $context) ? $context["foo"] : (function () { throw new RuntimeError(\'Variable "foo" does not exist.\', 1, $this->source); })())';

        return [
            [$node, "// line 1\n".$output, $env],
            [$node, $this->getVariableGetter('foo', 1), $env1],
            [$self, "// line 1\n\$this->getTemplateName()"],
            [$context, "// line 1\n\$context"],
        ];
    }
}

Filemanager

Name Type Size Permission Actions
Binary Folder 0755
Unary Folder 0755
ArrayTest.php File 1.01 KB 0644
AssignNameTest.php File 684 B 0644
CallTest.php File 6.07 KB 0644
ConditionalTest.php File 1.17 KB 0644
ConstantTest.php File 691 B 0644
FilterTest.php File 6.03 KB 0644
FunctionTest.php File 4.68 KB 0644
GetAttrTest.php File 2.34 KB 0644
NameTest.php File 1.41 KB 0644
NullCoalesceTest.php File 710 B 0644
ParentTest.php File 703 B 0644
TestTest.php File 3.09 KB 0644