Server : LiteSpeed System : Linux server335.web-hosting.com 4.18.0-553.62.1.lve.el8.x86_64 #1 SMP Mon Jul 21 17:50:35 UTC 2025 x86_64 User : cardxfeb ( 2452) PHP Version : 8.1.34 Disable Function : NONE Directory : /home/cardxfeb/public_html/vendor/league/oauth1-client/tests/ |
<?php
namespace League\OAuth1\Client\Tests;
use Generator;
use League\OAuth1\Client\Server\Twitter;
use PHPUnit\Framework\TestCase;
class TwitterServerTest extends TestCase
{
public function sampleTemporaryCredentialUrls(): Generator
{
yield 'No application scope' => [
null, 'https://api.twitter.com/oauth/request_token',
];
yield "Read" => [
'read', 'https://api.twitter.com/oauth/request_token?x_auth_access_type=read',
];
yield "Write" => [
'write', 'https://api.twitter.com/oauth/request_token?x_auth_access_type=write',
];
}
/** @dataProvider sampleTemporaryCredentialUrls */
public function testItProvidesNoApplicationScopeByDefault(?string $applicationScope, string $url): void
{
$twitter = new Twitter([
'identifier' => 'mykey',
'secret' => 'mysecret',
'callback_uri' => 'http://app.dev/',
'scope' => $applicationScope,
]);
self::assertEquals($url, $twitter->urlTemporaryCredentials());
}
}