Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Wurst <christoph@winzerhof-wurst.at>2020-04-10 17:51:06 +0300
committerChristoph Wurst <christoph@winzerhof-wurst.at>2020-04-10 17:51:06 +0300
commit1584c9ae9c23d2a7915750ef9203cba0bcebf766 (patch)
tree568db931f631afd6e96772cf2b3ac539c989ec42 /tests/lib/Security
parenta7c8d26d31cb1cf69e0e060c53622e545fcfbbb3 (diff)
Add visibility to all methods and position of static keyword
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'tests/lib/Security')
-rw-r--r--tests/lib/Security/CertificateManagerTest.php16
-rw-r--r--tests/lib/Security/CertificateTest.php2
-rw-r--r--tests/lib/Security/CryptoTest.php10
-rw-r--r--tests/lib/Security/SecureRandomTest.php6
4 files changed, 17 insertions, 17 deletions
diff --git a/tests/lib/Security/CertificateManagerTest.php b/tests/lib/Security/CertificateManagerTest.php
index 6a93657f8c8..d64c41c79e7 100644
--- a/tests/lib/Security/CertificateManagerTest.php
+++ b/tests/lib/Security/CertificateManagerTest.php
@@ -76,7 +76,7 @@ class CertificateManagerTest extends \Test\TestCase {
$this->assertEquals($expected, $actual);
}
- function testListCertificates() {
+ public function testListCertificates() {
// Test empty certificate bundle
$this->assertSame([], $this->certificateManager->listCertificates());
@@ -93,7 +93,7 @@ class CertificateManagerTest extends \Test\TestCase {
}
- function testAddInvalidCertificate() {
+ public function testAddInvalidCertificate() {
$this->expectException(\Exception::class);
$this->expectExceptionMessage('Certificate could not get parsed.');
@@ -115,23 +115,23 @@ class CertificateManagerTest extends \Test\TestCase {
* @dataProvider dangerousFileProvider
* @param string $filename
*/
- function testAddDangerousFile($filename) {
+ public function testAddDangerousFile($filename) {
$this->expectException(\Exception::class);
$this->expectExceptionMessage('Filename is not valid');
$this->certificateManager->addCertificate(file_get_contents(__DIR__ . '/../../data/certificates/expiredCertificate.crt'), $filename);
}
- function testRemoveDangerousFile() {
+ public function testRemoveDangerousFile() {
$this->assertFalse($this->certificateManager->removeCertificate('../../foo.txt'));
}
- function testRemoveExistingFile() {
+ public function testRemoveExistingFile() {
$this->certificateManager->addCertificate(file_get_contents(__DIR__ . '/../../data/certificates/goodCertificate.crt'), 'GoodCertificate');
$this->assertTrue($this->certificateManager->removeCertificate('GoodCertificate'));
}
- function testGetCertificateBundle() {
+ public function testGetCertificateBundle() {
$this->assertSame('/' . $this->username . '/files_external/rootcerts.crt', $this->certificateManager->getCertificateBundle());
}
@@ -145,7 +145,7 @@ class CertificateManagerTest extends \Test\TestCase {
* @param int $targetBundleExists
* @param bool $expected
*/
- function testNeedRebundling($uid,
+ public function testNeedRebundling($uid,
$CaBundleMtime,
$systemWideMtime,
$targetBundleMtime,
@@ -194,7 +194,7 @@ class CertificateManagerTest extends \Test\TestCase {
);
}
- function dataTestNeedRebundling() {
+ public function dataTestNeedRebundling() {
return [
//values: uid, CaBundleMtime, systemWideMtime, targetBundleMtime, targetBundleExists, expected
diff --git a/tests/lib/Security/CertificateTest.php b/tests/lib/Security/CertificateTest.php
index 986554cf967..223fb226904 100644
--- a/tests/lib/Security/CertificateTest.php
+++ b/tests/lib/Security/CertificateTest.php
@@ -53,7 +53,7 @@ class CertificateTest extends \Test\TestCase {
}
- function testCertificateStartingWithFileReference() {
+ public function testCertificateStartingWithFileReference() {
$this->expectException(\Exception::class);
$this->expectExceptionMessage('Certificate could not get parsed.');
diff --git a/tests/lib/Security/CryptoTest.php b/tests/lib/Security/CryptoTest.php
index 2a2e6adac3e..a6f4902594a 100644
--- a/tests/lib/Security/CryptoTest.php
+++ b/tests/lib/Security/CryptoTest.php
@@ -30,13 +30,13 @@ class CryptoTest extends \Test\TestCase {
/**
* @dataProvider defaultEncryptionProvider
*/
- function testDefaultEncrypt($stringToEncrypt) {
+ public function testDefaultEncrypt($stringToEncrypt) {
$ciphertext = $this->crypto->encrypt($stringToEncrypt);
$this->assertEquals($stringToEncrypt, $this->crypto->decrypt($ciphertext));
}
- function testWrongPassword() {
+ public function testWrongPassword() {
$this->expectException(\Exception::class);
$this->expectExceptionMessage('HMAC does not match.');
@@ -45,14 +45,14 @@ class CryptoTest extends \Test\TestCase {
$this->crypto->decrypt($ciphertext, 'A wrong password!');
}
- function testLaterDecryption() {
+ public function testLaterDecryption() {
$stringToEncrypt = 'Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt.';
$encryptedString = '44a35023cca2e7a6125e06c29fc4b2ad9d8a33d0873a8b45b0de4ef9284f260c6c46bf25dc62120644c59b8bafe4281ddc47a70c35ae6c29ef7a63d79eefacc297e60b13042ac582733598d0a6b4de37311556bb5c480fd2633de4e6ebafa868c2d1e2d80a5d24f9660360dba4d6e0c8|lhrFgK0zd9U160Wo|a75e57ab701f9124e1113543fd1dc596f21e20d456a0d1e813d5a8aaec9adcb11213788e96598b67fe9486a9f0b99642c18296d0175db44b1ae426e4e91080ee';
$this->assertEquals($stringToEncrypt, $this->crypto->decrypt($encryptedString, 'ThisIsAVeryS3cur3P4ssw0rd'));
}
- function testWrongIV() {
+ public function testWrongIV() {
$this->expectException(\Exception::class);
$this->expectExceptionMessage('HMAC does not match.');
@@ -61,7 +61,7 @@ class CryptoTest extends \Test\TestCase {
}
- function testWrongParameters() {
+ public function testWrongParameters() {
$this->expectException(\Exception::class);
$this->expectExceptionMessage('Authenticated ciphertext could not be decoded.');
diff --git a/tests/lib/Security/SecureRandomTest.php b/tests/lib/Security/SecureRandomTest.php
index 4075a1c7109..0ffd7ae7c14 100644
--- a/tests/lib/Security/SecureRandomTest.php
+++ b/tests/lib/Security/SecureRandomTest.php
@@ -42,7 +42,7 @@ class SecureRandomTest extends \Test\TestCase {
/**
* @dataProvider stringGenerationProvider
*/
- function testGetLowStrengthGeneratorLength($length, $expectedLength) {
+ public function testGetLowStrengthGeneratorLength($length, $expectedLength) {
$generator = $this->rng;
$this->assertEquals($expectedLength, strlen($generator->generate($length)));
@@ -51,7 +51,7 @@ class SecureRandomTest extends \Test\TestCase {
/**
* @dataProvider stringGenerationProvider
*/
- function testMediumLowStrengthGeneratorLength($length, $expectedLength) {
+ public function testMediumLowStrengthGeneratorLength($length, $expectedLength) {
$generator = $this->rng;
$this->assertEquals($expectedLength, strlen($generator->generate($length)));
@@ -60,7 +60,7 @@ class SecureRandomTest extends \Test\TestCase {
/**
* @dataProvider stringGenerationProvider
*/
- function testUninitializedGenerate($length, $expectedLength) {
+ public function testUninitializedGenerate($length, $expectedLength) {
$this->assertEquals($expectedLength, strlen($this->rng->generate($length)));
}