mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-12 23:14:18 +01:00
N°2651 Remove lib test files from index
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -20,6 +20,7 @@ test/vendor/*
|
||||
/lib/**/tests/**
|
||||
/lib/**/Test/**
|
||||
/lib/**/Tests/**
|
||||
!/lib/twig/**/Expression/Test/**
|
||||
|
||||
# all datas but listing prevention
|
||||
/data/**
|
||||
|
||||
11
lib/twig/twig/lib/Twig/Node/Expression/Test/Constant.php
Normal file
11
lib/twig/twig/lib/Twig/Node/Expression/Test/Constant.php
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
use Twig\Node\Expression\Test\ConstantTest;
|
||||
|
||||
class_exists('Twig\Node\Expression\Test\ConstantTest');
|
||||
|
||||
if (\false) {
|
||||
class Twig_Node_Expression_Test_Constant extends ConstantTest
|
||||
{
|
||||
}
|
||||
}
|
||||
11
lib/twig/twig/lib/Twig/Node/Expression/Test/Defined.php
Normal file
11
lib/twig/twig/lib/Twig/Node/Expression/Test/Defined.php
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
use Twig\Node\Expression\Test\DefinedTest;
|
||||
|
||||
class_exists('Twig\Node\Expression\Test\DefinedTest');
|
||||
|
||||
if (\false) {
|
||||
class Twig_Node_Expression_Test_Defined extends DefinedTest
|
||||
{
|
||||
}
|
||||
}
|
||||
11
lib/twig/twig/lib/Twig/Node/Expression/Test/Divisibleby.php
Normal file
11
lib/twig/twig/lib/Twig/Node/Expression/Test/Divisibleby.php
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
use Twig\Node\Expression\Test\DivisiblebyTest;
|
||||
|
||||
class_exists('Twig\Node\Expression\Test\DivisiblebyTest');
|
||||
|
||||
if (\false) {
|
||||
class Twig_Node_Expression_Test_Divisibleby extends DivisiblebyTest
|
||||
{
|
||||
}
|
||||
}
|
||||
11
lib/twig/twig/lib/Twig/Node/Expression/Test/Even.php
Normal file
11
lib/twig/twig/lib/Twig/Node/Expression/Test/Even.php
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
use Twig\Node\Expression\Test\EvenTest;
|
||||
|
||||
class_exists('Twig\Node\Expression\Test\EvenTest');
|
||||
|
||||
if (\false) {
|
||||
class Twig_Node_Expression_Test_Even extends EvenTest
|
||||
{
|
||||
}
|
||||
}
|
||||
11
lib/twig/twig/lib/Twig/Node/Expression/Test/Null.php
Normal file
11
lib/twig/twig/lib/Twig/Node/Expression/Test/Null.php
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
use Twig\Node\Expression\Test\NullTest;
|
||||
|
||||
class_exists('Twig\Node\Expression\Test\NullTest');
|
||||
|
||||
if (\false) {
|
||||
class Twig_Node_Expression_Test_Null extends NullTest
|
||||
{
|
||||
}
|
||||
}
|
||||
11
lib/twig/twig/lib/Twig/Node/Expression/Test/Odd.php
Normal file
11
lib/twig/twig/lib/Twig/Node/Expression/Test/Odd.php
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
use Twig\Node\Expression\Test\OddTest;
|
||||
|
||||
class_exists('Twig\Node\Expression\Test\OddTest');
|
||||
|
||||
if (\false) {
|
||||
class Twig_Node_Expression_Test_Odd extends OddTest
|
||||
{
|
||||
}
|
||||
}
|
||||
11
lib/twig/twig/lib/Twig/Node/Expression/Test/Sameas.php
Normal file
11
lib/twig/twig/lib/Twig/Node/Expression/Test/Sameas.php
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
use Twig\Node\Expression\Test\SameasTest;
|
||||
|
||||
class_exists('Twig\Node\Expression\Test\SameasTest');
|
||||
|
||||
if (\false) {
|
||||
class Twig_Node_Expression_Test_Sameas extends SameasTest
|
||||
{
|
||||
}
|
||||
}
|
||||
51
lib/twig/twig/src/Node/Expression/Test/ConstantTest.php
Normal file
51
lib/twig/twig/src/Node/Expression/Test/ConstantTest.php
Normal file
@@ -0,0 +1,51 @@
|
||||
<?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.
|
||||
*/
|
||||
|
||||
namespace Twig\Node\Expression\Test;
|
||||
|
||||
use Twig\Compiler;
|
||||
use Twig\Node\Expression\TestExpression;
|
||||
|
||||
/**
|
||||
* Checks if a variable is the exact same value as a constant.
|
||||
*
|
||||
* {% if post.status is constant('Post::PUBLISHED') %}
|
||||
* the status attribute is exactly the same as Post::PUBLISHED
|
||||
* {% endif %}
|
||||
*
|
||||
* @author Fabien Potencier <fabien@symfony.com>
|
||||
*/
|
||||
class ConstantTest extends TestExpression
|
||||
{
|
||||
public function compile(Compiler $compiler)
|
||||
{
|
||||
$compiler
|
||||
->raw('(')
|
||||
->subcompile($this->getNode('node'))
|
||||
->raw(' === constant(')
|
||||
;
|
||||
|
||||
if ($this->getNode('arguments')->hasNode(1)) {
|
||||
$compiler
|
||||
->raw('get_class(')
|
||||
->subcompile($this->getNode('arguments')->getNode(1))
|
||||
->raw(')."::".')
|
||||
;
|
||||
}
|
||||
|
||||
$compiler
|
||||
->subcompile($this->getNode('arguments')->getNode(0))
|
||||
->raw('))')
|
||||
;
|
||||
}
|
||||
}
|
||||
|
||||
class_alias('Twig\Node\Expression\Test\ConstantTest', 'Twig_Node_Expression_Test_Constant');
|
||||
71
lib/twig/twig/src/Node/Expression/Test/DefinedTest.php
Normal file
71
lib/twig/twig/src/Node/Expression/Test/DefinedTest.php
Normal file
@@ -0,0 +1,71 @@
|
||||
<?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.
|
||||
*/
|
||||
|
||||
namespace Twig\Node\Expression\Test;
|
||||
|
||||
use Twig\Compiler;
|
||||
use Twig\Error\SyntaxError;
|
||||
use Twig\Node\Expression\ArrayExpression;
|
||||
use Twig\Node\Expression\BlockReferenceExpression;
|
||||
use Twig\Node\Expression\ConstantExpression;
|
||||
use Twig\Node\Expression\FunctionExpression;
|
||||
use Twig\Node\Expression\GetAttrExpression;
|
||||
use Twig\Node\Expression\NameExpression;
|
||||
use Twig\Node\Expression\TestExpression;
|
||||
|
||||
/**
|
||||
* Checks if a variable is defined in the current context.
|
||||
*
|
||||
* {# defined works with variable names and variable attributes #}
|
||||
* {% if foo is defined %}
|
||||
* {# ... #}
|
||||
* {% endif %}
|
||||
*
|
||||
* @author Fabien Potencier <fabien@symfony.com>
|
||||
*/
|
||||
class DefinedTest extends TestExpression
|
||||
{
|
||||
public function __construct(\Twig_NodeInterface $node, $name, \Twig_NodeInterface $arguments = null, $lineno)
|
||||
{
|
||||
if ($node instanceof NameExpression) {
|
||||
$node->setAttribute('is_defined_test', true);
|
||||
} elseif ($node instanceof GetAttrExpression) {
|
||||
$node->setAttribute('is_defined_test', true);
|
||||
$this->changeIgnoreStrictCheck($node);
|
||||
} elseif ($node instanceof BlockReferenceExpression) {
|
||||
$node->setAttribute('is_defined_test', true);
|
||||
} elseif ($node instanceof FunctionExpression && 'constant' === $node->getAttribute('name')) {
|
||||
$node->setAttribute('is_defined_test', true);
|
||||
} elseif ($node instanceof ConstantExpression || $node instanceof ArrayExpression) {
|
||||
$node = new ConstantExpression(true, $node->getTemplateLine());
|
||||
} else {
|
||||
throw new SyntaxError('The "defined" test only works with simple variables.', $lineno);
|
||||
}
|
||||
|
||||
parent::__construct($node, $name, $arguments, $lineno);
|
||||
}
|
||||
|
||||
protected function changeIgnoreStrictCheck(GetAttrExpression $node)
|
||||
{
|
||||
$node->setAttribute('ignore_strict_check', true);
|
||||
|
||||
if ($node->getNode('node') instanceof GetAttrExpression) {
|
||||
$this->changeIgnoreStrictCheck($node->getNode('node'));
|
||||
}
|
||||
}
|
||||
|
||||
public function compile(Compiler $compiler)
|
||||
{
|
||||
$compiler->subcompile($this->getNode('node'));
|
||||
}
|
||||
}
|
||||
|
||||
class_alias('Twig\Node\Expression\Test\DefinedTest', 'Twig_Node_Expression_Test_Defined');
|
||||
38
lib/twig/twig/src/Node/Expression/Test/DivisiblebyTest.php
Normal file
38
lib/twig/twig/src/Node/Expression/Test/DivisiblebyTest.php
Normal file
@@ -0,0 +1,38 @@
|
||||
<?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.
|
||||
*/
|
||||
|
||||
namespace Twig\Node\Expression\Test;
|
||||
|
||||
use Twig\Compiler;
|
||||
use Twig\Node\Expression\TestExpression;
|
||||
|
||||
/**
|
||||
* Checks if a variable is divisible by a number.
|
||||
*
|
||||
* {% if loop.index is divisible by(3) %}
|
||||
*
|
||||
* @author Fabien Potencier <fabien@symfony.com>
|
||||
*/
|
||||
class DivisiblebyTest extends TestExpression
|
||||
{
|
||||
public function compile(Compiler $compiler)
|
||||
{
|
||||
$compiler
|
||||
->raw('(0 == ')
|
||||
->subcompile($this->getNode('node'))
|
||||
->raw(' % ')
|
||||
->subcompile($this->getNode('arguments')->getNode(0))
|
||||
->raw(')')
|
||||
;
|
||||
}
|
||||
}
|
||||
|
||||
class_alias('Twig\Node\Expression\Test\DivisiblebyTest', 'Twig_Node_Expression_Test_Divisibleby');
|
||||
37
lib/twig/twig/src/Node/Expression/Test/EvenTest.php
Normal file
37
lib/twig/twig/src/Node/Expression/Test/EvenTest.php
Normal file
@@ -0,0 +1,37 @@
|
||||
<?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.
|
||||
*/
|
||||
|
||||
namespace Twig\Node\Expression\Test;
|
||||
|
||||
use Twig\Compiler;
|
||||
use Twig\Node\Expression\TestExpression;
|
||||
|
||||
/**
|
||||
* Checks if a number is even.
|
||||
*
|
||||
* {{ var is even }}
|
||||
*
|
||||
* @author Fabien Potencier <fabien@symfony.com>
|
||||
*/
|
||||
class EvenTest extends TestExpression
|
||||
{
|
||||
public function compile(Compiler $compiler)
|
||||
{
|
||||
$compiler
|
||||
->raw('(')
|
||||
->subcompile($this->getNode('node'))
|
||||
->raw(' % 2 == 0')
|
||||
->raw(')')
|
||||
;
|
||||
}
|
||||
}
|
||||
|
||||
class_alias('Twig\Node\Expression\Test\EvenTest', 'Twig_Node_Expression_Test_Even');
|
||||
36
lib/twig/twig/src/Node/Expression/Test/NullTest.php
Normal file
36
lib/twig/twig/src/Node/Expression/Test/NullTest.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?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.
|
||||
*/
|
||||
|
||||
namespace Twig\Node\Expression\Test;
|
||||
|
||||
use Twig\Compiler;
|
||||
use Twig\Node\Expression\TestExpression;
|
||||
|
||||
/**
|
||||
* Checks that a variable is null.
|
||||
*
|
||||
* {{ var is none }}
|
||||
*
|
||||
* @author Fabien Potencier <fabien@symfony.com>
|
||||
*/
|
||||
class NullTest extends TestExpression
|
||||
{
|
||||
public function compile(Compiler $compiler)
|
||||
{
|
||||
$compiler
|
||||
->raw('(null === ')
|
||||
->subcompile($this->getNode('node'))
|
||||
->raw(')')
|
||||
;
|
||||
}
|
||||
}
|
||||
|
||||
class_alias('Twig\Node\Expression\Test\NullTest', 'Twig_Node_Expression_Test_Null');
|
||||
37
lib/twig/twig/src/Node/Expression/Test/OddTest.php
Normal file
37
lib/twig/twig/src/Node/Expression/Test/OddTest.php
Normal file
@@ -0,0 +1,37 @@
|
||||
<?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.
|
||||
*/
|
||||
|
||||
namespace Twig\Node\Expression\Test;
|
||||
|
||||
use Twig\Compiler;
|
||||
use Twig\Node\Expression\TestExpression;
|
||||
|
||||
/**
|
||||
* Checks if a number is odd.
|
||||
*
|
||||
* {{ var is odd }}
|
||||
*
|
||||
* @author Fabien Potencier <fabien@symfony.com>
|
||||
*/
|
||||
class OddTest extends TestExpression
|
||||
{
|
||||
public function compile(Compiler $compiler)
|
||||
{
|
||||
$compiler
|
||||
->raw('(')
|
||||
->subcompile($this->getNode('node'))
|
||||
->raw(' % 2 == 1')
|
||||
->raw(')')
|
||||
;
|
||||
}
|
||||
}
|
||||
|
||||
class_alias('Twig\Node\Expression\Test\OddTest', 'Twig_Node_Expression_Test_Odd');
|
||||
36
lib/twig/twig/src/Node/Expression/Test/SameasTest.php
Normal file
36
lib/twig/twig/src/Node/Expression/Test/SameasTest.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?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.
|
||||
*/
|
||||
|
||||
namespace Twig\Node\Expression\Test;
|
||||
|
||||
use Twig\Compiler;
|
||||
use Twig\Node\Expression\TestExpression;
|
||||
|
||||
/**
|
||||
* Checks if a variable is the same as another one (=== in PHP).
|
||||
*
|
||||
* @author Fabien Potencier <fabien@symfony.com>
|
||||
*/
|
||||
class SameasTest extends TestExpression
|
||||
{
|
||||
public function compile(Compiler $compiler)
|
||||
{
|
||||
$compiler
|
||||
->raw('(')
|
||||
->subcompile($this->getNode('node'))
|
||||
->raw(' === ')
|
||||
->subcompile($this->getNode('arguments')->getNode(0))
|
||||
->raw(')')
|
||||
;
|
||||
}
|
||||
}
|
||||
|
||||
class_alias('Twig\Node\Expression\Test\SameasTest', 'Twig_Node_Expression_Test_Sameas');
|
||||
Reference in New Issue
Block a user