Skip to content

Commit 798c606

Browse files
committed
wip
1 parent f572637 commit 798c606

File tree

2 files changed

+5
-9
lines changed

2 files changed

+5
-9
lines changed

tests/Events/AppStore/DidChangeRenewalPrefTest.php

+1-5
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,10 @@ public function v1_get_auto_renew_product_id(): void
3535
*/
3636
public function v2_get_aut_renew_product_id(): void
3737
{
38-
$signedRenewalInfo = $this->sign([
39-
'autoRenewProductId' => 'com.example.product',
40-
])->toString();
41-
4238
$decodedPayload = V2DecodedPayload::fromArray([
4339
'notification_type' => ServerNotification::DID_CHANGE_RENEWAL_PREF,
4440
'data' => [
45-
'signedRenewalInfo' => $signedRenewalInfo,
41+
'signedRenewalInfo' => $this->sign(['autoRenewProductId' => 'com.example.product'])->toString(),
4642
],
4743
]);
4844
$serverNotification = AppStoreV2ServerNotification::fromDecodedPayload($decodedPayload);

tests/TestCase.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -94,18 +94,18 @@ protected function deleteFile(string $path): void
9494
}
9595

9696
/**
97-
* @param array<string, string> $claims
97+
* @param array<non-empty-string, string> $claims
9898
*/
9999
protected function sign(array $claims): UnencryptedToken
100100
{
101-
$key = InMemory::base64Encoded('hiG8DlOKvtih6AxlZn5XKImZ06yu8I3mkOzaJrEuW8yAv8Jnkw330uMt8AEqQ5LB');
101+
$signingKey = InMemory::base64Encoded('hiG8DlOKvtih6AxlZn5XKImZ06yu8I3mkOzaJrEuW8yAv8Jnkw330uMt8AEqQ5LB');
102102

103103
return (new JwtFacade())->issue(
104104
new Sha256(),
105-
$key,
105+
$signingKey,
106106
static function (Builder $builder) use ($claims): Builder {
107107
foreach ($claims as $key => $value) {
108-
$builder->withClaim($key, $value);
108+
$builder = $builder->withClaim($key, $value);
109109
}
110110

111111
return $builder;

0 commit comments

Comments
 (0)