@@ -10,7 +10,7 @@ public function getProxy($mock)
10
10
return new AuthorizationServerProxy ($ mock );
11
11
}
12
12
13
- public function getMock ()
13
+ public function getServer ()
14
14
{
15
15
return m::mock ('League\OAuth2\Server\Authorization ' );
16
16
}
@@ -29,7 +29,7 @@ public function getStub()
29
29
30
30
public function test_make_redirect ()
31
31
{
32
- $ proxy = $ this ->getProxy ($ this ->getMock ());
32
+ $ proxy = $ this ->getProxy ($ this ->getServer ());
33
33
34
34
$ result = $ proxy ->makeRedirect ('example ' );
35
35
@@ -38,7 +38,7 @@ public function test_make_redirect()
38
38
39
39
public function test_make_redirect_with_code ()
40
40
{
41
- $ proxy = $ this ->getProxy ($ this ->getMock ());
41
+ $ proxy = $ this ->getProxy ($ this ->getServer ());
42
42
43
43
$ result = $ proxy ->makeRedirectWithCode ('1234567890 ' , array ('redirect_uri ' => 'example ' ));
44
44
@@ -51,7 +51,7 @@ public function test_make_redirect_with_code()
51
51
52
52
public function test_make_redirect_with_error ()
53
53
{
54
- $ mock = $ this ->getMock ();
54
+ $ mock = $ this ->getServer ();
55
55
$ mock ->shouldReceive ('getExceptionMessage ' )->twice ()->andReturn ('error_message ' );
56
56
57
57
$ proxy = $ this ->getProxy ($ mock );
@@ -67,7 +67,7 @@ public function test_make_redirect_with_error()
67
67
68
68
public function test_check_authorize_params ()
69
69
{
70
- $ mock = $ this ->getMock ();
70
+ $ mock = $ this ->getServer ();
71
71
$ mock ->shouldReceive ('getGrantType->checkAuthoriseParams ' )->andReturn ($ this ->getStub ());
72
72
73
73
$ response = $ this ->getProxy ($ mock )->checkAuthorizeParams ();
@@ -77,7 +77,7 @@ public function test_check_authorize_params()
77
77
78
78
public function test_access_token_correctly_issued ()
79
79
{
80
- $ mock = $ this ->getMock ();
80
+ $ mock = $ this ->getServer ();
81
81
$ mock ->shouldReceive ('issueAccessToken ' )->once ()->andReturn (array ('foo ' => 'bar ' ));
82
82
83
83
$ response = $ this ->getProxy ($ mock )->performAccessTokenFlow ();
@@ -89,7 +89,7 @@ public function test_access_token_correctly_issued()
89
89
90
90
public function test_access_token_with_client_error ()
91
91
{
92
- $ mock = $ this ->getMock ();
92
+ $ mock = $ this ->getServer ();
93
93
$ mock ->shouldReceive ('issueAccessToken ' )->once ()->andThrow (new League \OAuth2 \Server \Exception \ClientException ('client exception ' ));
94
94
$ mock ->shouldReceive ('getExceptionType ' )->twice ()->andReturn ('foo ' );
95
95
$ mock ->shouldReceive ('getExceptionHttpHeaders ' )->once ()->andReturn (array ());
@@ -103,7 +103,7 @@ public function test_access_token_with_client_error()
103
103
104
104
public function test_access_token_with_generic_error ()
105
105
{
106
- $ mock = $ this ->getMock ();
106
+ $ mock = $ this ->getServer ();
107
107
$ mock ->shouldReceive ('issueAccessToken ' )->once ()->andThrow (new Exception ('internal server error ' ));
108
108
109
109
$ response = $ this ->getProxy ($ mock )->performAccessTokenFlow ();
@@ -115,7 +115,7 @@ public function test_access_token_with_generic_error()
115
115
116
116
public function test_calls_to_underlying_object ()
117
117
{
118
- $ mock = $ this ->getMock ();
118
+ $ mock = $ this ->getServer ();
119
119
$ mock ->shouldReceive ('unexistingMethod ' )->times (6 )->andReturn ('baz ' );
120
120
121
121
$ proxy = $ this ->getProxy ($ mock );
0 commit comments