diff --git a/tests/EcdsaP256Test.php b/tests/EcdsaP256Test.php index 1ba23aa..194d8e8 100644 --- a/tests/EcdsaP256Test.php +++ b/tests/EcdsaP256Test.php @@ -36,7 +36,7 @@ public function testSignAndVerifyRoundTripWithRawSignature(): void fact($envelope->verify($verifier))->is('the payload'); // Raw r||s encoding for P-256 is exactly 64 bytes (DER would be variable-length). - fact(strlen($envelope->signatures[0]->sig))->is(64); + fact($envelope->signatures[0]->sig)->hasLength(64); } public function testVerifiesNativeDerSignature(): void diff --git a/tests/EcdsaP384Test.php b/tests/EcdsaP384Test.php index 57733f5..acfb708 100644 --- a/tests/EcdsaP384Test.php +++ b/tests/EcdsaP384Test.php @@ -27,7 +27,7 @@ public function testSignAndVerifyRoundTripWithRawSignature(): void fact($envelope->verify(EcdsaP384Verifier::fromPem($publicPem)))->is('the payload'); // Raw r||s for P-384 is exactly 96 bytes. - fact(strlen($envelope->signatures[0]->sig))->is(96); + fact($envelope->signatures[0]->sig)->hasLength(96); } public function testVerifiesNativeDerSignature(): void diff --git a/tests/EcdsaP521Test.php b/tests/EcdsaP521Test.php index b5191b2..3c8f8d0 100644 --- a/tests/EcdsaP521Test.php +++ b/tests/EcdsaP521Test.php @@ -27,7 +27,7 @@ public function testSignAndVerifyRoundTripWithRawSignature(): void fact($envelope->verify(EcdsaP521Verifier::fromPem($publicPem)))->is('the payload'); // Raw r||s for P-521 is exactly 132 bytes (66 per coordinate). - fact(strlen($envelope->signatures[0]->sig))->is(132); + fact($envelope->signatures[0]->sig)->hasLength(132); } public function testVerifiesNativeDerSignature(): void diff --git a/tests/EnvelopeTest.php b/tests/EnvelopeTest.php index 170eb57..e8bd607 100644 --- a/tests/EnvelopeTest.php +++ b/tests/EnvelopeTest.php @@ -31,7 +31,7 @@ public function testParsesAndReEmitsTheOfficialExampleEnvelope(): void fact($envelope->payload)->is('hello world'); fact($envelope->payloadType)->is('http://example.com/HelloWorld'); - fact(count($envelope->signatures))->is(1); + fact($envelope->signatures)->count(1); fact($envelope->toJson())->is(self::EXAMPLE_JSON); }