Completed
Push — master ( d6a494...e1144e )
by Дмитрий
11s
created

PHPSA/Compiler/Expression/ErrorSuppressTest.php (3 issues)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
3
namespace Tests\PHPSA\Expression;
4
5
use PhpParser\Node;
6
use PHPSA\CompiledExpression;
7
use PHPSA\Compiler\Expression;
8
9
class ErrorSuppressTest extends \Tests\PHPSA\TestCase
10
{
11
    public function testErrorSuppressSuccess()
12
    {
13
        $baseExpression = new Node\Expr\ErrorSuppress(new Node\Expr\Print_(
14
            $this->newScalarExpr("test")
15
        ));
16
        $compiledExpression = $this->compileExpression($baseExpression);
17
18
        parent::assertInstanceOfCompiledExpression($compiledExpression);
0 ignored issues
show
Comprehensibility Bug introduced by
It seems like you call parent on a different method (assertInstanceOfCompiledExpression() instead of testErrorSuppressSuccess()). Are you sure this is correct? If so, you might want to change this to $this->assertInstanceOfCompiledExpression().

This check looks for a call to a parent method whose name is different than the method from which it is called.

Consider the following code:

class Daddy
{
    protected function getFirstName()
    {
        return "Eidur";
    }

    protected function getSurName()
    {
        return "Gudjohnsen";
    }
}

class Son
{
    public function getFirstName()
    {
        return parent::getSurname();
    }
}

The getFirstName() method in the Son calls the wrong method in the parent class.

Loading history...
19
        parent::assertSame(CompiledExpression::INTEGER, $compiledExpression->getType());
0 ignored issues
show
Comprehensibility Bug introduced by
It seems like you call parent on a different method (assertSame() instead of testErrorSuppressSuccess()). Are you sure this is correct? If so, you might want to change this to $this->assertSame().

This check looks for a call to a parent method whose name is different than the method from which it is called.

Consider the following code:

class Daddy
{
    protected function getFirstName()
    {
        return "Eidur";
    }

    protected function getSurName()
    {
        return "Gudjohnsen";
    }
}

class Son
{
    public function getFirstName()
    {
        return parent::getSurname();
    }
}

The getFirstName() method in the Son calls the wrong method in the parent class.

Loading history...
20
        parent::assertSame(1, $compiledExpression->getValue());
0 ignored issues
show
Comprehensibility Bug introduced by
It seems like you call parent on a different method (assertSame() instead of testErrorSuppressSuccess()). Are you sure this is correct? If so, you might want to change this to $this->assertSame().

This check looks for a call to a parent method whose name is different than the method from which it is called.

Consider the following code:

class Daddy
{
    protected function getFirstName()
    {
        return "Eidur";
    }

    protected function getSurName()
    {
        return "Gudjohnsen";
    }
}

class Son
{
    public function getFirstName()
    {
        return parent::getSurname();
    }
}

The getFirstName() method in the Son calls the wrong method in the parent class.

Loading history...
21
    }
22
}
23