normalizeRequest( [], [ 'p1' => ['READ', 'WRITE'], 'p2' => ['READ'], 'p3' => ['READ', 'WRITE'], ] ); $this->assertEquals( [ 'add' => [ 'p1' => ['READ', 'WRITE'], 'p2' => ['READ'], 'p3' => ['READ', 'WRITE'], ] ], $result ); } public function testGetPermissionsToAdd(): void { $strategy = new SyncPermissionsStrategy(); $result = $strategy->getPermissionsToAdd( [ 'p2' => ['READ'], 'p3' => ['READ', 'WRITE'], ], [ 'add' => [ 'p1' => ['READ', 'WRITE'], 'p2' => ['READ', 'GRANT'], 'p3' => ['READ',], ] ] ); $this->assertEquals( [ 'p1' => ['READ', 'WRITE'], 'p2' => ['GRANT'], ], $result ); } public function testGetPermissionsToRemove(): void { $strategy = new SyncPermissionsStrategy(); $result = $strategy->getPermissionsToRemove( [ 'p2' => ['READ'], 'p3' => ['READ', 'WRITE'], ], [ 'add' => [ 'p1' => ['READ', 'WRITE'], 'p2' => ['READ', 'GRANT'], 'p3' => ['READ',], ] ] ); $this->assertEquals( [ 'p3' => ['WRITE',], ], $result ); } }