for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Tests\PHPSA\Compiler\Expression;
use PhpParser\Node;
use PHPSA\CompiledExpression;
use PHPSA\Compiler\Expression;
abstract class AbstractBinaryOp extends \Tests\PHPSA\TestCase
{
/**
* @param $a
* @param $b
* @return Node\Expr
*/
abstract protected function buildExpression($a, $b);
* Tests {left-expr::UNKNOWN} $operator {right-expr}
public function testFirstArgUnexpectedType()
$baseExpression = $this->buildExpression(
$this->newFakeScalarExpr(),
$this->newScalarExpr(1)
);
$compiledExpression = $this->compileExpression($baseExpression);
$this->assertInstanceOfCompiledExpression($compiledExpression);
$this->assertSame(CompiledExpression::UNKNOWN, $compiledExpression->getType());
$this->assertSame(null, $compiledExpression->getValue());
}
* Tests {left-expr} $operator {right-expr::UNKNOWN}
public function testSecondArgUnexpectedType()
$this->newScalarExpr(1),
$this->newFakeScalarExpr()