Skip to content

Commit 7d88d10

Browse files
authored
Fixed deprecation notices in tests (#300)
1 parent cc4d46b commit 7d88d10

File tree

10 files changed

+78
-3
lines changed

10 files changed

+78
-3
lines changed

lib/UserManagement.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1311,11 +1311,11 @@ public function getJwksUrl(string $clientId)
13111311
* Returns the logout URL to end a user's session and redirect to your home page.
13121312
*
13131313
* @param string $sessionId The session ID of the user.
1314-
* @param string $return_to The URL to redirect to after the user logs out.
1314+
* @param string|null $return_to The URL to redirect to after the user logs out.
13151315
*
13161316
* @return string
13171317
*/
1318-
public function getLogoutUrl(string $sessionId, string $return_to = null)
1318+
public function getLogoutUrl(string $sessionId, ?string $return_to = null)
13191319
{
13201320
if (!isset($sessionId) || empty($sessionId)) {
13211321
throw new Exception\UnexpectedValueException("sessionId must not be empty");

tests/WorkOS/AuditLogsTest.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ class AuditLogsTest extends TestCase
1010
setUp as protected traitSetUp;
1111
}
1212

13+
/**
14+
* @var AuditLogs
15+
*/
16+
protected $al;
17+
1318
protected function setUp(): void
1419
{
1520
$this->traitSetUp();

tests/WorkOS/DirectorySyncTest.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ class DirectorySyncTest extends TestCase
1010
setUp as traitSetUp;
1111
}
1212

13+
/**
14+
* @var DirectorySync
15+
*/
16+
protected $ds;
17+
1318
protected function setUp(): void
1419
{
1520
$this->traitSetUp();

tests/WorkOS/MFATest.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ class MFATest extends TestCase
1010
setUp as traitSetUp;
1111
}
1212

13+
/**
14+
* @var MFA
15+
*/
16+
protected $mfa;
17+
1318
protected function setUp(): void
1419
{
1520
$this->traitSetUp();

tests/WorkOS/PasswordlessTest.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ class PasswordlessTest extends TestCase
1010
setUp as traitSetUp;
1111
}
1212

13+
/**
14+
* @var Passwordless
15+
*/
16+
protected $passwordless;
17+
1318
protected function setUp(): void
1419
{
1520
$this->traitSetUp();

tests/WorkOS/PortalTest.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ class PortalTest extends TestCase
1010
setUp as protected traitSetUp;
1111
}
1212

13+
/**
14+
* @var Portal
15+
*/
16+
protected $ap;
17+
1318
protected function setUp(): void
1419
{
1520
$this->traitSetUp();

tests/WorkOS/SSOTest.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ class SSOTest extends TestCase
1212
setUp as traitSetUp;
1313
}
1414

15+
/**
16+
* @var SSO
17+
*/
18+
protected $sso;
19+
1520
protected function setUp(): void
1621
{
1722
$this->traitSetUp();

tests/WorkOS/UserManagementTest.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ class UserManagementTest extends TestCase
1111
setUp as traitSetUp;
1212
}
1313

14+
/**
15+
* @var UserManagement
16+
*/
17+
protected $userManagement;
18+
1419
protected function setUp(): void
1520
{
1621
$this->traitSetUp();

tests/WorkOS/WebhookTest.php

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,41 @@ class WebhookTest extends TestCase
1010
setUp as protected traitSetUp;
1111
}
1212

13+
/**
14+
* @var Webhook
15+
*/
16+
protected $ap;
17+
18+
/**
19+
* @var string
20+
*/
21+
protected $payload;
22+
23+
/**
24+
* @var string
25+
*/
26+
protected $secret;
27+
28+
/**
29+
* @var int
30+
*/
31+
protected $tolerance;
32+
33+
/**
34+
* @var int
35+
*/
36+
protected $time;
37+
38+
/**
39+
* @var string
40+
*/
41+
protected $expectedSignature;
42+
43+
/**
44+
* @var string
45+
*/
46+
protected $sigHeader;
47+
1348
protected function setUp(): void
1449
{
1550
$this->traitSetUp();
@@ -21,7 +56,7 @@ protected function setUp(): void
2156
$this->secret = 'secret';
2257
$this->tolerance = 180;
2358
$this->time = time();
24-
$decodedBody = utf8_decode($this->payload);
59+
$decodedBody = $this->payload;
2560
$signedPayload = $this->time . "." . $decodedBody;
2661
$this->expectedSignature = hash_hmac("sha256", $signedPayload, $this->secret, false);
2762
$this->sigHeader = 't=' . $this->time . ', v1=' . $this->expectedSignature;

tests/WorkOS/WidgetsTest.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ class WidgetsTest extends TestCase
1010
setUp as protected traitSetUp;
1111
}
1212

13+
/**
14+
* @var Widgets
15+
*/
16+
protected $ap;
17+
1318
protected function setUp(): void
1419
{
1520
$this->traitSetUp();

0 commit comments

Comments
 (0)