File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -58,4 +58,11 @@ public function testIfEmpty()
5858 // This success
5959 $ this ->assertEmpty ([]);
6060 }
61+
62+ public function testIfIsArray ()
63+ {
64+ // Failure if is not array
65+ $ array = [1 ,2 ,3 ,4 ,5 ];
66+ $ this ->assertIsArray ($ array );
67+ }
6168}
Original file line number Diff line number Diff line change @@ -59,4 +59,10 @@ public function testIfObjectEqualsWithAnotherObject()
5959 // This success
6060 $ this ->assertObjectEquals ($ user1 , $ user2 );
6161 }
62+
63+ public function testIfInstanceOf ()
64+ {
65+ // Success if class instance of parent class
66+ $ this ->assertInstanceOf (Exception::class, new RedisException );
67+ }
6268}
Original file line number Diff line number Diff line change @@ -14,4 +14,20 @@ public function testIfFalse()
1414 // Success
1515 $ this ->assertFalse (false );
1616 }
17+
18+ public function testIfIsBoolean ()
19+ {
20+ // Failure if is not boolean
21+ $ this ->assertIsBool (true );
22+ }
23+
24+ public function testIfIsCallable ()
25+ {
26+ // Failure if is not callable
27+ $ func = function () {
28+ return "Hello World " ;
29+ };
30+
31+ $ this ->assertIsCallable ($ func );
32+ }
1733}
Original file line number Diff line number Diff line change 44
55use PHPUnit \Framework \TestCase ;
66
7- class IntegerTest extends TestCase
7+ class NumberTest extends TestCase
88{
99 public function testIfGreaterThan ()
1010 {
@@ -24,4 +24,16 @@ public function testIfNumberGreaterThanOrEqual()
2424 $ this ->assertGreaterThanOrEqual (10 , 10 );
2525 $ this ->assertGreaterThanOrEqual (100 , 1000 );
2626 }
27+
28+ public function testIfIsFloatingNumber ()
29+ {
30+ // Failure if is not float
31+ $ this ->assertIsFloat (1.5 );
32+ }
33+
34+ public function testIfIsIntegerNumber ()
35+ {
36+ // Failure if is not integer
37+ $ this ->assertIsInt (100 );
38+ }
2739}
You can’t perform that action at this time.
0 commit comments