1 | <?php |
||
9 | abstract class AbstractUnaryOp extends \Tests\PHPSA\TestCase |
||
10 | { |
||
11 | /** |
||
12 | * Data provider for tests |
||
13 | */ |
||
14 | public $data = [ |
||
15 | CompiledExpression::INTEGER => 6, |
||
16 | CompiledExpression::DOUBLE => 2.5, |
||
17 | CompiledExpression::STRING => "test", |
||
18 | CompiledExpression::BOOLEAN => true, |
||
19 | CompiledExpression::NULL => null, |
||
20 | ]; |
||
21 | |||
22 | /** |
||
23 | * @param $a |
||
24 | * @return Node\Expr |
||
25 | */ |
||
26 | abstract protected function buildExpression($a); |
||
27 | |||
28 | /** |
||
29 | * @param $a |
||
30 | * @return mixed |
||
31 | */ |
||
32 | abstract protected function process($a); |
||
33 | |||
34 | /** |
||
35 | * @return array |
||
36 | */ |
||
37 | abstract protected function getSupportedTypes(); |
||
38 | |||
39 | /** |
||
40 | * Tests $operator {expr} |
||
41 | */ |
||
42 | public function testOperatorCompile() |
||
55 | |||
56 | /** |
||
57 | * Tests $operator {expr::UNKNOWN} |
||
58 | */ |
||
59 | public function testUnexpectedType() |
||
70 | } |
||
71 |