1 | <?php |
||
14 | class ComodoDecodeCSRTest extends XigenUnit |
||
15 | { |
||
16 | protected $ComodoDecodeCSR; |
||
17 | |||
18 | 5 | public function setUp() |
|
19 | { |
||
20 | 5 | $this->ComodoDecodeCSR = new ComodoDecodeCSR(); |
|
21 | 5 | } |
|
22 | |||
23 | 1 | public function testSettingCSR() |
|
24 | { |
||
25 | //Load the test CSR |
||
26 | 1 | $csr = $this->loadTestCSR(); |
|
27 | 1 | $this->ComodoDecodeCSR->setCSR($csr); |
|
28 | 1 | $this->assertSame( |
|
29 | 1 | $csr, |
|
30 | 1 | $this->ComodoDecodeCSR->getCSR(), |
|
31 | 1 | "Unable to set the CSR via ->setCSR()" |
|
32 | ); |
||
33 | 1 | } |
|
34 | |||
35 | public function testGettingHashes() |
||
36 | 1 | { |
|
37 | $this->ComodoDecodeCSR->setCSR($this->loadTestCSR()); |
||
38 | $hashes = $this->ComodoDecodeCSR->fetchHashes(); |
||
39 | 1 | ||
40 | $this->assertSame($this->validMD5, $hashes["md5"], "md5 didn't match the correct value"); |
||
41 | $this->assertSame($this->validMD5, $this->ComodoDecodeCSR->getMD5(), "md5 didn't match the correct value"); |
||
42 | 5 | ||
43 | $this->assertSame($this->validSHA1, $hashes["sha1"], "sha1 didn't match the correct value"); |
||
44 | $this->assertSame($this->validSHA1, $this->ComodoDecodeCSR->getSHA1(), "sha1 didn't match the correct value"); |
||
45 | 5 | } |
|
46 | 1 | ||
47 | 1 | public function testGettingHashesFromInvalidCSR() |
|
54 | 1 | ||
55 | public function testCheckingInstalled() |
||
56 | 1 | { |
|
57 | 1 | $csr = $this->loadTestCSR(); |
|
58 | $this->ComodoDecodeCSR->setCSR($csr); |
||
59 | 1 | $this->ComodoDecodeCSR->fetchHashes(); |
|
60 | 1 | $installed = $this->ComodoDecodeCSR->checkInstalled(); |
|
61 | |||
62 | 1 | $this->assertTrue($installed); |
|
63 | 1 | } |
|
64 | 1 | ||
65 | public function testCheckInstalledFail() |
||
74 | } |
||
75 |