diff --git a/tests/unit/Service/CardServiceTest.php b/tests/unit/Service/CardServiceTest.php index 74f4ee0bf..65fc67257 100644 --- a/tests/unit/Service/CardServiceTest.php +++ b/tests/unit/Service/CardServiceTest.php @@ -151,7 +151,7 @@ class CardServiceTest extends TestCase { $card->setArchived(true); $this->cardMapper->expects($this->once())->method('find')->willReturn($card); $this->cardMapper->expects($this->never())->method('update'); - $this->setExpectedException(StatusException::class); + $this->expectException(StatusException::class); $this->cardService->update(123, 'newtitle', 234, 'text', 999, 'foo', 'admin', '2017-01-01 00:00:00', null); } @@ -171,7 +171,7 @@ class CardServiceTest extends TestCase { $card->setArchived(true); $this->cardMapper->expects($this->once())->method('find')->willReturn($card); $this->cardMapper->expects($this->never())->method('update'); - $this->setExpectedException(StatusException::class); + $this->expectException(StatusException::class); $this->cardService->rename(123, 'newtitle'); } @@ -211,7 +211,7 @@ class CardServiceTest extends TestCase { $card->setArchived(true); $this->cardMapper->expects($this->once())->method('findAll')->willReturn([$card]); $this->cardMapper->expects($this->never())->method('update')->willReturnCallback(function($c) { return $c; }); - $this->setExpectedException(StatusException::class); + $this->expectException(StatusException::class); $actual = $this->cardService->reorder(123, 234, 1); } public function testArchive() { @@ -247,7 +247,7 @@ class CardServiceTest extends TestCase { $card->setArchived(true); $this->cardMapper->expects($this->once())->method('find')->willReturn($card); $this->cardMapper->expects($this->never())->method('assignLabel'); - $this->setExpectedException(StatusException::class); + $this->expectException(StatusException::class); $this->cardService->assignLabel(123, 999); } @@ -263,8 +263,8 @@ class CardServiceTest extends TestCase { $card = new Card(); $card->setArchived(true); $this->cardMapper->expects($this->once())->method('find')->willReturn($card); - $this->cardMapper->expects($this->never())->method('removeLabel'); - $this->setExpectedException(StatusException::class); + $this->cardMapper->expects($this->never())->method('removeLabel'); + $this->expectException(StatusException::class); $this->cardService->removeLabel(123, 999); } @@ -320,7 +320,10 @@ class CardServiceTest extends TestCase { } /** - * @expectedException \OCA\Deck\NotFoundException + * @expectException \OCA\Deck\NotFoundException + * + * + * */ public function testUnassignUserNotExisting() { $assignment = new AssignedUsers(); diff --git a/tests/unit/Service/PermissionServiceTest.php b/tests/unit/Service/PermissionServiceTest.php index f4c2f41ec..432c794aa 100644 --- a/tests/unit/Service/PermissionServiceTest.php +++ b/tests/unit/Service/PermissionServiceTest.php @@ -231,7 +231,7 @@ class PermissionServiceTest extends \Test\TestCase { $actual = $this->service->checkPermission($mapper, 1234, $permission); $this->assertTrue($actual); } else { - $this->setExpectedException(NoPermissionException::class); + $this->expectException(NoPermissionException::class); $this->service->checkPermission($mapper, 1234, $permission); } @@ -255,7 +255,7 @@ class PermissionServiceTest extends \Test\TestCase { $actual = $this->service->checkPermission($mapper, 1234, $permission); $this->assertTrue($actual); } else { - $this->setExpectedException(NoPermissionException::class); + $this->expectException(NoPermissionException::class); $this->service->checkPermission($mapper, 1234, $permission); } @@ -263,8 +263,8 @@ class PermissionServiceTest extends \Test\TestCase { public function testCheckPermissionNotFound() { $mapper = $this->getMockBuilder(IPermissionMapper::class)->getMock(); - $mapper->expects($this->once())->method('findBoardId')->willThrowException(new NoPermissionException(null)); - $this->setExpectedException(NoPermissionException::class); + $mapper->expects($this->once())->method('findBoardId')->willThrowException(new NoPermissionException(null)); + $this->expectException(NoPermissionException::class); $this->service->checkPermission($mapper, 1234, Acl::PERMISSION_READ); }