File tree Expand file tree Collapse file tree 1 file changed +41
-0
lines changed
Expand file tree Collapse file tree 1 file changed +41
-0
lines changed Original file line number Diff line number Diff line change 1+ <?php
2+
3+ declare (strict_types=1 );
4+
5+ namespace Jet \Tests \Unit ;
6+
7+ use Jet \JsonDiff \JsonDiff ;
8+ use PHPUnit \Framework \TestCase ;
9+
10+ class JsonDiffTest extends TestCase
11+ {
12+ public function test_get_number_of_changes (): void
13+ {
14+ $ jsonDiff = new JsonDiff ([], []);
15+ $ this ->assertSame (
16+ 0 ,
17+ $ jsonDiff ->getNumberOfChanges ()
18+ );
19+
20+ $ jsonDiff = new JsonDiff (
21+ ["apple " ],
22+ ["orange " ]
23+ );
24+ $ this ->assertSame (
25+ 1 ,
26+ $ jsonDiff ->getNumberOfChanges ()
27+ );
28+
29+ $ jsonDiff ->addAddedKey ('' , '0 ' , 'a string ' );
30+ $ this ->assertSame (
31+ 2 ,
32+ $ jsonDiff ->getNumberOfChanges ()
33+ );
34+
35+ $ jsonDiff ->addRemovedKey ('' , '0 ' , 'a string ' );
36+ $ this ->assertSame (
37+ 3 ,
38+ $ jsonDiff ->getNumberOfChanges ()
39+ );
40+ }
41+ }
You can’t perform that action at this time.
0 commit comments