@@ -100,6 +100,13 @@ public function testAddArrayOfKeyValuePairs()
100100 $ this ->assertSame (['foobar ' => 'baz ' , 'corge ' => 'grault ' ], $ dot ->all ());
101101 }
102102
103+ public function testAddReturnsDot ()
104+ {
105+ $ dot = new Dot ;
106+
107+ $ this ->assertInstanceOf (Dot::class, $ dot ->add ('foo ' , 'bar ' ));
108+ }
109+
103110 /*
104111 * --------------------------------------------------------------
105112 * All
@@ -151,6 +158,13 @@ public function testClearAll()
151158 $ this ->assertSame ([], $ dot ->all ());
152159 }
153160
161+ public function testClearReturnsDot ()
162+ {
163+ $ dot = new Dot ();
164+
165+ $ this ->assertInstanceOf (Dot::class, $ dot ->clear ());
166+ }
167+
154168 /*
155169 * --------------------------------------------------------------
156170 * Delete
@@ -181,6 +195,13 @@ public function testDeleteArrayOfKeys()
181195 $ this ->assertSame ([], $ dot ->all ());
182196 }
183197
198+ public function testDeleteReturnsDot ()
199+ {
200+ $ dot = new Dot (['foo ' => 'bar ' ]);
201+
202+ $ this ->assertInstanceOf (Dot::class, $ dot ->clear ('foo ' ));
203+ }
204+
184205 /*
185206 * --------------------------------------------------------------
186207 * Flatten
@@ -343,6 +364,13 @@ public function testMergeDotObjectWithKey()
343364 $ this ->assertEquals ('qux ' , $ dot1 ->get ('foo.bar ' ));
344365 }
345366
367+ public function testMergeReturnsDot ()
368+ {
369+ $ dot = new Dot (['foo ' => ['bar ' => 'baz ' ]]);
370+
371+ $ this ->assertInstanceOf (Dot::class, $ dot ->merge (['foo ' => ['bar ' => 'qux ' ]]));
372+ }
373+
346374 /*
347375 * --------------------------------------------------------------
348376 * Recursive merge
@@ -387,6 +415,16 @@ public function testRecursiveMergeDotObjectWithKey()
387415 $ this ->assertEquals ('quuz ' , $ dot1 ->get ('foo.quux ' ));
388416 }
389417
418+ public function testRecursiveMergeReturnsDot ()
419+ {
420+ $ dot = new Dot (['foo ' => ['bar ' => 'baz ' ]]);
421+
422+ $ this ->assertInstanceOf (
423+ Dot::class,
424+ $ dot ->mergeRecursive (['foo ' => ['bar ' => 'qux ' , 'quux ' => 'quuz ' ]])
425+ );
426+ }
427+
390428 /*
391429 * --------------------------------------------------------------
392430 * Recursive distinct merge
@@ -431,6 +469,16 @@ public function testRecursiveDistinctMergeDotObjectWithKey()
431469 $ this ->assertEquals ('quuz ' , $ dot1 ->get ('foo.quux ' ));
432470 }
433471
472+ public function testRecursivDistincteMergeReturnsDot ()
473+ {
474+ $ dot = new Dot (['foo ' => ['bar ' => 'baz ' ]]);
475+
476+ $ this ->assertInstanceOf (
477+ Dot::class,
478+ $ dot ->mergeRecursiveDistinct (['foo ' => ['bar ' => 'qux ' , 'quux ' => 'quuz ' ]])
479+ );
480+ }
481+
434482 /*
435483 * --------------------------------------------------------------
436484 * Pull
@@ -489,6 +537,13 @@ public function testPushValueToKey()
489537 $ this ->assertSame (['bar ' , 'baz ' ], $ dot ->get ('foo ' ));
490538 }
491539
540+ public function testPushReturnsDot ()
541+ {
542+ $ dot = $ dot = new Dot ();
543+
544+ $ this ->assertInstanceOf (Dot::class, $ dot ->push ('foo ' ));
545+ }
546+
492547 /*
493548 * --------------------------------------------------------------
494549 * Replace
@@ -529,6 +584,13 @@ public function testReplaceKeyWithDot()
529584 $ this ->assertEquals (['bar ' => 'baz ' , 'qux ' => 'corge ' ], $ dot1 ->get ('foo ' ));
530585 }
531586
587+ public function testReplaceReturnsDot ()
588+ {
589+ $ dot = new Dot (['foo ' => ['bar ' => 'baz ' ]]);
590+
591+ $ this ->assertInstanceOf (Dot::class, $ dot ->replace (['foo ' => ['qux ' => 'quux ' ]]));
592+ }
593+
532594 /*
533595 * --------------------------------------------------------------
534596 * Set
@@ -551,6 +613,13 @@ public function testSetArrayOfKeyValuePairs()
551613 $ this ->assertSame (['foo ' => 'bar ' , 'baz ' => 'qux ' ], $ dot ->all ());
552614 }
553615
616+ public function testSetReturnsDot ()
617+ {
618+ $ dot = new Dot ();
619+
620+ $ this ->assertInstanceOf (Dot::class, $ dot ->set ('foo.bar ' , 'baz ' ));
621+ }
622+
554623 /*
555624 * --------------------------------------------------------------
556625 * Set array
@@ -565,6 +634,13 @@ public function testSetArray()
565634 $ this ->assertSame (['foo ' => 'bar ' ], $ dot ->all ());
566635 }
567636
637+ public function testSetArrayReturnsDot ()
638+ {
639+ $ dot = new Dot ();
640+
641+ $ this ->assertInstanceOf (Dot::class, $ dot ->setArray (['foo ' => 'bar ' ]));
642+ }
643+
568644 /*
569645 * --------------------------------------------------------------
570646 * Set reference
@@ -581,6 +657,14 @@ public function testSetReference()
581657 $ this ->assertEquals ('baz ' , $ items ['foo ' ]);
582658 }
583659
660+ public function testSetReferenceReturnsDot ()
661+ {
662+ $ dot = new Dot ();
663+ $ items = ['foo ' => 'bar ' ];
664+
665+ $ this ->assertInstanceOf (Dot::class, $ dot ->setReference ($ items ));
666+ }
667+
584668 /*
585669 * --------------------------------------------------------------
586670 * ArrayAccess interface
0 commit comments