Skip to content

Commit

Permalink
Test that it read the same from PEM file and PEM contents
Browse files Browse the repository at this point in the history
  • Loading branch information
eclipxe13 committed Sep 26, 2019
1 parent d0f8e47 commit cde31ed
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/CfdiUtilsTests/Certificado/CertificadoTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,17 @@ public function testVerifyWithKnownData()
$this->assertTrue($verify);
}

public function testConstructUsingPemContents()
{
$pemfile = $this->utilAsset('certs/CSD01_AAA010101AAA.cer.pem');
$contents = file_get_contents($pemfile) ?: '';

$fromFile = new Certificado($pemfile);
$fromContents = new Certificado($contents);

$this->assertSame($fromFile->getPemContents(), $fromContents->getPemContents());
}

public function testVerifyWithInvalidData()
{
$dataFile = $this->utilAsset('certs/data-to-sign.txt');
Expand Down

0 comments on commit cde31ed

Please sign in to comment.