diff --git a/Tests/certificationauthorityTest.php b/Tests/certificationauthorityTest.php index 1f535ba..e27ab63 100644 --- a/Tests/certificationauthorityTest.php +++ b/Tests/certificationauthorityTest.php @@ -15,6 +15,19 @@ class test_certificationauthority extends PHPUnit_Framework_TestCase "-----BEGIN CERTIFICATE----------BEGIN PRIVATE KEY-----"); } + public function test_createCA_2 () + { + $certificationauthority = new certificationauthority (); + $certificationauthority->createCA ("FR", "FOURNIER38", "CATEST"); + $caCert = $certificationauthority->caCert (); + file_put_contents ("/tmp/test_createCA_2", $caCert); + exec ("openssl x509 -in - -text -noout < /tmp/test_createCA_2", $output); + $res = preg_match ("# CA:TRUE#", + implode ("\n", $output)); + unlink ("/tmp/test_createCA_2"); + $this->assertSame ($res, 1); + } + public function test_createPK_1 () { $certificationauthority = new certificationauthority ();