1 | <?php |
||
9 | abstract class AbstractBinaryOp 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 | * @param $b |
||
25 | * @return Node\Expr |
||
26 | */ |
||
27 | abstract protected function buildExpression($a, $b); |
||
28 | |||
29 | /** |
||
30 | * @param $a |
||
31 | * @param $b |
||
32 | * @return mixed |
||
33 | */ |
||
34 | abstract protected function process($a, $b); |
||
35 | |||
36 | /** |
||
37 | * @return array |
||
38 | */ |
||
39 | abstract protected function getSupportedTypes(); |
||
40 | |||
41 | /** |
||
42 | * Tests {left-expr} $operator {right-expr} |
||
43 | */ |
||
44 | public function testOperatorCompile() |
||
60 | |||
61 | /** |
||
62 | * Tests {left-expr::UNKNOWN} $operator {right-expr} |
||
63 | */ |
||
64 | public function testFirstArgUnexpectedType() |
||
76 | |||
77 | /** |
||
78 | * Tests {left-expr} $operator {right-expr::UNKNOWN} |
||
79 | */ |
||
80 | public function testSecondArgUnexpectedType() |
||
92 | } |
||
93 |