fix: phpunit

Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
pull/34178/head
John Molakvoæ 4 months ago
parent 9593f4d6f9
commit 4a509dfe8e
No known key found for this signature in database
GPG Key ID: 60C25B8C072916CF

@ -459,7 +459,7 @@ class FederatedShareProviderTest extends \Test\TestCase {
try {
$this->provider->create($share);
} catch (\Exception $e) {
$this->assertEquals('Sharing myFile failed, because this item is already shared with account user@server.com', $e->getMessage());
$this->assertEquals('Sharing myFile failed, because this item is already shared with the account user@server.com', $e->getMessage());
}
}

@ -1679,7 +1679,7 @@ class ShareAPIControllerTest extends TestCase {
public function testCreateShareUserNoShareWith() {
$this->expectException(\OCP\AppFramework\OCS\OCSNotFoundException::class);
$this->expectExceptionMessage('Please specify a valid person to share with');
$this->expectExceptionMessage('Please specify a valid account to share with');
$share = $this->newShare();
$this->shareManager->method('newShare')->willReturn($share);
@ -1707,7 +1707,7 @@ class ShareAPIControllerTest extends TestCase {
public function testCreateShareUserNoValidShareWith() {
$this->expectException(\OCP\AppFramework\OCS\OCSNotFoundException::class);
$this->expectExceptionMessage('Please specify a valid person to share with');
$this->expectExceptionMessage('Please specify a valid account to share with');
$share = $this->newShare();
$this->shareManager->method('newShare')->willReturn($share);

@ -116,8 +116,8 @@ class ShareByMailProvider implements IShareProvider {
*/
$alreadyShared = $this->getSharedWith($shareWith, IShare::TYPE_EMAIL, $share->getNode(), 1, 0);
if (!empty($alreadyShared)) {
$message = 'Sharing %1$s failed, because this item is already shared with account %2$s';
$message_t = $this->l->t('Sharing %1$s failed, because this item is already shared with account %2$s', [$share->getNode()->getName(), $shareWith]);
$message = 'Sharing %1$s failed, because this item is already shared with the account %2$s';
$message_t = $this->l->t('Sharing %1$s failed, because this item is already shared with the account %2$s', [$share->getNode()->getName(), $shareWith]);
$this->logger->debug(sprintf($message, $share->getNode()->getName(), $shareWith), ['app' => 'Federated File Sharing']);
throw new \Exception($message_t);
}

@ -64,7 +64,7 @@ class ProfileApiController extends OCSController {
* @return DataResponse<Http::STATUS_OK, array<empty>, array{}>
* @throws OCSBadRequestException Updating visibility is not possible
* @throws OCSForbiddenException Not allowed to edit other users visibility
* @throws OCSNotFoundException User not found
* @throws OCSNotFoundException Account not found
*
* 200: Visibility updated successfully
*/

@ -578,7 +578,7 @@ class Manager implements IManager {
// Identical share already exists
if ($existingShare->getSharedWith() === $share->getSharedWith() && $existingShare->getShareType() === $share->getShareType()) {
$message = $this->l->t('Sharing %s failed, because this item is already shared with account %s', [$share->getNode()->getName(), $share->getSharedWithDisplayName()]);
$message = $this->l->t('Sharing %s failed, because this item is already shared with the account %s', [$share->getNode()->getName(), $share->getSharedWithDisplayName()]);
throw new AlreadySharedException($message, $existingShare);
}
@ -589,7 +589,7 @@ class Manager implements IManager {
$user = $this->userManager->get($share->getSharedWith());
if ($group->inGroup($user) && $existingShare->getShareOwner() !== $share->getShareOwner()) {
$message = $this->l->t('Sharing %s failed, because this item is already shared with account %s', [$share->getNode()->getName(), $share->getSharedWithDisplayName()]);
$message = $this->l->t('Sharing %s failed, because this item is already shared with the account %s', [$share->getNode()->getName(), $share->getSharedWithDisplayName()]);
throw new AlreadySharedException($message, $existingShare);
}
}

@ -196,7 +196,7 @@ class OCSControllerTest extends TestCase {
->with('NotExistingUser')
->willReturn(null);
$expected = new DataResponse(['User not found'], 404);
$expected = new DataResponse(['Account not found'], 404);
$this->assertEquals($expected, $this->controller->getIdentityProof('NotExistingUser'));
}

@ -1618,7 +1618,7 @@ class ManagerTest extends \Test\TestCase {
public function testUserCreateChecksIdenticalShareExists() {
$this->expectException(AlreadySharedException::class);
$this->expectExceptionMessage('Sharing name.txt failed, because this item is already shared with account user');
$this->expectExceptionMessage('Sharing name.txt failed, because this item is already shared with the account user');
$share = $this->manager->newShare();
$share->setSharedWithDisplayName('user');
@ -1647,7 +1647,7 @@ class ManagerTest extends \Test\TestCase {
public function testUserCreateChecksIdenticalPathSharedViaGroup() {
$this->expectException(AlreadySharedException::class);
$this->expectExceptionMessage('Sharing name2.txt failed, because this item is already shared with account userName');
$this->expectExceptionMessage('Sharing name2.txt failed, because this item is already shared with the account userName');
$share = $this->manager->newShare();

Loading…
Cancel
Save