/** * @dataProvider dataPropPatch */ public function testPropPatch($mutations, $throws) { /** @var \PHPUnit_Framework_MockObject_MockObject | CalDavBackend $backend */ $backend = $this->getMockBuilder('OCA\\DAV\\CalDAV\\CalDavBackend')->disableOriginalConstructor()->getMock(); $calendarInfo = ['{http://owncloud.org/ns}owner-principal' => 'user1', 'principaluri' => 'user2', 'id' => 666]; $c = new Calendar($backend, $calendarInfo); if ($throws) { $this->setExpectedException('\\Sabre\\DAV\\Exception\\Forbidden'); } $c->propPatch(new PropPatch($mutations)); if (!$throws) { $this->assertTrue(true); } }