diff options
Diffstat (limited to 'tests/lib/Security/CertificateManagerTest.php')
-rw-r--r-- | tests/lib/Security/CertificateManagerTest.php | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/tests/lib/Security/CertificateManagerTest.php b/tests/lib/Security/CertificateManagerTest.php index e7d15e65c52..136c3160413 100644 --- a/tests/lib/Security/CertificateManagerTest.php +++ b/tests/lib/Security/CertificateManagerTest.php @@ -93,11 +93,11 @@ class CertificateManagerTest extends \Test\TestCase { $this->assertEqualsArrays($certificateStore, $this->certificateManager->listCertificates()); } - /** - * @expectedException \Exception - * @expectedExceptionMessage Certificate could not get parsed. - */ + function testAddInvalidCertificate() { + $this->expectException(\Exception::class); + $this->expectExceptionMessage('Certificate could not get parsed.'); + $this->certificateManager->addCertificate('InvalidCertificate', 'invalidCertificate'); } @@ -113,12 +113,13 @@ class CertificateManagerTest extends \Test\TestCase { } /** - * @expectedException \Exception - * @expectedExceptionMessage Filename is not valid * @dataProvider dangerousFileProvider * @param string $filename */ 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); } |