File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ namespace ApiClients \Tests \Tools \Psr7 \Oauth1 \RequestSigning ;
4
+
5
+ use ApiClients \Tools \Psr7 \Oauth1 \Definition \AccessToken ;
6
+ use ApiClients \Tools \Psr7 \Oauth1 \Definition \ConsumerKey ;
7
+ use ApiClients \Tools \Psr7 \Oauth1 \Definition \ConsumerSecret ;
8
+ use ApiClients \Tools \Psr7 \Oauth1 \Definition \TokenSecret ;
9
+ use ApiClients \Tools \Psr7 \Oauth1 \RequestSigning \RequestSigner ;
10
+
11
+ class RequestSignerTest extends \PHPUnit_Framework_TestCase
12
+ {
13
+ public function testImmutability ()
14
+ {
15
+ $ requestSigner = new RequestSigner (
16
+ new ConsumerKey ('consumer_key ' ),
17
+ new ConsumerSecret ('consumer_secret ' )
18
+ );
19
+ $ requestSignerWithAccessToken = $ requestSigner ->withAccessToken (
20
+ new AccessToken ('access_token ' ),
21
+ new TokenSecret ('token_secret ' )
22
+ );
23
+ $ this ->assertNotSame ($ requestSigner , $ requestSignerWithAccessToken );
24
+ $ requestSignerWithAccessTokenWithoutAccessToken = $ requestSignerWithAccessToken ->withoutAccessToken ();
25
+ $ this ->assertNotSame ($ requestSigner , $ requestSignerWithAccessTokenWithoutAccessToken );
26
+ $ this ->assertNotSame ($ requestSignerWithAccessToken , $ requestSignerWithAccessTokenWithoutAccessToken );
27
+ $ this ->assertEquals ($ requestSigner , $ requestSignerWithAccessTokenWithoutAccessToken );
28
+ }
29
+ }
You can’t perform that action at this time.
0 commit comments