Skip to content

Commit bed843f

Browse files
committed
Update JsonTest.php
1 parent 2a88653 commit bed843f

1 file changed

Lines changed: 26 additions & 0 deletions

File tree

tests/webfiori/tests/json/JsonTest.php

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -828,6 +828,32 @@ public function testAdd10() {
828828
$this->assertEquals(1, count($j->getPropsNames()));
829829
$this->assertNull($j->get('one'));
830830
}
831+
/**
832+
* @test
833+
*/
834+
public function testAddNull00() {
835+
$j = new Json();
836+
$this->assertTrue($j->addNull('null'));
837+
$this->assertNull($j->get('null'));
838+
}
839+
/**
840+
* @test
841+
*/
842+
public function testAddNull01() {
843+
$j = new Json();
844+
$this->expectException(\InvalidArgumentException::class);
845+
$this->assertTrue($j->addNull(' '));
846+
}
847+
/**
848+
* @test
849+
*/
850+
public function testAddNull02() {
851+
$j = new Json();
852+
$j->addString('not-null', 'Hello');
853+
$this->assertEquals('Hello', $j->get('not-null'));
854+
$this->assertTrue($j->addNull('not-null'));
855+
$this->assertNull($j->get('not-null'));
856+
}
831857
/**
832858
* @test
833859
*/

0 commit comments

Comments
 (0)