diff options
Diffstat (limited to 'tests/lib/IntegrityCheck/CheckerTest.php')
-rw-r--r-- | tests/lib/IntegrityCheck/CheckerTest.php | 188 |
1 files changed, 94 insertions, 94 deletions
diff --git a/tests/lib/IntegrityCheck/CheckerTest.php b/tests/lib/IntegrityCheck/CheckerTest.php index 586a42ff547..22b026eaae5 100644 --- a/tests/lib/IntegrityCheck/CheckerTest.php +++ b/tests/lib/IntegrityCheck/CheckerTest.php @@ -62,13 +62,13 @@ class CheckerTest extends TestCase { $this->mimeTypeDetector = $this->createMock(\OC\Files\Type\Detection::class); $this->config->method('getAppValue') - ->will($this->returnArgument(2)); + ->willReturnArgument(2); $this->cacheFactory ->expects($this->any()) ->method('createDistributed') ->with('oc.integritycheck.checker') - ->will($this->returnValue(new NullCache())); + ->willReturn(new NullCache()); $this->checker = new Checker( $this->environmentHelper, @@ -161,12 +161,12 @@ class CheckerTest extends TestCase { $this->environmentHelper ->expects($this->once()) ->method('getChannel') - ->will($this->returnValue('stable')); + ->willReturn('stable'); $this->config ->expects($this->any()) ->method('getSystemValue') ->with('integrity.check.disabled', false) - ->will($this->returnValue(false)); + ->willReturn(false); $expected = [ 'EXCEPTION' => [ @@ -181,18 +181,18 @@ class CheckerTest extends TestCase { $this->environmentHelper ->expects($this->once()) ->method('getChannel') - ->will($this->returnValue('stable')); + ->willReturn('stable'); $this->config ->expects($this->any()) ->method('getSystemValue') ->with('integrity.check.disabled', false) - ->will($this->returnValue(false)); + ->willReturn(false); $this->appLocator ->expects($this->once()) ->method('getAppPath') ->with('SomeApp') - ->will($this->returnValue(\OC::$SERVERROOT . '/tests/data/integritycheck/app/')); + ->willReturn(\OC::$SERVERROOT . '/tests/data/integritycheck/app/'); $signatureDataFile = '{ "hashes": { "AnotherFile.txt": "1570ca9420e37629de4328f48c51da29840ddeaa03ae733da4bf1d854b8364f594aac560601270f9e1797ed4cd57c1aea87bf44cf4245295c94f2e935a2f0112", @@ -207,14 +207,14 @@ class CheckerTest extends TestCase { ->with( \OC::$SERVERROOT . '/tests/data/integritycheck/app//appinfo/signature.json' ) - ->will($this->returnValue($signatureDataFile)); + ->willReturn($signatureDataFile); $this->fileAccessHelper ->expects($this->at(1)) ->method('file_get_contents') ->with( '/resources/codesigning/root.crt' ) - ->will($this->returnValue(file_get_contents(__DIR__ .'/../../data/integritycheck/root.crt'))); + ->willReturn(file_get_contents(__DIR__ .'/../../data/integritycheck/root.crt')); $this->assertSame([], $this->checker->verifyAppSignature('SomeApp')); } @@ -223,18 +223,18 @@ class CheckerTest extends TestCase { $this->environmentHelper ->expects($this->once()) ->method('getChannel') - ->will($this->returnValue('stable')); + ->willReturn('stable'); $this->config ->expects($this->any()) ->method('getSystemValue') ->with('integrity.check.disabled', false) - ->will($this->returnValue(false)); + ->willReturn(false); $this->appLocator ->expects($this->once()) ->method('getAppPath') ->with('SomeApp') - ->will($this->returnValue(\OC::$SERVERROOT . '/tests/data/integritycheck/app/')); + ->willReturn(\OC::$SERVERROOT . '/tests/data/integritycheck/app/'); $signatureDataFile = '{ "hashes": { "AnotherFile.txt": "tampered", @@ -249,14 +249,14 @@ class CheckerTest extends TestCase { ->with( \OC::$SERVERROOT . '/tests/data/integritycheck/app//appinfo/signature.json' ) - ->will($this->returnValue($signatureDataFile)); + ->willReturn($signatureDataFile); $this->fileAccessHelper ->expects($this->at(1)) ->method('file_get_contents') ->with( '/resources/codesigning/root.crt' ) - ->will($this->returnValue(file_get_contents(__DIR__ .'/../../data/integritycheck/root.crt'))); + ->willReturn(file_get_contents(__DIR__ .'/../../data/integritycheck/root.crt')); $expected = [ 'EXCEPTION' => [ @@ -271,18 +271,18 @@ class CheckerTest extends TestCase { $this->environmentHelper ->expects($this->once()) ->method('getChannel') - ->will($this->returnValue('stable')); + ->willReturn('stable'); $this->config ->expects($this->any()) ->method('getSystemValue') ->with('integrity.check.disabled', false) - ->will($this->returnValue(false)); + ->willReturn(false); $this->appLocator ->expects($this->once()) ->method('getAppPath') ->with('SomeApp') - ->will($this->returnValue(\OC::$SERVERROOT . '/tests/data/integritycheck/appWithInvalidData/')); + ->willReturn(\OC::$SERVERROOT . '/tests/data/integritycheck/appWithInvalidData/'); $signatureDataFile = '{ "hashes": { "AnotherFile.txt": "1570ca9420e37629de4328f48c51da29840ddeaa03ae733da4bf1d854b8364f594aac560601270f9e1797ed4cd57c1aea87bf44cf4245295c94f2e935a2f0112", @@ -297,14 +297,14 @@ class CheckerTest extends TestCase { ->with( \OC::$SERVERROOT . '/tests/data/integritycheck/appWithInvalidData//appinfo/signature.json' ) - ->will($this->returnValue($signatureDataFile)); + ->willReturn($signatureDataFile); $this->fileAccessHelper ->expects($this->at(1)) ->method('file_get_contents') ->with( '/resources/codesigning/root.crt' ) - ->will($this->returnValue(file_get_contents(__DIR__ .'/../../data/integritycheck/root.crt'))); + ->willReturn(file_get_contents(__DIR__ .'/../../data/integritycheck/root.crt')); $expected = [ @@ -335,12 +335,12 @@ class CheckerTest extends TestCase { $this->environmentHelper ->expects($this->once()) ->method('getChannel') - ->will($this->returnValue('stable')); + ->willReturn('stable'); $this->config ->expects($this->any()) ->method('getSystemValue') ->with('integrity.check.disabled', false) - ->will($this->returnValue(false)); + ->willReturn(false); $this->appLocator ->expects($this->never()) @@ -360,14 +360,14 @@ class CheckerTest extends TestCase { ->with( \OC::$SERVERROOT . '/tests/data/integritycheck/appWithInvalidData//appinfo/signature.json' ) - ->will($this->returnValue($signatureDataFile)); + ->willReturn($signatureDataFile); $this->fileAccessHelper ->expects($this->at(1)) ->method('file_get_contents') ->with( '/resources/codesigning/root.crt' ) - ->will($this->returnValue(file_get_contents(__DIR__ .'/../../data/integritycheck/root.crt'))); + ->willReturn(file_get_contents(__DIR__ .'/../../data/integritycheck/root.crt')); $expected = [ @@ -398,18 +398,18 @@ class CheckerTest extends TestCase { $this->environmentHelper ->expects($this->once()) ->method('getChannel') - ->will($this->returnValue('stable')); + ->willReturn('stable'); $this->config ->expects($this->any()) ->method('getSystemValue') ->with('integrity.check.disabled', false) - ->will($this->returnValue(false)); + ->willReturn(false); $this->appLocator ->expects($this->once()) ->method('getAppPath') ->with('SomeApp') - ->will($this->returnValue(\OC::$SERVERROOT . '/tests/data/integritycheck/appWithInvalidData/')); + ->willReturn(\OC::$SERVERROOT . '/tests/data/integritycheck/appWithInvalidData/'); $signatureDataFile = '{ "hashes": { "AnotherFile.txt": "1570ca9420e37629de4328f48c51da29840ddeaa03ae733da4bf1d854b8364f594aac560601270f9e1797ed4cd57c1aea87bf44cf4245295c94f2e935a2f0112", @@ -422,14 +422,14 @@ class CheckerTest extends TestCase { ->expects($this->at(0)) ->method('file_get_contents') ->with(\OC::$SERVERROOT . '/tests/data/integritycheck/appWithInvalidData//appinfo/signature.json') - ->will($this->returnValue($signatureDataFile)); + ->willReturn($signatureDataFile); $this->fileAccessHelper ->expects($this->at(1)) ->method('file_get_contents') ->with( '/resources/codesigning/root.crt' ) - ->will($this->returnValue(file_get_contents(__DIR__ .'/../../data/integritycheck/root.crt'))); + ->willReturn(file_get_contents(__DIR__ .'/../../data/integritycheck/root.crt')); $expected = [ 'EXCEPTION' => [ @@ -444,18 +444,18 @@ class CheckerTest extends TestCase { $this->environmentHelper ->expects($this->once()) ->method('getChannel') - ->will($this->returnValue('stable')); + ->willReturn('stable'); $this->config ->expects($this->any()) ->method('getSystemValue') ->with('integrity.check.disabled', false) - ->will($this->returnValue(false)); + ->willReturn(false); $this->appLocator ->expects($this->once()) ->method('getAppPath') ->with('SomeApp') - ->will($this->returnValue(\OC::$SERVERROOT . '/tests/data/integritycheck/app/')); + ->willReturn(\OC::$SERVERROOT . '/tests/data/integritycheck/app/'); $signatureDataFile = '{ "hashes": { "AnotherFile.txt": "1570ca9420e37629de4328f48c51da29840ddeaa03ae733da4bf1d854b8364f594aac560601270f9e1797ed4cd57c1aea87bf44cf4245295c94f2e935a2f0112", @@ -468,14 +468,14 @@ class CheckerTest extends TestCase { ->expects($this->at(0)) ->method('file_get_contents') ->with(\OC::$SERVERROOT . '/tests/data/integritycheck/app//appinfo/signature.json') - ->will($this->returnValue($signatureDataFile)); + ->willReturn($signatureDataFile); $this->fileAccessHelper ->expects($this->at(1)) ->method('file_get_contents') ->with( '/resources/codesigning/root.crt' ) - ->will($this->returnValue(file_get_contents(__DIR__ .'/../../data/integritycheck/root.crt'))); + ->willReturn(file_get_contents(__DIR__ .'/../../data/integritycheck/root.crt')); $this->assertSame([], $this->checker->verifyAppSignature('SomeApp')); } @@ -540,7 +540,7 @@ class CheckerTest extends TestCase { $this->environmentHelper ->expects($this->any()) ->method('getServerRoot') - ->will($this->returnValue(\OC::$SERVERROOT . '/tests/data/integritycheck/app/')); + ->willReturn(\OC::$SERVERROOT . '/tests/data/integritycheck/app/'); $this->fileAccessHelper ->expects($this->once()) ->method('file_put_contents') @@ -575,7 +575,7 @@ class CheckerTest extends TestCase { $this->environmentHelper ->expects($this->any()) ->method('getServerRoot') - ->will($this->returnValue(\OC::$SERVERROOT . '/tests/data/integritycheck/htaccessUnmodified/')); + ->willReturn(\OC::$SERVERROOT . '/tests/data/integritycheck/htaccessUnmodified/'); $this->fileAccessHelper ->expects($this->once()) ->method('file_put_contents') @@ -640,7 +640,7 @@ class CheckerTest extends TestCase { $this->environmentHelper ->expects($this->any()) ->method('getServerRoot') - ->will($this->returnValue(\OC::$SERVERROOT . '/tests/data/integritycheck/htaccessWithValidModifiedContent')); + ->willReturn(\OC::$SERVERROOT . '/tests/data/integritycheck/htaccessWithValidModifiedContent'); $this->fileAccessHelper ->expects($this->once()) ->method('file_put_contents') @@ -667,12 +667,12 @@ class CheckerTest extends TestCase { $this->environmentHelper ->expects($this->once()) ->method('getChannel') - ->will($this->returnValue('stable')); + ->willReturn('stable'); $this->config ->expects($this->any()) ->method('getSystemValue') ->with('integrity.check.disabled', false) - ->will($this->returnValue(false)); + ->willReturn(false); $expected = [ 'EXCEPTION' => [ @@ -687,17 +687,17 @@ class CheckerTest extends TestCase { $this->environmentHelper ->expects($this->once()) ->method('getChannel') - ->will($this->returnValue('stable')); + ->willReturn('stable'); $this->config ->expects($this->any()) ->method('getSystemValue') ->with('integrity.check.disabled', false) - ->will($this->returnValue(false)); + ->willReturn(false); $this->environmentHelper ->expects($this->any()) ->method('getServerRoot') - ->will($this->returnValue(\OC::$SERVERROOT . '/tests/data/integritycheck/app/')); + ->willReturn(\OC::$SERVERROOT . '/tests/data/integritycheck/app/'); $signatureDataFile = '{ "hashes": { "AnotherFile.txt": "1570ca9420e37629de4328f48c51da29840ddeaa03ae733da4bf1d854b8364f594aac560601270f9e1797ed4cd57c1aea87bf44cf4245295c94f2e935a2f0112", @@ -712,14 +712,14 @@ class CheckerTest extends TestCase { ->with( \OC::$SERVERROOT . '/tests/data/integritycheck/app//core/signature.json' ) - ->will($this->returnValue($signatureDataFile)); + ->willReturn($signatureDataFile); $this->fileAccessHelper ->expects($this->at(1)) ->method('file_get_contents') ->with( \OC::$SERVERROOT . '/tests/data/integritycheck/app//resources/codesigning/root.crt' ) - ->will($this->returnValue(file_get_contents(__DIR__ .'/../../data/integritycheck/root.crt'))); + ->willReturn(file_get_contents(__DIR__ .'/../../data/integritycheck/root.crt')); $this->assertSame([], $this->checker->verifyCoreSignature()); } @@ -728,17 +728,17 @@ class CheckerTest extends TestCase { $this->environmentHelper ->expects($this->once()) ->method('getChannel') - ->will($this->returnValue('stable')); + ->willReturn('stable'); $this->config ->expects($this->any()) ->method('getSystemValue') ->with('integrity.check.disabled', false) - ->will($this->returnValue(false)); + ->willReturn(false); $this->environmentHelper ->expects($this->any()) ->method('getServerRoot') - ->will($this->returnValue(\OC::$SERVERROOT . '/tests/data/integritycheck/htaccessWithValidModifiedContent')); + ->willReturn(\OC::$SERVERROOT . '/tests/data/integritycheck/htaccessWithValidModifiedContent'); $signatureDataFile = '{ "hashes": { ".htaccess": "7e6a7a4d8ee4f3fbc45dd579407c643471575a9d127d1c75f6d0a49e80766c3c587104b2139ef76d2a4bffce3f45777900605aaa49519c9532909b71e5030227", @@ -753,14 +753,14 @@ class CheckerTest extends TestCase { ->with( \OC::$SERVERROOT . '/tests/data/integritycheck/htaccessWithValidModifiedContent/core/signature.json' ) - ->will($this->returnValue($signatureDataFile)); + ->willReturn($signatureDataFile); $this->fileAccessHelper ->expects($this->at(1)) ->method('file_get_contents') ->with( \OC::$SERVERROOT . '/tests/data/integritycheck/htaccessWithValidModifiedContent/resources/codesigning/root.crt' ) - ->will($this->returnValue(file_get_contents(__DIR__ .'/../../data/integritycheck/root.crt'))); + ->willReturn(file_get_contents(__DIR__ .'/../../data/integritycheck/root.crt')); $this->assertSame([], $this->checker->verifyCoreSignature()); } @@ -769,12 +769,12 @@ class CheckerTest extends TestCase { $this->environmentHelper ->expects($this->once()) ->method('getChannel') - ->will($this->returnValue('stable')); + ->willReturn('stable'); $this->config ->expects($this->any()) ->method('getSystemValue') ->with('integrity.check.disabled', false) - ->will($this->returnValue(false)); + ->willReturn(false); $this->mimeTypeDetector ->expects($this->once()) @@ -994,7 +994,7 @@ class CheckerTest extends TestCase { $this->environmentHelper ->expects($this->any()) ->method('getServerRoot') - ->will($this->returnValue(\OC::$SERVERROOT . '/tests/data/integritycheck/mimetypeListModified')); + ->willReturn(\OC::$SERVERROOT . '/tests/data/integritycheck/mimetypeListModified'); $signatureDataFile = '{ "hashes": { "mimetypelist.js": "dc48de7ad4baa030c5e563350c9a80b274bad783f6f5adbf1595ecef6c6a32e52890a24cb26cddb0aa20193ba52c001150c68d8bfb567f0aed566f4029a190a3" @@ -1008,14 +1008,14 @@ class CheckerTest extends TestCase { ->with( \OC::$SERVERROOT . '/tests/data/integritycheck/mimetypeListModified/core/signature.json' ) - ->will($this->returnValue($signatureDataFile)); + ->willReturn($signatureDataFile); $this->fileAccessHelper ->expects($this->at(1)) ->method('file_get_contents') ->with( \OC::$SERVERROOT . '/tests/data/integritycheck/mimetypeListModified/resources/codesigning/root.crt' ) - ->will($this->returnValue(file_get_contents(__DIR__ .'/../../data/integritycheck/root.crt'))); + ->willReturn(file_get_contents(__DIR__ .'/../../data/integritycheck/root.crt')); $this->assertSame([], $this->checker->verifyCoreSignature()); @@ -1025,17 +1025,17 @@ class CheckerTest extends TestCase { $this->environmentHelper ->expects($this->once()) ->method('getChannel') - ->will($this->returnValue('stable')); + ->willReturn('stable'); $this->config ->expects($this->any()) ->method('getSystemValue') ->with('integrity.check.disabled', false) - ->will($this->returnValue(false)); + ->willReturn(false); $this->environmentHelper ->expects($this->any()) ->method('getServerRoot') - ->will($this->returnValue(\OC::$SERVERROOT . '/tests/data/integritycheck/app/')); + ->willReturn(\OC::$SERVERROOT . '/tests/data/integritycheck/app/'); $signatureDataFile = '{ "hashes": { "AnotherFile.txt": "1570ca9420e37629de4328f48c51da29840ddeaa03ae733da4bf1d854b8364f594aac560601270f9e1797ed4cd57c1aea87bf44cf4245295c94f2e935a2f0112", @@ -1050,14 +1050,14 @@ class CheckerTest extends TestCase { ->with( \OC::$SERVERROOT . '/tests/data/integritycheck/app//core/signature.json' ) - ->will($this->returnValue($signatureDataFile)); + ->willReturn($signatureDataFile); $this->fileAccessHelper ->expects($this->at(1)) ->method('file_get_contents') ->with( \OC::$SERVERROOT . '/tests/data/integritycheck/app//resources/codesigning/root.crt' ) - ->will($this->returnValue(file_get_contents(__DIR__ .'/../../data/integritycheck/root.crt'))); + ->willReturn(file_get_contents(__DIR__ .'/../../data/integritycheck/root.crt')); $this->assertSame([], $this->checker->verifyCoreSignature()); } @@ -1066,17 +1066,17 @@ class CheckerTest extends TestCase { $this->environmentHelper ->expects($this->once()) ->method('getChannel') - ->will($this->returnValue('stable')); + ->willReturn('stable'); $this->config ->expects($this->any()) ->method('getSystemValue') ->with('integrity.check.disabled', false) - ->will($this->returnValue(false)); + ->willReturn(false); $this->environmentHelper ->expects($this->any()) ->method('getServerRoot') - ->will($this->returnValue(\OC::$SERVERROOT . '/tests/data/integritycheck/appWithInvalidData/')); + ->willReturn(\OC::$SERVERROOT . '/tests/data/integritycheck/appWithInvalidData/'); $signatureDataFile = '{ "hashes": { "AnotherFile.txt": "tampered", @@ -1091,14 +1091,14 @@ class CheckerTest extends TestCase { ->with( \OC::$SERVERROOT . '/tests/data/integritycheck/appWithInvalidData//core/signature.json' ) - ->will($this->returnValue($signatureDataFile)); + ->willReturn($signatureDataFile); $this->fileAccessHelper ->expects($this->at(1)) ->method('file_get_contents') ->with( \OC::$SERVERROOT . '/tests/data/integritycheck/appWithInvalidData//resources/codesigning/root.crt' ) - ->will($this->returnValue(file_get_contents(__DIR__ .'/../../data/integritycheck/root.crt'))); + ->willReturn(file_get_contents(__DIR__ .'/../../data/integritycheck/root.crt')); $expected = [ 'EXCEPTION' => [ @@ -1113,17 +1113,17 @@ class CheckerTest extends TestCase { $this->environmentHelper ->expects($this->once()) ->method('getChannel') - ->will($this->returnValue('stable')); + ->willReturn('stable'); $this->config ->expects($this->any()) ->method('getSystemValue') ->with('integrity.check.disabled', false) - ->will($this->returnValue(false)); + ->willReturn(false); $this->environmentHelper ->expects($this->any()) ->method('getServerRoot') - ->will($this->returnValue(\OC::$SERVERROOT . '/tests/data/integritycheck/appWithInvalidData/')); + ->willReturn(\OC::$SERVERROOT . '/tests/data/integritycheck/appWithInvalidData/'); $signatureDataFile = '{ "hashes": { "AnotherFile.txt": "1570ca9420e37629de4328f48c51da29840ddeaa03ae733da4bf1d854b8364f594aac560601270f9e1797ed4cd57c1aea87bf44cf4245295c94f2e935a2f0112", @@ -1138,14 +1138,14 @@ class CheckerTest extends TestCase { ->with( \OC::$SERVERROOT . '/tests/data/integritycheck/appWithInvalidData//core/signature.json' ) - ->will($this->returnValue($signatureDataFile)); + ->willReturn($signatureDataFile); $this->fileAccessHelper ->expects($this->at(1)) ->method('file_get_contents') ->with( \OC::$SERVERROOT . '/tests/data/integritycheck/appWithInvalidData//resources/codesigning/root.crt' ) - ->will($this->returnValue(file_get_contents(__DIR__ .'/../../data/integritycheck/root.crt'))); + ->willReturn(file_get_contents(__DIR__ .'/../../data/integritycheck/root.crt')); $expected = [ 'INVALID_HASH' => [ @@ -1175,17 +1175,17 @@ class CheckerTest extends TestCase { $this->environmentHelper ->expects($this->once()) ->method('getChannel') - ->will($this->returnValue('stable')); + ->willReturn('stable'); $this->config ->expects($this->any()) ->method('getSystemValue') ->with('integrity.check.disabled', false) - ->will($this->returnValue(false)); + ->willReturn(false); $this->environmentHelper ->expects($this->any()) ->method('getServerRoot') - ->will($this->returnValue(\OC::$SERVERROOT . '/tests/data/integritycheck/app/')); + ->willReturn(\OC::$SERVERROOT . '/tests/data/integritycheck/app/'); $signatureDataFile = '{ "hashes": { "AnotherFile.txt": "1570ca9420e37629de4328f48c51da29840ddeaa03ae733da4bf1d854b8364f594aac560601270f9e1797ed4cd57c1aea87bf44cf4245295c94f2e935a2f0112", @@ -1200,14 +1200,14 @@ class CheckerTest extends TestCase { ->with( \OC::$SERVERROOT . '/tests/data/integritycheck/app//core/signature.json' ) - ->will($this->returnValue($signatureDataFile)); + ->willReturn($signatureDataFile); $this->fileAccessHelper ->expects($this->at(1)) ->method('file_get_contents') ->with( \OC::$SERVERROOT . '/tests/data/integritycheck/app//resources/codesigning/root.crt' ) - ->will($this->returnValue(file_get_contents(__DIR__ .'/../../data/integritycheck/root.crt'))); + ->willReturn(file_get_contents(__DIR__ .'/../../data/integritycheck/root.crt')); $expected = [ 'EXCEPTION' => [ @@ -1222,17 +1222,17 @@ class CheckerTest extends TestCase { $this->environmentHelper ->expects($this->once()) ->method('getChannel') - ->will($this->returnValue('stable')); + ->willReturn('stable'); $this->config ->expects($this->any()) ->method('getSystemValue') ->with('integrity.check.disabled', false) - ->will($this->returnValue(false)); + ->willReturn(false); $this->environmentHelper ->expects($this->any()) ->method('getServerRoot') - ->will($this->returnValue(\OC::$SERVERROOT . '/tests/data/integritycheck/app/')); + ->willReturn(\OC::$SERVERROOT . '/tests/data/integritycheck/app/'); $signatureDataFile = '{ "hashes": { "AnotherFile.txt": "1570ca9420e37629de4328f48c51da29840ddeaa03ae733da4bf1d854b8364f594aac560601270f9e1797ed4cd57c1aea87bf44cf4245295c94f2e935a2f0112", @@ -1247,14 +1247,14 @@ class CheckerTest extends TestCase { ->with( \OC::$SERVERROOT . '/tests/data/integritycheck/app//core/signature.json' ) - ->will($this->returnValue($signatureDataFile)); + ->willReturn($signatureDataFile); $this->fileAccessHelper ->expects($this->at(1)) ->method('file_get_contents') ->with( \OC::$SERVERROOT . '/tests/data/integritycheck/app//resources/codesigning/root.crt' ) - ->will($this->returnValue(file_get_contents(__DIR__ .'/../../data/integritycheck/root.crt'))); + ->willReturn(file_get_contents(__DIR__ .'/../../data/integritycheck/root.crt')); $expected = [ 'EXCEPTION' => [ @@ -1289,17 +1289,17 @@ class CheckerTest extends TestCase { $this->appLocator ->expects($this->at(0)) ->method('getAllApps') - ->will($this->returnValue([ + ->willReturn([ 'files', 'calendar', 'contacts', 'dav', - ])); + ]); $this->appManager ->expects($this->at(0)) ->method('isShipped') ->with('files') - ->will($this->returnValue(true)); + ->willReturn(true); $this->checker ->expects($this->at(1)) ->method('verifyAppSignature') @@ -1308,17 +1308,17 @@ class CheckerTest extends TestCase { ->expects($this->at(1)) ->method('isShipped') ->with('calendar') - ->will($this->returnValue(false)); + ->willReturn(false); $this->appLocator ->expects($this->at(1)) ->method('getAppPath') ->with('calendar') - ->will($this->returnValue('/apps/calendar')); + ->willReturn('/apps/calendar'); $this->fileAccessHelper ->expects($this->at(0)) ->method('file_exists') ->with('/apps/calendar/appinfo/signature.json') - ->will($this->returnValue(true)); + ->willReturn(true); $this->checker ->expects($this->at(2)) ->method('verifyAppSignature') @@ -1327,22 +1327,22 @@ class CheckerTest extends TestCase { ->expects($this->at(2)) ->method('isShipped') ->with('contacts') - ->will($this->returnValue(false)); + ->willReturn(false); $this->appLocator ->expects($this->at(2)) ->method('getAppPath') ->with('contacts') - ->will($this->returnValue('/apps/contacts')); + ->willReturn('/apps/contacts'); $this->fileAccessHelper ->expects($this->at(1)) ->method('file_exists') ->with('/apps/contacts/appinfo/signature.json') - ->will($this->returnValue(false)); + ->willReturn(false); $this->appManager ->expects($this->at(3)) ->method('isShipped') ->with('dav') - ->will($this->returnValue(true)); + ->willReturn(true); $this->checker ->expects($this->at(3)) ->method('verifyAppSignature') @@ -1359,12 +1359,12 @@ class CheckerTest extends TestCase { $this->environmentHelper ->expects($this->once()) ->method('getChannel') - ->will($this->returnValue('stable')); + ->willReturn('stable'); $this->config ->expects($this->any()) ->method('getSystemValue') ->with('integrity.check.disabled', false) - ->will($this->returnValue(true)); + ->willReturn(true); $expected = []; $this->assertSame($expected, $this->checker->verifyAppSignature('SomeApp')); @@ -1389,12 +1389,12 @@ class CheckerTest extends TestCase { $this->environmentHelper ->expects($this->once()) ->method('getChannel') - ->will($this->returnValue($channel)); + ->willReturn($channel); $this->config ->expects($this->any()) ->method('getSystemValue') ->with('integrity.check.disabled', false) - ->will($this->returnValue(false)); + ->willReturn(false); $this->assertSame($isCodeSigningEnforced, $this->checker->isCodeCheckEnforced()); } @@ -1407,12 +1407,12 @@ class CheckerTest extends TestCase { $this->environmentHelper ->expects($this->once()) ->method('getChannel') - ->will($this->returnValue($channel)); + ->willReturn($channel); $this->config ->expects($this->any()) ->method('getSystemValue') ->with('integrity.check.disabled', false) - ->will($this->returnValue(true)); + ->willReturn(true); $this->assertFalse(self::invokePrivate($this->checker, 'isCodeCheckEnforced')); } |