summaryrefslogtreecommitdiffstats
path: root/tests/lib/Security
diff options
context:
space:
mode:
authorCôme Chilliet <come.chilliet@nextcloud.com>2022-08-29 16:36:40 +0200
committerCôme Chilliet <come.chilliet@nextcloud.com>2022-08-29 16:36:40 +0200
commit6f80fe6ada68cee35e714568afeb614238fbc241 (patch)
treeeec7e8eb3742ec0e6b0463c290cb0cf146affca7 /tests/lib/Security
parent791e0214556c353d9c3ac9b2c54e465588c6af67 (diff)
downloadnextcloud-server-6f80fe6ada68cee35e714568afeb614238fbc241.tar.gz
nextcloud-server-6f80fe6ada68cee35e714568afeb614238fbc241.zip
Remove deprecated at matcher from tests/lib
Only 15 warnings left in there Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Diffstat (limited to 'tests/lib/Security')
-rw-r--r--tests/lib/Security/CertificateManagerTest.php2
-rw-r--r--tests/lib/Security/IdentityProof/ManagerTest.php48
2 files changed, 25 insertions, 25 deletions
diff --git a/tests/lib/Security/CertificateManagerTest.php b/tests/lib/Security/CertificateManagerTest.php
index b1659d1096d..fdc6b40533e 100644
--- a/tests/lib/Security/CertificateManagerTest.php
+++ b/tests/lib/Security/CertificateManagerTest.php
@@ -163,7 +163,7 @@ class CertificateManagerTest extends \Test\TestCase {
$certificateManager->expects($this->any())->method('getFilemtimeOfCaBundle')
->willReturn($CaBundleMtime);
- $certificateManager->expects($this->at(0))->method('getCertificateBundle')
+ $certificateManager->expects($this->once())->method('getCertificateBundle')
->willReturn('targetBundlePath');
$view->expects($this->any())->method('file_exists')
diff --git a/tests/lib/Security/IdentityProof/ManagerTest.php b/tests/lib/Security/IdentityProof/ManagerTest.php
index 968cfa633ca..8733d5de8be 100644
--- a/tests/lib/Security/IdentityProof/ManagerTest.php
+++ b/tests/lib/Security/IdentityProof/ManagerTest.php
@@ -117,15 +117,16 @@ class ManagerTest extends TestCase {
->with('EncryptedPrivateKey')
->willReturn('MyPrivateKey');
$folder
- ->expects($this->at(0))
+ ->expects($this->exactly(2))
->method('getFile')
- ->with('private')
- ->willReturn($privateFile);
- $folder
- ->expects($this->at(1))
- ->method('getFile')
- ->with('public')
- ->willReturn($publicFile);
+ ->withConsecutive(
+ ['private'],
+ ['public']
+ )
+ ->willReturnOnConsecutiveCalls(
+ $privateFile,
+ $publicFile
+ );
$this->appData
->expects($this->once())
->method('getFolder')
@@ -142,17 +143,12 @@ class ManagerTest extends TestCase {
->expects($this->once())
->method('getUID')
->willReturn('MyUid');
- $this->appData
- ->expects($this->at(0))
- ->method('getFolder')
- ->with('user-MyUid')
- ->willThrowException(new \Exception());
$this->manager
->expects($this->once())
->method('generateKeyPair')
->willReturn(['MyNewPublicKey', 'MyNewPrivateKey']);
$this->appData
- ->expects($this->at(1))
+ ->expects($this->once())
->method('newFolder')
->with('user-MyUid');
$folder = $this->createMock(ISimpleFolder::class);
@@ -172,20 +168,24 @@ class ManagerTest extends TestCase {
->method('putContent')
->with('MyNewPublicKey');
$folder
- ->expects($this->at(0))
- ->method('newFile')
- ->with('private')
- ->willReturn($privateFile);
- $folder
- ->expects($this->at(1))
+ ->expects($this->exactly(2))
->method('newFile')
- ->with('public')
- ->willReturn($publicFile);
+ ->withConsecutive(
+ ['private'],
+ ['public']
+ )
+ ->willReturnOnConsecutiveCalls(
+ $privateFile,
+ $publicFile
+ );
$this->appData
- ->expects($this->at(2))
+ ->expects($this->exactly(2))
->method('getFolder')
->with('user-MyUid')
- ->willReturn($folder);
+ ->willReturnOnConsecutiveCalls(
+ $this->throwException(new \Exception()),
+ $folder
+ );
$expected = new Key('MyNewPublicKey', 'MyNewPrivateKey');