summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorLukas Reschke <lukas@statuscode.ch>2016-09-08 09:19:59 +0200
committerGitHub <noreply@github.com>2016-09-08 09:19:59 +0200
commitff691b4d8a26c08dcf9555c70a071cdebd1266e6 (patch)
treebf978f2f50d473c1a6de8fade6b7b47fece291de /tests
parentcdfe538452b709dd181ac11fcfca72a5221c79ad (diff)
parent9d00f367f9a00722cf64ee519397c8ed66769af2 (diff)
downloadnextcloud-server-ff691b4d8a26c08dcf9555c70a071cdebd1266e6.tar.gz
nextcloud-server-ff691b4d8a26c08dcf9555c70a071cdebd1266e6.zip
Merge pull request #836 from nextcloud/php7.1
Add PHP 7.1 drone tests
Diffstat (limited to 'tests')
-rw-r--r--tests/Settings/Controller/SecuritySettingsControllerTest.php4
-rw-r--r--tests/lib/IntegrityCheck/CheckerTest.php37
2 files changed, 33 insertions, 8 deletions
diff --git a/tests/Settings/Controller/SecuritySettingsControllerTest.php b/tests/Settings/Controller/SecuritySettingsControllerTest.php
index 11b0edcae23..302dc730fc4 100644
--- a/tests/Settings/Controller/SecuritySettingsControllerTest.php
+++ b/tests/Settings/Controller/SecuritySettingsControllerTest.php
@@ -57,8 +57,8 @@ class SecuritySettingsControllerTest extends \PHPUnit_Framework_TestCase {
$this->container['Config']
->expects($this->once())
->method('getSystemValue')
- ->with('trusted_domains')
- ->will($this->returnValue(''));
+ ->with($this->equalTo('trusted_domains'), $this->equalTo([]))
+ ->willReturn([]);
$response = $this->securitySettingsController->trustedDomains('newdomain.com');
$expectedResponse = array('status' => 'success');
diff --git a/tests/lib/IntegrityCheck/CheckerTest.php b/tests/lib/IntegrityCheck/CheckerTest.php
index d67f1382dc9..5823ac0f25c 100644
--- a/tests/lib/IntegrityCheck/CheckerTest.php
+++ b/tests/lib/IntegrityCheck/CheckerTest.php
@@ -102,8 +102,13 @@ class CheckerTest extends TestCase {
->expects($this->once())
->method('file_put_contents')
->with(
- \OC::$SERVERROOT . '/tests/data/integritycheck/app//appinfo/signature.json',
- $expectedSignatureFileData
+ $this->equalTo(\OC::$SERVERROOT . '/tests/data/integritycheck/app//appinfo/signature.json'),
+ $this->callback(function($signature) use ($expectedSignatureFileData) {
+ $expectedArray = json_decode($expectedSignatureFileData, true);
+ $actualArray = json_decode($signature, true);
+ $this->assertEquals($expectedArray, $actualArray);
+ return true;
+ })
);
$keyBundle = file_get_contents(__DIR__ .'/../../data/integritycheck/SomeApp.crt');
@@ -456,7 +461,12 @@ class CheckerTest extends TestCase {
->method('file_put_contents')
->with(
\OC::$SERVERROOT . '/tests/data/integritycheck/app//core/signature.json',
- $expectedSignatureFileData
+ $this->callback(function($signature) use ($expectedSignatureFileData) {
+ $expectedArray = json_decode($expectedSignatureFileData, true);
+ $actualArray = json_decode($signature, true);
+ $this->assertEquals($expectedArray, $actualArray);
+ return true;
+ })
);
$keyBundle = file_get_contents(__DIR__ .'/../../data/integritycheck/core.crt');
@@ -486,7 +496,12 @@ class CheckerTest extends TestCase {
->method('file_put_contents')
->with(
\OC::$SERVERROOT . '/tests/data/integritycheck/htaccessUnmodified//core/signature.json',
- $expectedSignatureFileData
+ $this->callback(function($signature) use ($expectedSignatureFileData) {
+ $expectedArray = json_decode($expectedSignatureFileData, true);
+ $actualArray = json_decode($signature, true);
+ $this->assertEquals($expectedArray, $actualArray);
+ return true;
+ })
);
$keyBundle = file_get_contents(__DIR__ .'/../../data/integritycheck/core.crt');
@@ -511,7 +526,12 @@ class CheckerTest extends TestCase {
->method('file_put_contents')
->with(
\OC::$SERVERROOT . '/tests/data/integritycheck/htaccessWithInvalidModifiedContent//core/signature.json',
- $expectedSignatureFileData
+ $this->callback(function($signature) use ($expectedSignatureFileData) {
+ $expectedArray = json_decode($expectedSignatureFileData, true);
+ $actualArray = json_decode($signature, true);
+ $this->assertEquals($expectedArray, $actualArray);
+ return true;
+ })
);
$keyBundle = file_get_contents(__DIR__ .'/../../data/integritycheck/core.crt');
@@ -542,7 +562,12 @@ class CheckerTest extends TestCase {
->method('file_put_contents')
->with(
\OC::$SERVERROOT . '/tests/data/integritycheck/htaccessWithValidModifiedContent/core/signature.json',
- $expectedSignatureFileData
+ $this->callback(function($signature) use ($expectedSignatureFileData) {
+ $expectedArray = json_decode($expectedSignatureFileData, true);
+ $actualArray = json_decode($signature, true);
+ $this->assertEquals($expectedArray, $actualArray);
+ return true;
+ })
);
$keyBundle = file_get_contents(__DIR__ .'/../../data/integritycheck/core.crt');