Skip to content

Commit

Permalink
Implement IntegerElementTrait
Browse files Browse the repository at this point in the history
  • Loading branch information
tvdijen committed Nov 29, 2024
1 parent 364bff4 commit 424911f
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/XML/ds/X509SerialNumber.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ final class X509SerialNumber extends AbstractDsElement


/**
* @param int $content
* @param string $content
*/
public function __construct(int $content)
public function __construct(string $content)
{
$this->setContent($content);
}
Expand Down
2 changes: 1 addition & 1 deletion tests/XML/ds/X509DataTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ public function testMarshalling(): void
'C=US,ST=Hawaii,L=Honolulu,O=SimpleSAMLphp HQ,CN=SimpleSAMLphp Testing CA,emailAddress=%s',
'[email protected]',
)),
new X509SerialNumber(2),
new X509SerialNumber('2'),
),
new X509SubjectName(self::$certData['name']),
new X509Digest(self::$digest, C::DIGEST_SHA256),
Expand Down
2 changes: 1 addition & 1 deletion tests/XML/ds/X509IssuerSerialTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public function setUp(): void
/** @var string[] $details */
$details = self::$key->getCertificateDetails();
self::$issuer = new X509IssuerName(CertificateUtils::parseIssuer($details['issuer']));
self::$serial = new X509SerialNumber(intval($details['serialNumber']));
self::$serial = new X509SerialNumber($details['serialNumber']);
}


Expand Down
2 changes: 1 addition & 1 deletion tests/XML/ds/X509SerialNumberTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public static function setUpBeforeClass(): void
*/
public function testMarshalling(): void
{
$serialNumber = new X509SerialNumber(123456);
$serialNumber = new X509SerialNumber('123456');

$this->assertEquals(
self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement),
Expand Down

0 comments on commit 424911f

Please sign in to comment.