Completed
Push — master ( d5fb95...22dee5 )
by Дмитрий
03:40
created

CompiledExpressionTest::isTypeKnownProvider()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 14
Code Lines 11

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 11
nc 1
nop 0
dl 0
loc 14
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
namespace Tests\PHPSA;
4
5
use PHPSA\CompiledExpression;
6
7
class CompiledExpressionTest extends TestCase
8
{
9
    public function testToVariableMethod()
10
    {
11
        $compiledExpression = new CompiledExpression(CompiledExpression::INTEGER, 1);
12
        $this->assertInstanceOfCompiledExpression($compiledExpression);
13
14
        $resultVariable = $compiledExpression->toVariable('test');
15
        parent::assertInstanceOf('PHPSA\Variable', $resultVariable);
0 ignored issues
show
Comprehensibility Bug introduced by
It seems like you call parent on a different method (assertInstanceOf() instead of testToVariableMethod()). Are you sure this is correct? If so, you might want to change this to $this->assertInstanceOf().

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...
16
        parent::assertSame($compiledExpression->getType(), $resultVariable->getType());
0 ignored issues
show
Comprehensibility Bug introduced by
It seems like you call parent on a different method (assertSame() instead of testToVariableMethod()). 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...
17
        parent::assertSame($compiledExpression->getValue(), $resultVariable->getValue());
0 ignored issues
show
Comprehensibility Bug introduced by
It seems like you call parent on a different method (assertSame() instead of testToVariableMethod()). 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...
18
    }
19
20
    public function testFromZvalInteger()
21
    {
22
        $result = CompiledExpression::fromZvalValue(1);
23
        parent::assertInstanceOfCompiledExpression($result);
0 ignored issues
show
Comprehensibility Bug introduced by
It seems like you call parent on a different method (assertInstanceOfCompiledExpression() instead of testFromZvalInteger()). 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...
24
        parent::assertSame(CompiledExpression::INTEGER, $result->getType());
0 ignored issues
show
Comprehensibility Bug introduced by
It seems like you call parent on a different method (assertSame() instead of testFromZvalInteger()). 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...
25
        parent::assertSame(1, $result->getValue());
0 ignored issues
show
Comprehensibility Bug introduced by
It seems like you call parent on a different method (assertSame() instead of testFromZvalInteger()). 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...
26
    }
27
28
    public function testFromZvalBoolean()
29
    {
30
        $result = CompiledExpression::fromZvalValue(true);
31
        parent::assertInstanceOfCompiledExpression($result);
0 ignored issues
show
Comprehensibility Bug introduced by
It seems like you call parent on a different method (assertInstanceOfCompiledExpression() instead of testFromZvalBoolean()). 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...
32
        parent::assertSame(CompiledExpression::BOOLEAN, $result->getType());
0 ignored issues
show
Comprehensibility Bug introduced by
It seems like you call parent on a different method (assertSame() instead of testFromZvalBoolean()). 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...
33
        parent::assertSame(true, $result->getValue());
0 ignored issues
show
Comprehensibility Bug introduced by
It seems like you call parent on a different method (assertSame() instead of testFromZvalBoolean()). 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...
34
35
        $result = CompiledExpression::fromZvalValue(false);
36
        parent::assertInstanceOfCompiledExpression($result);
0 ignored issues
show
Comprehensibility Bug introduced by
It seems like you call parent on a different method (assertInstanceOfCompiledExpression() instead of testFromZvalBoolean()). 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...
37
        parent::assertSame(CompiledExpression::BOOLEAN, $result->getType());
0 ignored issues
show
Comprehensibility Bug introduced by
It seems like you call parent on a different method (assertSame() instead of testFromZvalBoolean()). 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...
38
        parent::assertSame(false, $result->getValue());
0 ignored issues
show
Comprehensibility Bug introduced by
It seems like you call parent on a different method (assertSame() instead of testFromZvalBoolean()). 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...
39
    }
40
41
    public function testFromZvalArray()
42
    {
43
        $result = CompiledExpression::fromZvalValue([]);
44
        parent::assertInstanceOfCompiledExpression($result);
0 ignored issues
show
Comprehensibility Bug introduced by
It seems like you call parent on a different method (assertInstanceOfCompiledExpression() instead of testFromZvalArray()). 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...
45
        parent::assertSame(CompiledExpression::ARR, $result->getType());
0 ignored issues
show
Comprehensibility Bug introduced by
It seems like you call parent on a different method (assertSame() instead of testFromZvalArray()). 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...
46
        parent::assertSame([], $result->getValue());
0 ignored issues
show
Comprehensibility Bug introduced by
It seems like you call parent on a different method (assertSame() instead of testFromZvalArray()). 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...
47
    }
48
49
    public function testFromZvalString()
50
    {
51
        $result = CompiledExpression::fromZvalValue('test string');
52
        parent::assertInstanceOfCompiledExpression($result);
0 ignored issues
show
Comprehensibility Bug introduced by
It seems like you call parent on a different method (assertInstanceOfCompiledExpression() instead of testFromZvalString()). 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...
53
        parent::assertSame(CompiledExpression::STRING, $result->getType());
0 ignored issues
show
Comprehensibility Bug introduced by
It seems like you call parent on a different method (assertSame() instead of testFromZvalString()). 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...
54
        parent::assertSame('test string', $result->getValue());
0 ignored issues
show
Comprehensibility Bug introduced by
It seems like you call parent on a different method (assertSame() instead of testFromZvalString()). 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...
55
    }
56
57
    public function testFromZvalDouble()
58
    {
59
        $result = CompiledExpression::fromZvalValue(1.0);
60
        parent::assertInstanceOfCompiledExpression($result);
0 ignored issues
show
Comprehensibility Bug introduced by
It seems like you call parent on a different method (assertInstanceOfCompiledExpression() instead of testFromZvalDouble()). 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...
61
        parent::assertSame(CompiledExpression::DOUBLE, $result->getType());
0 ignored issues
show
Comprehensibility Bug introduced by
It seems like you call parent on a different method (assertSame() instead of testFromZvalDouble()). 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...
62
        parent::assertSame(1.0, $result->getValue());
0 ignored issues
show
Comprehensibility Bug introduced by
It seems like you call parent on a different method (assertSame() instead of testFromZvalDouble()). 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...
63
    }
64
65
    public function testFromZvalNull()
66
    {
67
        $result = CompiledExpression::fromZvalValue(null);
68
        parent::assertInstanceOfCompiledExpression($result);
0 ignored issues
show
Comprehensibility Bug introduced by
It seems like you call parent on a different method (assertInstanceOfCompiledExpression() instead of testFromZvalNull()). 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...
69
        parent::assertSame(CompiledExpression::NULL, $result->getType());
0 ignored issues
show
Comprehensibility Bug introduced by
It seems like you call parent on a different method (assertSame() instead of testFromZvalNull()). 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...
70
        parent::assertSame(null, $result->getValue());
0 ignored issues
show
Comprehensibility Bug introduced by
It seems like you call parent on a different method (assertSame() instead of testFromZvalNull()). 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...
71
    }
72
73
    /**
74
     * @dataProvider scalarTypeProvider
75
     */
76
    public function testIsScalarWithScalarTypes($expressionType)
77
    {
78
        $compiledExpression = new CompiledExpression($expressionType);
79
        parent::assertTrue($compiledExpression->isScalar());
0 ignored issues
show
Comprehensibility Bug introduced by
It seems like you call parent on a different method (assertTrue() instead of testIsScalarWithScalarTypes()). Are you sure this is correct? If so, you might want to change this to $this->assertTrue().

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...
80
    }
81
82
    public function scalarTypeProvider()
83
    {
84
        return [
85
            [ CompiledExpression::BOOLEAN ],
86
            [ CompiledExpression::STRING ],
87
            [ CompiledExpression::DOUBLE ],
88
            [ CompiledExpression::NUMBER ],
89
            [ CompiledExpression::INTEGER ],
90
        ];
91
    }
92
93
    /**
94
     * @dataProvider nonScalarTypeProvider
95
     */
96
    public function testIsScalarWithNonScalarTypes($expressionType)
97
    {
98
        $compiledExpression = new CompiledExpression($expressionType);
99
        parent::assertFalse($compiledExpression->isScalar());
0 ignored issues
show
Comprehensibility Bug introduced by
It seems like you call parent on a different method (assertFalse() instead of testIsScalarWithNonScalarTypes()). Are you sure this is correct? If so, you might want to change this to $this->assertFalse().

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...
100
    }
101
102
    public function nonScalarTypeProvider()
103
    {
104
        return [
105
            [ CompiledExpression::UNKNOWN ],
106
            [ CompiledExpression::NULL ],
107
            [ CompiledExpression::ARR ],
108
            [ CompiledExpression::RESOURCE ],
109
            [ CompiledExpression::OBJECT ],
110
            [ CompiledExpression::VOID ],
111
            [ CompiledExpression::CALLABLE_TYPE ],
112
            [ CompiledExpression::VARIABLE ],
113
        ];
114
    }
115
116
    public function isTypeKnownProvider()
117
    {
118
        return [
119
            [ CompiledExpression::INTEGER ],
120
            [ CompiledExpression::DOUBLE ],
121
            [ CompiledExpression::NUMBER ],
122
            [ CompiledExpression::STRING ],
123
            [ CompiledExpression::ARR ],
124
            [ CompiledExpression::BOOLEAN ],
125
            [ CompiledExpression::RESOURCE ],
126
            [ CompiledExpression::CALLABLE_TYPE ],
127
            [ CompiledExpression::NULL ],
128
        ];
129
    }
130
131
    /**
132
     * @dataProvider isTypeKnownProvider
133
     * @param int $type
134
     */
135
    public function testIsTypeKnownTrue($type)
136
    {
137
        $compiledExpression = new CompiledExpression($type);
138
        parent::assertTrue($compiledExpression->isTypeKnown());
0 ignored issues
show
Comprehensibility Bug introduced by
It seems like you call parent on a different method (assertTrue() instead of testIsTypeKnownTrue()). Are you sure this is correct? If so, you might want to change this to $this->assertTrue().

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...
139
    }
140
141
    public function testIsTypeKnownWithUnknownType()
142
    {
143
        $compiledExpression = new CompiledExpression(CompiledExpression::UNKNOWN);
144
        parent::assertFalse($compiledExpression->isTypeKnown());
0 ignored issues
show
Comprehensibility Bug introduced by
It seems like you call parent on a different method (assertFalse() instead of testIsTypeKnownWithUnknownType()). Are you sure this is correct? If so, you might want to change this to $this->assertFalse().

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...
145
    }
146
147
    public function testHasValueWithAValue()
148
    {
149
        $compiledExpression = new CompiledExpression(CompiledExpression::BOOLEAN, false);
150
        parent::assertTrue($compiledExpression->hasValue());
0 ignored issues
show
Comprehensibility Bug introduced by
It seems like you call parent on a different method (assertTrue() instead of testHasValueWithAValue()). Are you sure this is correct? If so, you might want to change this to $this->assertTrue().

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...
151
    }
152
153
    public function testHasValueWithAScalarTypeAndNoValue()
154
    {
155
        $compiledExpression = new CompiledExpression(CompiledExpression::BOOLEAN, /* just to be explicit */ null);
156
        parent::assertFalse($compiledExpression->hasValue());
0 ignored issues
show
Comprehensibility Bug introduced by
It seems like you call parent on a different method (assertFalse() instead of testHasValueWithAScalarTypeAndNoValue()). Are you sure this is correct? If so, you might want to change this to $this->assertFalse().

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...
157
    }
158
159
    public function testHasValueWithANullType()
160
    {
161
        $compiledExpression = new CompiledExpression(CompiledExpression::NULL);
162
        parent::assertTrue($compiledExpression->hasValue());
0 ignored issues
show
Comprehensibility Bug introduced by
It seems like you call parent on a different method (assertTrue() instead of testHasValueWithANullType()). Are you sure this is correct? If so, you might want to change this to $this->assertTrue().

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...
163
    }
164
165
    public function testCanBeObject()
166
    {
167
        // Mixed type can be object
168
        $expr = new CompiledExpression(CompiledExpression::MIXED, null);
169
        parent::assertTrue($expr->canBeObject());
0 ignored issues
show
Comprehensibility Bug introduced by
It seems like you call parent on a different method (assertTrue() instead of testCanBeObject()). Are you sure this is correct? If so, you might want to change this to $this->assertTrue().

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...
170
171
        // Integer type can't be object
172
        $expr2 = new CompiledExpression(CompiledExpression::INTEGER, 1);
173
        parent::assertFalse($expr2->canBeObject());
0 ignored issues
show
Comprehensibility Bug introduced by
It seems like you call parent on a different method (assertFalse() instead of testCanBeObject()). Are you sure this is correct? If so, you might want to change this to $this->assertFalse().

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...
174
    }
175
176
    public function testIsObject()
177
    {
178
        // Mixed type could be object but it's unclear
179
        $expr = new CompiledExpression(CompiledExpression::MIXED, null);
180
        parent::assertFalse($expr->isObject());
0 ignored issues
show
Comprehensibility Bug introduced by
It seems like you call parent on a different method (assertFalse() instead of testIsObject()). Are you sure this is correct? If so, you might want to change this to $this->assertFalse().

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...
181
182
        // Object type is object
183
        $expr2 = new CompiledExpression(CompiledExpression::OBJECT, null);
184
        parent::assertTrue($expr2->isObject());
0 ignored issues
show
Comprehensibility Bug introduced by
It seems like you call parent on a different method (assertTrue() instead of testIsObject()). Are you sure this is correct? If so, you might want to change this to $this->assertTrue().

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...
185
    }
186
187
    public function testIsArray()
188
    {
189
        $compiledExpression = new CompiledExpression(CompiledExpression::ARR);
190
        parent::assertTrue($compiledExpression->isArray());
0 ignored issues
show
Comprehensibility Bug introduced by
It seems like you call parent on a different method (assertTrue() instead of testIsArray()). Are you sure this is correct? If so, you might want to change this to $this->assertTrue().

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...
191
    }
192
193
    public function testIsArrayWhenFalse()
194
    {
195
        $compiledExpression = new CompiledExpression(CompiledExpression::BOOLEAN);
196
        parent::assertFalse($compiledExpression->isArray());
0 ignored issues
show
Comprehensibility Bug introduced by
It seems like you call parent on a different method (assertFalse() instead of testIsArrayWhenFalse()). Are you sure this is correct? If so, you might want to change this to $this->assertFalse().

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...
197
    }
198
}
199