diff options
author | Victor Dubiniuk <victor.dubiniuk@gmail.com> | 2016-12-15 14:37:04 +0300 |
---|---|---|
committer | Lukas Reschke <lukas@statuscode.ch> | 2016-12-16 17:51:03 +0100 |
commit | e536313451d071aa9693411b3964ef26ce75c904 (patch) | |
tree | e28bcd0449080441f28e231ce0e1dc201d038ece /tests/lib/IntegrityCheck | |
parent | 876754a5a55e076a56e98e4ed3fc7e82589e2afa (diff) | |
download | nextcloud-server-e536313451d071aa9693411b3964ef26ce75c904.tar.gz nextcloud-server-e536313451d071aa9693411b3964ef26ce75c904.zip |
Update tests
Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
Diffstat (limited to 'tests/lib/IntegrityCheck')
-rw-r--r-- | tests/lib/IntegrityCheck/CheckerTest.php | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/tests/lib/IntegrityCheck/CheckerTest.php b/tests/lib/IntegrityCheck/CheckerTest.php index 0e6bd52a5df..963a638bfd7 100644 --- a/tests/lib/IntegrityCheck/CheckerTest.php +++ b/tests/lib/IntegrityCheck/CheckerTest.php @@ -77,7 +77,6 @@ class CheckerTest extends TestCase { /** * @expectedException \Exception - * @expectedExceptionMessage Directory does not exist. */ public function testWriteAppSignatureOfNotExistingApp() { $keyBundle = file_get_contents(__DIR__ .'/../../data/integritycheck/SomeApp.crt'); @@ -89,6 +88,24 @@ class CheckerTest extends TestCase { $this->checker->writeAppSignature('NotExistingApp', $x509, $rsa); } + /** + * @expectedException \Exception + */ + public function testWriteAppSignatureWrongPermissions(){ + $this->fileAccessHelper + ->expects($this->once()) + ->method('file_put_contents') + ->will($this->throwException(new \Exception)) + ; + $keyBundle = file_get_contents(__DIR__ .'/../../data/integritycheck/SomeApp.crt'); + $rsaPrivateKey = file_get_contents(__DIR__ .'/../../data/integritycheck/SomeApp.key'); + $rsa = new RSA(); + $rsa->loadKey($rsaPrivateKey); + $x509 = new X509(); + $x509->loadX509($keyBundle); + $this->checker->writeAppSignature(\OC::$SERVERROOT . '/tests/data/integritycheck/app/', $x509, $rsa); + } + public function testWriteAppSignature() { $expectedSignatureFileData = '{ "hashes": { |