Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/UserManagement.php
Original file line number Diff line number Diff line change
Expand Up @@ -1272,11 +1272,11 @@ public function getJwksUrl(string $clientId)
* Returns the logout URL to end a user's session and redirect to your home page.
*
* @param string $sessionId The session ID of the user.
* @param string $return_to The URL to redirect to after the user logs out.
* @param string|null $return_to The URL to redirect to after the user logs out.
*
* @return string
*/
public function getLogoutUrl(string $sessionId, string $return_to = null)
public function getLogoutUrl(string $sessionId, ?string $return_to = null)
{
if (!isset($sessionId) || empty($sessionId)) {
throw new Exception\UnexpectedValueException("sessionId must not be empty");
Expand Down
5 changes: 5 additions & 0 deletions tests/WorkOS/AuditLogsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ class AuditLogsTest extends TestCase
setUp as protected traitSetUp;
}

/**
* @var AuditLogs
*/
protected $al;

protected function setUp(): void
{
$this->traitSetUp();
Expand Down
5 changes: 5 additions & 0 deletions tests/WorkOS/DirectorySyncTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ class DirectorySyncTest extends TestCase
setUp as traitSetUp;
}

/**
* @var DirectorySync
*/
protected $ds;

protected function setUp(): void
{
$this->traitSetUp();
Expand Down
5 changes: 5 additions & 0 deletions tests/WorkOS/MFATest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ class MFATest extends TestCase
setUp as traitSetUp;
}

/**
* @var MFA
*/
protected $mfa;

protected function setUp(): void
{
$this->traitSetUp();
Expand Down
5 changes: 5 additions & 0 deletions tests/WorkOS/OrganizationsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ class OrganizationsTest extends TestCase
setUp as protected traitSetUp;
}

/**
* @var Organizations
*/
protected $organizations;

protected function setUp(): void
{
$this->traitSetUp();
Expand Down
5 changes: 5 additions & 0 deletions tests/WorkOS/PasswordlessTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ class PasswordlessTest extends TestCase
setUp as traitSetUp;
}

/**
* @var Passwordless
*/
protected $passwordless;

protected function setUp(): void
{
$this->traitSetUp();
Expand Down
5 changes: 5 additions & 0 deletions tests/WorkOS/PortalTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ class PortalTest extends TestCase
setUp as protected traitSetUp;
}

/**
* @var Portal
*/
protected $ap;

protected function setUp(): void
{
$this->traitSetUp();
Expand Down
5 changes: 5 additions & 0 deletions tests/WorkOS/SSOTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ class SSOTest extends TestCase
setUp as traitSetUp;
}

/**
* @var SSO
*/
protected $sso;

protected function setUp(): void
{
$this->traitSetUp();
Expand Down
5 changes: 5 additions & 0 deletions tests/WorkOS/UserManagementTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ class UserManagementTest extends TestCase
setUp as traitSetUp;
}

/**
* @var UserManagement
*/
protected $userManagement;

protected function setUp(): void
{
$this->traitSetUp();
Expand Down
37 changes: 36 additions & 1 deletion tests/WorkOS/WebhookTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,41 @@ class WebhookTest extends TestCase
setUp as protected traitSetUp;
}

/**
* @var Webhook
*/
protected $ap;

/**
* @var string
*/
protected $payload;

/**
* @var string
*/
protected $secret;

/**
* @var int
*/
protected $tolerance;

/**
* @var int
*/
protected $time;

/**
* @var string
*/
protected $expectedSignature;

/**
* @var string
*/
protected $sigHeader;

protected function setUp(): void
{
$this->traitSetUp();
Expand All @@ -21,7 +56,7 @@ protected function setUp(): void
$this->secret = 'secret';
$this->tolerance = 180;
$this->time = time();
$decodedBody = utf8_decode($this->payload);
$decodedBody = $this->payload;
$signedPayload = $this->time . "." . $decodedBody;
$this->expectedSignature = hash_hmac("sha256", $signedPayload, $this->secret, false);
$this->sigHeader = 't=' . $this->time . ', v1=' . $this->expectedSignature;
Expand Down
5 changes: 5 additions & 0 deletions tests/WorkOS/WidgetsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ class WidgetsTest extends TestCase
setUp as protected traitSetUp;
}

/**
* @var Widgets
*/
protected $ap;

protected function setUp(): void
{
$this->traitSetUp();
Expand Down