diff options
Diffstat (limited to 'tests/lib/IntegrityCheck/CheckerTest.php')
-rw-r--r-- | tests/lib/IntegrityCheck/CheckerTest.php | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/tests/lib/IntegrityCheck/CheckerTest.php b/tests/lib/IntegrityCheck/CheckerTest.php index e7553aeac1f..586a42ff547 100644 --- a/tests/lib/IntegrityCheck/CheckerTest.php +++ b/tests/lib/IntegrityCheck/CheckerTest.php @@ -51,7 +51,7 @@ class CheckerTest extends TestCase { /** @var \OC\Files\Type\Detection|\PHPUnit_Framework_MockObject_MockObject */ private $mimeTypeDetector; - public function setUp(): void { + protected function setUp(): void { parent::setUp(); $this->environmentHelper = $this->createMock(EnvironmentHelper::class); $this->fileAccessHelper = $this->createMock(FileAccessHelper::class); @@ -82,11 +82,11 @@ class CheckerTest extends TestCase { ); } - /** - * @expectedException \Exception - * @expectedExceptionMessage Exception message - */ + public function testWriteAppSignatureOfNotExistingApp() { + $this->expectException(\Exception::class); + $this->expectExceptionMessage('Exception message'); + $this->fileAccessHelper ->expects($this->at(0)) ->method('assertDirectoryExists') @@ -107,11 +107,11 @@ class CheckerTest extends TestCase { $this->checker->writeAppSignature('NotExistingApp', $x509, $rsa); } - /** - * @expectedException \Exception - * @expectedExceptionMessageRegExp /[a-zA-Z\/_-]+ is not writable/ - */ + public function testWriteAppSignatureWrongPermissions() { + $this->expectException(\Exception::class); + $this->expectExceptionMessageRegExp('/[a-zA-Z\\/_-]+ is not writable/'); + $this->fileAccessHelper ->expects($this->once()) ->method('file_put_contents') @@ -480,11 +480,11 @@ class CheckerTest extends TestCase { $this->assertSame([], $this->checker->verifyAppSignature('SomeApp')); } - /** - * @expectedException \Exception - * @expectedExceptionMessage Exception message - */ + public function testWriteCoreSignatureWithException() { + $this->expectException(\Exception::class); + $this->expectExceptionMessage('Exception message'); + $this->fileAccessHelper ->expects($this->at(0)) ->method('assertDirectoryExists') @@ -504,11 +504,11 @@ class CheckerTest extends TestCase { $this->checker->writeCoreSignature($x509, $rsa, __DIR__); } - /** - * @expectedException \Exception - * @expectedExceptionMessageRegExp /[a-zA-Z\/_-]+ is not writable/ - */ + public function testWriteCoreSignatureWrongPermissions() { + $this->expectException(\Exception::class); + $this->expectExceptionMessageRegExp('/[a-zA-Z\\/_-]+ is not writable/'); + $this->fileAccessHelper ->expects($this->at(0)) ->method('assertDirectoryExists') |