-
Notifications
You must be signed in to change notification settings - Fork 19
Open
Description
Since the oauth 2.0.9 I cannot mock (using phpunit) the OAuth class anymore. This worked using 2.0.7. I'm on latest PHP 8.3.
To Reproduce
This test succeeded with 2.0.7 and breaks with 2.0.9:
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\Attributes\Test;
use PHPUnit\Framework\TestCase;
#[Group('unit')]
final class AuthorizationTest extends TestCase
{
#[Test]
public function minimalTestCase(): void {
$consumerKey = 'ajkshjdng';
$consumerSecret = 'asdhj3h4h34j';
$oauth = $this->getMockBuilder(OAuth::class)
->setConstructorArgs([$consumerKey, $consumerSecret])
->getMock();
$oauth
->method('getRequestToken')
->with()
->willReturnMap(
[
['fakeurl.org', null, ['oauth_token' => 'liajsdjwiu34', 'oauth_token_secret' => 'asdfhhherwer3']],
]
);
$tokenData = $oauth->getRequestToken('fakeurl.org');
self::assertEquals('liajsdjwiu34', $tokenData['oauth_token']);
self::assertEquals('asdfhhherwer3', $tokenData['oauth_token_secret']);
}
}
Metadata
Metadata
Assignees
Labels
No labels