Skip to content
This repository was archived by the owner on Nov 5, 2022. It is now read-only.

Commit dda9084

Browse files
committed
Boolean or unit tests
1 parent 1ebedbe commit dda9084

File tree

3 files changed

+13
-5
lines changed

3 files changed

+13
-5
lines changed
Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<?php
22

3-
if ($a === $b or $a === $c) {} // Fail
4-
if ($a === $b || $a === $c) {} // Pass
5-
if ($a === 1 or $a === 2 or $a === 3) {} // Fail 2 errors
3+
if ($a OR $b === $c) {} // Fail
4+
if ($a === $b OR $c) {} // Fail
5+
if ($a === $b OR $a === $c) {} // Fail
6+
if ($a === 1 or $a === 2 OR $a === 3) {} // Fail 2 errors
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?php
2+
3+
if ($a || $b === $c) {} // Fail
4+
if ($a === $b || $c) {} // Fail
5+
if ($a === $b || $a === $c) {} // Fail
6+
if ($a === 1 || $a === 2 || $a === 3) {} // Fail 2 errors

CodeIgniter4/Tests/Operators/BooleanOrUnitTest.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,9 @@ public function getErrorList()
2828
{
2929
return array(
3030
3 => 1,
31-
4 => 0,
32-
5 => 2,
31+
4 => 1,
32+
5 => 1,
33+
6 => 2,
3334
);
3435

3536
}//end getErrorList()

0 commit comments

Comments
 (0)