diff --git a/tests/Unit/Handler/Pkcs12HandlerTest.php b/tests/Unit/Handler/Pkcs12HandlerTest.php index 16381eacae..5680f3c86a 100644 --- a/tests/Unit/Handler/Pkcs12HandlerTest.php +++ b/tests/Unit/Handler/Pkcs12HandlerTest.php @@ -53,7 +53,7 @@ public function testSavePfxWhenPfxFileIsAFolder() { $node->method('get')->will($this->returnValue($node)); $this->folderService->method('getFolder')->will($this->returnValue($node)); - $this->expectErrorMessage('path signature.pfx already exists and is not a file!'); + $this->expectExceptionMessage('path signature.pfx already exists and is not a file!'); $this->pkcs12Handler->savePfx('userId', 'content'); } @@ -72,7 +72,7 @@ public function testGetPfxWithInvalidPfx() { $node = $this->createMock(\OCP\Files\Folder::class); $node->method('nodeExists')->will($this->returnValue(false)); $this->folderService->method('getFolder')->will($this->returnValue($node)); - $this->expectErrorMessage('Password to sign not defined. Create a password to sign'); + $this->expectExceptionMessage('Password to sign not defined. Create a password to sign'); $this->expectExceptionCode(400); $this->pkcs12Handler->getPfx('userId'); } diff --git a/tests/Unit/Service/AccountServiceTest.php b/tests/Unit/Service/AccountServiceTest.php index 0fc18830d5..659c805802 100644 --- a/tests/Unit/Service/AccountServiceTest.php +++ b/tests/Unit/Service/AccountServiceTest.php @@ -384,7 +384,7 @@ public function testCreateToSignWithErrorInSendingEmail() { $this->newUserMail->method('sendMail')->will($this->returnCallback(function () { throw new \Exception("Error Processing Request", 1); })); - $this->expectErrorMessage('Unable to send the invitation'); + $this->expectExceptionMessage('Unable to send the invitation'); $this->getService()->createToSign('uuid', 'username', 'passwordOfUser', 'passwordToSign'); } diff --git a/tests/Unit/Service/FolderServiceTest.php b/tests/Unit/Service/FolderServiceTest.php index 06fe6dcda0..9b96ad2456 100644 --- a/tests/Unit/Service/FolderServiceTest.php +++ b/tests/Unit/Service/FolderServiceTest.php @@ -29,7 +29,7 @@ public function testGetFolderWithInvalidNodeId() { $l10n, 171 ); - $this->expectErrorMessage('Invalid node'); + $this->expectExceptionMessage('Invalid node'); $service->getFolder(171); } @@ -51,7 +51,6 @@ public function testGetFolderWithValidNodeId() { $l10n, 1 ); - $this->getExpectedExceptionMessage('Invalid node'); $actual = $service->getFolder(171); $this->assertInstanceOf(\OCP\Files\Folder::class, $actual); } diff --git a/tests/Unit/Service/PdfParseServiceTest.php b/tests/Unit/Service/PdfParseServiceTest.php index 9abd3c833f..bc56eec1fb 100644 --- a/tests/Unit/Service/PdfParseServiceTest.php +++ b/tests/Unit/Service/PdfParseServiceTest.php @@ -34,7 +34,7 @@ private function getService(): PdfParserService { */ public function testGetMetadataWithFail(string $path, string $errorMessage): void { $this->expectException(LibresignException::class); - $this->expectErrorMessageMatches($errorMessage); + $this->expectExceptionMessageMatches($errorMessage); $file = $this->createMock(File::class); if (file_exists($path)) { $file->method('getContent') diff --git a/tests/Unit/Service/SignFileServiceTest.php b/tests/Unit/Service/SignFileServiceTest.php index df07c8bd8d..f957cae0b1 100644 --- a/tests/Unit/Service/SignFileServiceTest.php +++ b/tests/Unit/Service/SignFileServiceTest.php @@ -119,7 +119,7 @@ public function testCanDeleteRequestSignatureWhenDocumentAlreadySigned() { ['getSigned', [], '2021-01-01 01:01:01'], ])); $this->fileUserMapper->method('getByFileUuid')->will($this->returnValue([$fileUser])); - $this->expectErrorMessage('Document already signed'); + $this->expectExceptionMessage('Document already signed'); $this->getService()->canDeleteRequestSignature(['uuid' => 'valid']); } @@ -139,7 +139,7 @@ public function testCanDeleteRequestSignatureWhenNoSignatureWasRequested() { ['getEmail', [], 'otheremail@test.coop'] ])); $this->fileUserMapper->method('getByFileUuid')->will($this->returnValue([$fileUser])); - $this->expectErrorMessage('No signature was requested to %'); + $this->expectExceptionMessage('No signature was requested to %'); $this->getService()->canDeleteRequestSignature([ 'uuid' => 'valid', 'users' => [ @@ -161,7 +161,7 @@ public function testNotifyCallback() { } public function testSignWithFileNotFound() { - $this->expectErrorMessage('File not found'); + $this->expectExceptionMessage('File not found'); $this->createUser('username', 'password');