File tree Expand file tree Collapse file tree
tests/webfiori/tests/json Expand file tree Collapse file tree Original file line number Diff line number Diff 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 */
You can’t perform that action at this time.
0 commit comments