diff --git a/apps/dav/tests/unit/Migration/ClassificationTest.php b/apps/dav/tests/unit/Migration/ClassificationTest.php index 1960fa031e196..f1478b9c0b47e 100644 --- a/apps/dav/tests/unit/Migration/ClassificationTest.php +++ b/apps/dav/tests/unit/Migration/ClassificationTest.php @@ -62,4 +62,50 @@ public function test() { $object = $this->backend->getCalendarObject($calendarId, $eventUri); $this->assertEquals(CalDavBackend::CLASSIFICATION_PUBLIC, $object['classification']); } + + /** copy of test() with a specific failing data set */ + public function testMigration() { + // setup data + $calendarId = $this->createTestCalendar(); + + $calData = <<getUniqueID('event'); + + $this->dispatcher->expects($this->at(0)) + ->method('dispatch') + ->with('\OCA\DAV\CalDAV\CalDavBackend::createCalendarObject'); + + $this->backend->createCalendarObject($calendarId, $eventUri, $calData); + + // run migration + $c = new Classification($this->backend, $this->userManager); + + /** @var IUser | \PHPUnit_Framework_MockObject_MockObject $user */ + $user = $this->getMockBuilder('OCP\IUser') + ->disableOriginalConstructor() + ->getMock(); + $user->expects($this->once())->method('getUID')->willReturn('caldav-unit-test'); + + $c->runForUser($user); + } }