Skip to content

Commit cde31ed

Browse files
committed
Test that it read the same from PEM file and PEM contents
1 parent d0f8e47 commit cde31ed

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

tests/CfdiUtilsTests/Certificado/CertificadoTest.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,17 @@ public function testVerifyWithKnownData()
6464
$this->assertTrue($verify);
6565
}
6666

67+
public function testConstructUsingPemContents()
68+
{
69+
$pemfile = $this->utilAsset('certs/CSD01_AAA010101AAA.cer.pem');
70+
$contents = file_get_contents($pemfile) ?: '';
71+
72+
$fromFile = new Certificado($pemfile);
73+
$fromContents = new Certificado($contents);
74+
75+
$this->assertSame($fromFile->getPemContents(), $fromContents->getPemContents());
76+
}
77+
6778
public function testVerifyWithInvalidData()
6879
{
6980
$dataFile = $this->utilAsset('certs/data-to-sign.txt');

0 commit comments

Comments
 (0)