File tree 2 files changed +34
-1
lines changed 2 files changed +34
-1
lines changed Original file line number Diff line number Diff line change 13
13
"psr/http-message" : " ^2.0"
14
14
},
15
15
"require-dev" : {
16
- "guzzlehttp/guzzle" : " ^6.5.8 || ^7.4.5"
16
+ "guzzlehttp/guzzle" : " ^6.5.8 || ^7.4.5" ,
17
17
"mockery/mockery" : " ^1.3.5" ,
18
18
"php-parallel-lint/php-parallel-lint" : " ^1.4" ,
19
19
"phpunit/phpunit" : " ^7 || ^8 || ^9 || ^10 || ^11" ,
Original file line number Diff line number Diff line change 2
2
3
3
namespace League \OAuth2 \Client \Test \Provider ;
4
4
5
+ use InvalidArgumentException ;
5
6
use League \OAuth2 \Client \OptionProvider \PostAuthOptionProvider ;
6
7
use Mockery ;
7
8
use PHPUnit \Framework \Attributes \DataProvider ;
@@ -62,6 +63,38 @@ public function testInvalidGrantObject()
62
63
$ this ->getMockProvider ()->getAccessToken ($ grant , ['invalid_parameter ' => 'none ' ]);
63
64
}
64
65
66
+ public function testMissingRequestFactory ()
67
+ {
68
+ $ this ->expectException (InvalidArgumentException::class);
69
+ $ this ->expectExceptionMessage ('No request factory set ' );
70
+ $ provider = new Fake ();
71
+ }
72
+
73
+ public function testMissingStreamFactory ()
74
+ {
75
+ $ this ->expectException (InvalidArgumentException::class);
76
+ $ this ->expectExceptionMessage ('No stream factory set ' );
77
+ $ provider = new Fake (
78
+ [],
79
+ [
80
+ 'requestFactory ' => new HttpFactory ()
81
+ ]
82
+ );
83
+ }
84
+
85
+ public function testMissingHttpClient ()
86
+ {
87
+ $ this ->expectException (InvalidArgumentException::class);
88
+ $ this ->expectExceptionMessage ('No http client set ' );
89
+ $ provider = new Fake (
90
+ [],
91
+ [
92
+ 'requestFactory ' => new HttpFactory (),
93
+ 'streamFactory ' => new HttpFactory ()
94
+ ]
95
+ );
96
+ }
97
+
65
98
public function testAuthorizationUrlStateParam ()
66
99
{
67
100
$ authUrl = $ this ->getMockProvider ()->getAuthorizationUrl ([
You can’t perform that action at this time.
0 commit comments