diff options
Diffstat (limited to 'tests/lib/security/certificate.php')
-rw-r--r-- | tests/lib/security/certificate.php | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/tests/lib/security/certificate.php b/tests/lib/security/certificate.php index 361f2f8c38d..4caacf900e7 100644 --- a/tests/lib/security/certificate.php +++ b/tests/lib/security/certificate.php @@ -46,31 +46,28 @@ class CertificateTest extends \Test\TestCase { $this->assertSame(null, $this->invalidCertificate->getCommonName()); } - function testGetOrganization() { - $this->assertSame('ownCloud Inc.', $this->goodCertificate->getOrganization()); + public function testGetOrganization() { + $this->assertSame('ownCloud Security', $this->goodCertificate->getOrganization()); $this->assertSame('Internet Widgits Pty Ltd', $this->invalidCertificate->getOrganization()); } - function testGetIssueDate() { - $expected = new DateTime('2014-08-27 08:45:52 GMT'); + public function testGetIssueDate() { + $expected = new DateTime('2015-08-27 20:03:42 GMT'); $this->assertEquals($expected->getTimestamp(), $this->goodCertificate->getIssueDate()->getTimestamp()); - $expected = new DateTime('2014-08-27 08:48:51 GMT'); + $expected = new DateTime('2015-08-27 20:19:13 GMT'); $this->assertEquals($expected->getTimestamp(), $this->invalidCertificate->getIssueDate()->getTimestamp()); } - function testGetExpireDate() { - $expected = new DateTime('2015-08-27 08:45:52 GMT'); + public function testGetExpireDate() { + $expected = new DateTime('2025-08-24 20:03:42 GMT'); $this->assertEquals($expected->getTimestamp(), $this->goodCertificate->getExpireDate()->getTimestamp()); - $expected = new DateTime('2015-08-27 08:48:51 GMT'); + $expected = new DateTime('2025-08-24 20:19:13 GMT'); $this->assertEquals($expected->getTimestamp(), $this->invalidCertificate->getExpireDate()->getTimestamp()); $expected = new DateTime('2014-08-28 09:12:43 GMT'); $this->assertEquals($expected->getTimestamp(), $this->expiredCertificate->getExpireDate()->getTimestamp()); } - /** - * Obviously the following test case might fail after 2015-08-27, just create a new certificate with longer validity then - */ - function testIsExpired() { + public function testIsExpired() { $this->assertSame(false, $this->goodCertificate->isExpired()); $this->assertSame(false, $this->invalidCertificate->isExpired()); $this->assertSame(true, $this->expiredCertificate->isExpired()); @@ -82,8 +79,8 @@ class CertificateTest extends \Test\TestCase { $this->assertSame(null, $this->expiredCertificate->getIssuerName()); } - function testGetIssuerOrganization() { - $this->assertSame('ownCloud Inc.', $this->goodCertificate->getIssuerOrganization()); + public function testGetIssuerOrganization() { + $this->assertSame('ownCloud Security', $this->goodCertificate->getIssuerOrganization()); $this->assertSame('Internet Widgits Pty Ltd', $this->invalidCertificate->getIssuerOrganization()); $this->assertSame('Internet Widgits Pty Ltd', $this->expiredCertificate->getIssuerOrganization()); } |