Skip to content

Commit e277c4c

Browse files
committed
add missing test
1 parent 8d81600 commit e277c4c

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

packages/auth/tests/OAuthTest.php

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
namespace Tempest\Auth\Tests;
66

7+
use League\OAuth2\Client\Provider\Apple;
78
use League\OAuth2\Client\Provider\Facebook;
89
use League\OAuth2\Client\Provider\Github;
910
use League\OAuth2\Client\Provider\Google;
@@ -12,6 +13,7 @@
1213
use League\OAuth2\Client\Provider\ResourceOwnerInterface;
1314
use PHPUnit\Framework\Attributes\Test;
1415
use PHPUnit\Framework\TestCase;
16+
use Tempest\Auth\OAuth\Config\AppleOAuthConfig;
1517
use Tempest\Auth\OAuth\Config\DiscordOAuthConfig;
1618
use Tempest\Auth\OAuth\Config\FacebookOAuthConfig;
1719
use Tempest\Auth\OAuth\Config\GenericOAuthConfig;
@@ -143,6 +145,26 @@ public function discord_oauth_config(): void
143145
$this->assertStringContainsString('discord-123', $url);
144146
}
145147

148+
#[Test]
149+
public function apple_oauth_config(): void
150+
{
151+
$config = new AppleOAuthConfig(
152+
clientId: 'apple-123',
153+
teamId: 'apple-team-id',
154+
keyId: 'apple-key-id',
155+
keyFile: 'apple-key-file',
156+
redirectTo: '/auth/apple/callback',
157+
scopes: ['email', 'name'],
158+
);
159+
160+
$provider = $config->createProvider();
161+
$url = $provider->getAuthorizationUrl();
162+
163+
$this->assertInstanceOf(Apple::class, $provider);
164+
$this->assertStringContainsString('apple.com', $url);
165+
$this->assertStringContainsString('apple-123', $url);
166+
}
167+
146168
#[Test]
147169
public function oauth_user_creation(): void
148170
{

0 commit comments

Comments
 (0)