service = new Service($this->createMock(SharingMapper::class)); } public function testHasGroupShare(): void { $oldShares = [ [ 'href' => 'principal:principals/groups/bob', 'commonName' => 'bob', 'status' => 1, 'readOnly' => true, '{http://owncloud.org/ns}principal' => 'principals/groups/bob', '{http://owncloud.org/ns}group-share' => true, ], [ 'href' => 'principal:principals/users/bob', 'commonName' => 'bob', 'status' => 1, 'readOnly' => true, '{http://owncloud.org/ns}principal' => 'principals/users/bob', '{http://owncloud.org/ns}group-share' => false, ] ]; $this->assertTrue($this->service->hasGroupShare($oldShares)); $oldShares = [ [ 'href' => 'principal:principals/users/bob', 'commonName' => 'bob', 'status' => 1, 'readOnly' => true, '{http://owncloud.org/ns}principal' => 'principals/users/bob', '{http://owncloud.org/ns}group-share' => false, ] ]; $this->assertFalse($this->service->hasGroupShare($oldShares)); } }