From 4ec1ca144047a96e7b55869832406cf942c49975 Mon Sep 17 00:00:00 2001 From: Dominique Fournier Date: Thu, 14 Mar 2019 20:22:25 +0000 Subject: [PATCH] Add one test more in certificationauthorityTest.php git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@5108 bf3deb0d-5f1a-0410-827f-c0cc1f45334c --- Tests/certificationauthorityTest.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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 ();