diff options
author | Robin Appelman <icewind@owncloud.com> | 2014-08-31 13:16:28 +0200 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2014-08-31 13:16:28 +0200 |
commit | 3a85767182e04ac013f59d82cc3a8c4d08bab151 (patch) | |
tree | ce42c2d98f8aa315b8a14bd6d3536557abe47220 /tests/lib/security | |
parent | bfa0c4b78a977726971f7b48e8f921b8adb56e8b (diff) | |
download | nextcloud-server-3a85767182e04ac013f59d82cc3a8c4d08bab151.tar.gz nextcloud-server-3a85767182e04ac013f59d82cc3a8c4d08bab151.zip |
5.3 syntax...
Diffstat (limited to 'tests/lib/security')
-rw-r--r-- | tests/lib/security/certificate.php | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/tests/lib/security/certificate.php b/tests/lib/security/certificate.php index 41c8a74b836..db33dd00d99 100644 --- a/tests/lib/security/certificate.php +++ b/tests/lib/security/certificate.php @@ -4,7 +4,7 @@ * This file is licensed under the Affero General Public License version 3 or * later. * See the COPYING-README file. -*/ + */ use \OC\Security\Certificate; @@ -18,11 +18,11 @@ class CertificateTest extends \PHPUnit_Framework_TestCase { protected $expiredCertificate; function setUp() { - $goodCertificate = file_get_contents(__DIR__.'/../../data/certificates/goodCertificate.crt'); + $goodCertificate = file_get_contents(__DIR__ . '/../../data/certificates/goodCertificate.crt'); $this->goodCertificate = new Certificate($goodCertificate, 'GoodCertificate'); - $badCertificate = file_get_contents(__DIR__.'/../../data/certificates/badCertificate.crt'); + $badCertificate = file_get_contents(__DIR__ . '/../../data/certificates/badCertificate.crt'); $this->invalidCertificate = new Certificate($badCertificate, 'BadCertificate'); - $expiredCertificate = file_get_contents(__DIR__.'/../../data/certificates/expiredCertificate.crt'); + $expiredCertificate = file_get_contents(__DIR__ . '/../../data/certificates/expiredCertificate.crt'); $this->expiredCertificate = new Certificate($expiredCertificate, 'ExpiredCertificate'); } @@ -55,14 +55,19 @@ class CertificateTest extends \PHPUnit_Framework_TestCase { } function testGetIssueDate() { - $this->assertEquals((new DateTime('2014-08-27 08:45:52 GMT'))->getTimestamp(), $this->goodCertificate->getIssueDate()->getTimestamp()); - $this->assertEquals((new DateTime('2014-08-27 08:48:51 GMT'))->getTimestamp(), $this->invalidCertificate->getIssueDate()->getTimestamp()); + $expected = new DateTime('2014-08-27 08:45:52 GMT'); + $this->assertEquals($expected->getTimestamp(), $this->goodCertificate->getIssueDate()->getTimestamp()); + $expected = new DateTime('2014-08-27 08:48:51 GMT'); + $this->assertEquals($expected->getTimestamp(), $this->invalidCertificate->getIssueDate()->getTimestamp()); } function testGetExpireDate() { - $this->assertEquals((new DateTime('2015-08-27 08:45:52 GMT'))->getTimestamp(), $this->goodCertificate->getExpireDate()->getTimestamp()); - $this->assertEquals((new DateTime('2015-08-27 08:48:51 GMT'))->getTimestamp(), $this->invalidCertificate->getExpireDate()->getTimestamp()); - $this->assertEquals((new DateTime('2014-08-28 09:12:43 GMT'))->getTimestamp(), $this->expiredCertificate->getExpireDate()->getTimestamp()); + $expected = new DateTime('2015-08-27 08:45:52 GMT'); + $this->assertEquals($expected->getTimestamp(), $this->goodCertificate->getExpireDate()->getTimestamp()); + $expected = new DateTime('2015-08-27 08:48:51 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()); } /** |