Skip to content

Commit 2e88cd5

Browse files
committed
add test for length
1 parent 2d51454 commit 2e88cd5

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

tests/VAPIDTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
* file that was distributed with this source code.
1010
*/
1111

12+
use Minishlink\WebPush\Utils;
1213
use Minishlink\WebPush\VAPID;
1314

1415
class VAPIDTest extends PHPUnit_Framework_TestCase
@@ -45,6 +46,7 @@ public function testGetVapidHeaders($audience, $vapid, $expiration, $expectedAut
4546
$headers = VAPID::getVapidHeaders($audience, $vapid['subject'], $vapid['publicKey'], $vapid['privateKey'], $expiration);
4647

4748
$this->assertArrayHasKey('Authorization', $headers);
49+
$this->assertEquals(Utils::safe_strlen($expectedAuthorization), Utils::safe_strlen($headers['Authorization']));
4850
$this->assertEquals($this->explodeAuthorization($expectedAuthorization), $this->explodeAuthorization($headers['Authorization']));
4951
$this->assertArrayHasKey('Crypto-Key', $headers);
5052
$this->assertEquals($expectedCryptoKey, $headers['Crypto-Key']);

0 commit comments

Comments
 (0)