Skip to content

Commit 4e4175e

Browse files
committed
TASK: Add tests for the current implementation for multiple chained operands: true && true && true
1 parent 21c6727 commit 4e4175e

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

test/Unit/Target/Php/Transpiler/BinaryOperation/BinaryOperationTranspilerTest.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,10 @@ public function binaryOperationExamples(): array
9999
'a <= 2' => ['a <= 2', '($this->a <= 2)'],
100100
'4 <= b' => ['4 <= b', '(4 <= $this->b)'],
101101
'a <= b' => ['a <= b', '($this->a <= $this->b)'],
102+
103+
'true && true && true' => ['true && true && true', '(true && true && true)'],
104+
'1 === 1 === true' => ['1 === 1 === true', '(1 === 1 === true)'],
105+
'1 + 1 + 1' => ['1 + 1 + 1', '(1 + 1 + 1)'],
102106
];
103107
}
104108

@@ -126,4 +130,4 @@ public function transpilesBinaryOperationNodes(string $binaryOperationAsString,
126130
$actualTranspilationResult
127131
);
128132
}
129-
}
133+
}

test/Unit/TypeSystem/Resolver/BinaryOperation/BinaryOperationTypeResolverTest.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,10 @@ public function binaryOperationExamples(): array
6060
'4 >= 2' => ['4 >= 2', BooleanType::get()],
6161
'4 < 2' => ['4 < 2', BooleanType::get()],
6262
'4 <= 2' => ['4 <= 2', BooleanType::get()],
63+
64+
'true && true && true' => ['true && true && true', BooleanType::get()],
65+
'1 === 1 === true' => ['1 === 1 === true', BooleanType::get()],
66+
'1 + 1 + 1' => ['1 + 1 + 1', NumberType::get()],
6367
];
6468
}
6569

0 commit comments

Comments
 (0)