Mercurial > nebulaweb3
comparison default/assets/vendors/theme-widgets/vendor/abraham/twitteroauth/tests/AbstractSignatureMethodTest.php @ 0:1d038bc9b3d2 default tip
Up:default
author | Liny <dev@neowd.com> |
---|---|
date | Sat, 31 May 2025 09:21:51 +0800 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:1d038bc9b3d2 |
---|---|
1 <?php | |
2 | |
3 namespace Abraham\TwitterOAuth\Tests; | |
4 | |
5 use Abraham\TwitterOAuth\SignatureMethod; | |
6 | |
7 abstract class AbstractSignatureMethodTest extends \PHPUnit_Framework_TestCase | |
8 { | |
9 protected $name; | |
10 | |
11 /** | |
12 * @return SignatureMethod | |
13 */ | |
14 abstract public function getClass(); | |
15 | |
16 abstract protected function signatureDataProvider(); | |
17 | |
18 public function testGetName() | |
19 { | |
20 $this->assertEquals($this->name, $this->getClass()->getName()); | |
21 } | |
22 | |
23 /** | |
24 * @dataProvider signatureDataProvider | |
25 */ | |
26 public function testBuildSignature($expected, $request, $consumer, $token) | |
27 { | |
28 $this->assertEquals($expected, $this->getClass()->buildSignature($request, $consumer, $token)); | |
29 } | |
30 | |
31 protected function getRequest() | |
32 { | |
33 return $this->getMockBuilder('Abraham\TwitterOAuth\Request') | |
34 ->disableOriginalConstructor() | |
35 ->getMock(); | |
36 } | |
37 | |
38 protected function getConsumer($key = null, $secret = null, $callbackUrl = null) | |
39 { | |
40 return $this->getMockBuilder('Abraham\TwitterOAuth\Consumer') | |
41 ->setConstructorArgs([$key, $secret, $callbackUrl]) | |
42 ->getMock(); | |
43 } | |
44 | |
45 protected function getToken($key = null, $secret = null) | |
46 { | |
47 return $this->getMockBuilder('Abraham\TwitterOAuth\Token') | |
48 ->setConstructorArgs([$key, $secret]) | |
49 ->getMock(); | |
50 } | |
51 } |