for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* @author Chris Hilsdon <[email protected]>
*/
namespace Xigen\Tests;
use Xigen\ComodoDecodeCSR;
class ComodoDecodeCSRTest extends XigenUnit
{
private $validMD5 = "244A9E11A76D297F0816A92F477DF543";
private $validSHA1 = "8FC930D6EDE2844D9DA147F9928178AEFB5B7E89";
public function setUp()
$this->ComodoDecodeCSR = new ComodoDecodeCSR();
ComodoDecodeCSR
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
class MyClass { } $x = new MyClass(); $x->foo = true;
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:
class MyClass { public $foo; } $x = new MyClass(); $x->foo = true;
}
public function testSettingCSR()
//Load the test CSR
$csr = $this->loadTestCSR();
$this->ComodoDecodeCSR->setCSR($csr);
$this->assertSame(
$csr,
$this->ComodoDecodeCSR->getCSR(),
"Unable to set the CSR via ->setCSR()"
);
public function testGettingHashes()
$Hashes = $this->ComodoDecodeCSR->getHashes();
$this->assertSame($this->validMD5, $Hashes["md5"], "md5 didn't match the correct value");
$this->assertSame($this->validSHA1, $Hashes["sha1"], "sha1 didn't match the correct value");
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: