From 3a7cf40aaa678bea1df143d2982d603b7a334eec Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Wed, 27 Nov 2019 15:27:18 +0100 Subject: Mode to modern phpunit Signed-off-by: Roeland Jago Douma --- tests/lib/Security/CertificateTest.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'tests/lib/Security/CertificateTest.php') diff --git a/tests/lib/Security/CertificateTest.php b/tests/lib/Security/CertificateTest.php index c9d6ea90bd6..986554cf967 100644 --- a/tests/lib/Security/CertificateTest.php +++ b/tests/lib/Security/CertificateTest.php @@ -43,20 +43,20 @@ class CertificateTest extends \Test\TestCase { $this->expiredCertificate = new Certificate($expiredCertificate, 'ExpiredCertificate'); } - /** - * @expectedException \Exception - * @expectedExceptionMessage Certificate could not get parsed. - */ + public function testBogusData() { + $this->expectException(\Exception::class); + $this->expectExceptionMessage('Certificate could not get parsed.'); + $certificate = new Certificate('foo', 'bar'); $certificate->getIssueDate(); } - /** - * @expectedException \Exception - * @expectedExceptionMessage Certificate could not get parsed. - */ + function testCertificateStartingWithFileReference() { + $this->expectException(\Exception::class); + $this->expectExceptionMessage('Certificate could not get parsed.'); + new Certificate('file://'.__DIR__ . '/../../data/certificates/goodCertificate.crt', 'bar'); } -- cgit v1.2.3