1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace OAuthTest\Unit\OAuth1\Token; |
4
|
|
|
|
5
|
|
|
use OAuth\OAuth1\Token\StdOAuth1Token; |
6
|
|
|
use PHPUnit\Framework\TestCase; |
7
|
|
|
|
8
|
|
|
class StdOAuth1TokenTest extends TestCase |
9
|
|
|
{ |
10
|
|
|
public function testConstructCorrectInterfaces(): void |
11
|
|
|
{ |
12
|
|
|
$token = new StdOAuth1Token(); |
13
|
|
|
|
14
|
|
|
self::assertInstanceOf('\\OAuth\\OAuth1\\Token\\TokenInterface', $token); |
15
|
|
|
self::assertInstanceOf('\\OAuth\\Common\\Token\\AbstractToken', $token); |
16
|
|
|
} |
17
|
|
|
|
18
|
|
|
/** |
19
|
|
|
* @covers \OAuth\OAuth1\Token\StdOAuth1Token::setRequestToken |
20
|
|
|
*/ |
21
|
|
|
public function testSetRequestToken(): void |
22
|
|
|
{ |
23
|
|
|
$token = new StdOAuth1Token(); |
24
|
|
|
|
25
|
|
|
self::assertNull($token->setRequestToken('foo')); |
|
|
|
|
26
|
|
|
} |
27
|
|
|
|
28
|
|
|
/** |
29
|
|
|
* @covers \OAuth\OAuth1\Token\StdOAuth1Token::getRequestToken |
30
|
|
|
* @covers \OAuth\OAuth1\Token\StdOAuth1Token::setRequestToken |
31
|
|
|
*/ |
32
|
|
|
public function testGetRequestToken(): void |
33
|
|
|
{ |
34
|
|
|
$token = new StdOAuth1Token(); |
35
|
|
|
|
36
|
|
|
self::assertNull($token->setRequestToken('foo')); |
|
|
|
|
37
|
|
|
self::assertSame('foo', $token->getRequestToken()); |
38
|
|
|
} |
39
|
|
|
|
40
|
|
|
/** |
41
|
|
|
* @covers \OAuth\OAuth1\Token\StdOAuth1Token::setRequestTokenSecret |
42
|
|
|
*/ |
43
|
|
|
public function testSetRequestTokenSecret(): void |
44
|
|
|
{ |
45
|
|
|
$token = new StdOAuth1Token(); |
46
|
|
|
|
47
|
|
|
self::assertNull($token->setRequestTokenSecret('foo')); |
|
|
|
|
48
|
|
|
} |
49
|
|
|
|
50
|
|
|
/** |
51
|
|
|
* @covers \OAuth\OAuth1\Token\StdOAuth1Token::getRequestTokenSecret |
52
|
|
|
* @covers \OAuth\OAuth1\Token\StdOAuth1Token::setRequestTokenSecret |
53
|
|
|
*/ |
54
|
|
|
public function testGetRequestTokenSecret(): void |
55
|
|
|
{ |
56
|
|
|
$token = new StdOAuth1Token(); |
57
|
|
|
|
58
|
|
|
self::assertNull($token->setRequestTokenSecret('foo')); |
|
|
|
|
59
|
|
|
self::assertSame('foo', $token->getRequestTokenSecret()); |
60
|
|
|
} |
61
|
|
|
|
62
|
|
|
/** |
63
|
|
|
* @covers \OAuth\OAuth1\Token\StdOAuth1Token::setAccessTokenSecret |
64
|
|
|
*/ |
65
|
|
|
public function testSetAccessTokenSecret(): void |
66
|
|
|
{ |
67
|
|
|
$token = new StdOAuth1Token(); |
68
|
|
|
|
69
|
|
|
self::assertNull($token->setAccessTokenSecret('foo')); |
|
|
|
|
70
|
|
|
} |
71
|
|
|
|
72
|
|
|
/** |
73
|
|
|
* @covers \OAuth\OAuth1\Token\StdOAuth1Token::getAccessTokenSecret |
74
|
|
|
* @covers \OAuth\OAuth1\Token\StdOAuth1Token::setAccessTokenSecret |
75
|
|
|
*/ |
76
|
|
|
public function testGetAccessTokenSecret(): void |
77
|
|
|
{ |
78
|
|
|
$token = new StdOAuth1Token(); |
79
|
|
|
|
80
|
|
|
self::assertNull($token->setAccessTokenSecret('foo')); |
|
|
|
|
81
|
|
|
self::assertSame('foo', $token->getAccessTokenSecret()); |
82
|
|
|
} |
83
|
|
|
} |
84
|
|
|
|
This check looks for function or method calls that always return null and whose return value is used.
The method
getObject()
can return nothing but null, so it makes no sense to use the return value.The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.