Skip to content

Commit 6714a86

Browse files
committed
adding test
1 parent 1a6ee26 commit 6714a86

3 files changed

Lines changed: 20 additions & 2 deletions

File tree

php-unit/tests/JsonTest.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,11 @@ class JsonTest extends TestCase
99
{
1010
use JsonAssertions;
1111

12-
public function testIfTrue()
12+
public function testIfJsonStringEqualsWithJsonString()
1313
{
14-
$this->assertTrue(true);
14+
$this->assertJsonStringEqualsJsonString(
15+
json_encode(['name' => 'John Doe']),
16+
json_encode(['name' => 'John Doe'])
17+
);
1518
}
1619
}

php-unit/tests/MiscellaneousTest.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,9 @@ public function testIfIsScalar()
4242
// Test if is not scalar type like (object, iterable, resource etc)
4343
$this->assertIsScalar(true);
4444
}
45+
46+
public function testIfNull()
47+
{
48+
$this->assertNull(null);
49+
}
4550
}

php-unit/tests/NumberTest.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,14 @@ public function testIfIsNumeric()
4242
// Failure if is not numeric number
4343
$this->assertIsNumeric(1000);
4444
}
45+
46+
public function testIfNumberLessThan()
47+
{
48+
$this->assertLessThan(10, 9);
49+
}
50+
51+
public function testIfNumberLessThanOrEqual()
52+
{
53+
$this->assertLessThanOrEqual(1000, 1000);
54+
}
4555
}

0 commit comments

Comments
 (0)