Conditions | 1 |
Paths | 1 |
Total Lines | 21 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
12 | public function testCertificate() |
||
13 | { |
||
14 | $cert = 'der....'; |
||
15 | $x509 = new X509Certificates(); |
||
16 | |||
17 | $this->assertFalse($x509->hasCertificate()); |
||
18 | $x509->setCertificate($cert, 0); |
||
19 | $this->assertTrue($x509->hasCertificate()); |
||
20 | |||
21 | $parsed = new X509Certificates(); |
||
22 | $parsed->parse($x509->serialize()); |
||
23 | |||
24 | $this->assertCount(1, $parsed->getCertificateList()); |
||
25 | $this->assertEquals($cert, $parsed->getCertificate(0)); |
||
26 | |||
27 | $x509->clearCertificate(); |
||
28 | $this->assertFalse($x509->hasCertificate()); |
||
29 | |||
30 | $x509->addCertificate($cert); |
||
31 | $this->assertTrue($x509->hasCertificate()); |
||
32 | } |
||
33 | } |
||
34 |