9
9
10
10
use Joomla \Application \WebApplicationInterface ;
11
11
use Joomla \Http \Http ;
12
+ use Joomla \Http \Response ;
12
13
use Joomla \Input \Input ;
13
14
use Joomla \OAuth2 \Client ;
14
15
use Joomla \Registry \Registry ;
@@ -348,11 +349,11 @@ public function testRefreshTokenJson()
348
349
*/
349
350
public function encodedGrantOauthCallback ($ url , $ data , ?array $ headers = null , $ timeout = null )
350
351
{
351
- $ response = new \stdClass ();
352
+ $ code = 200 ;
353
+ $ headers = ['Content-Type ' => 'x-www-form-urlencoded ' ];
354
+ $ body = 'access_token=accessvalue&refresh_token=refreshvalue&expires_in=3600 ' ;
352
355
353
- $ response ->code = 200 ;
354
- $ response ->headers = ['Content-Type ' => 'x-www-form-urlencoded ' ];
355
- $ response ->body = 'access_token=accessvalue&refresh_token=refreshvalue&expires_in=3600 ' ;
356
+ $ response = new Response ($ body , $ code , $ headers );
356
357
357
358
return $ response ;
358
359
}
@@ -369,11 +370,11 @@ public function encodedGrantOauthCallback($url, $data, ?array $headers = null, $
369
370
*/
370
371
public function jsonGrantOauthCallback ($ url , $ data , ?array $ headers = null , $ timeout = null )
371
372
{
372
- $ response = new \stdClass ();
373
+ $ code = 200 ;
374
+ $ headers = ['Content-Type ' => 'application/json ' ];
375
+ $ body = '{"access_token":"accessvalue","refresh_token":"refreshvalue","expires_in":3600} ' ;
373
376
374
- $ response ->code = 200 ;
375
- $ response ->headers = ['Content-Type ' => 'application/json ' ];
376
- $ response ->body = '{"access_token":"accessvalue","refresh_token":"refreshvalue","expires_in":3600} ' ;
377
+ $ response = new Response ($ body , $ code , $ headers );
377
378
378
379
return $ response ;
379
380
}
@@ -390,11 +391,11 @@ public function jsonGrantOauthCallback($url, $data, ?array $headers = null, $tim
390
391
*/
391
392
public function queryOauthCallback ($ url , $ data , ?array $ headers = null , $ timeout = null )
392
393
{
393
- $ response = new \stdClass ();
394
+ $ code = 200 ;
395
+ $ headers = ['Content-Type ' => 'text/html ' ];
396
+ $ body = 'Lorem ipsum dolor sit amet. ' ;
394
397
395
- $ response ->code = 200 ;
396
- $ response ->headers = ['Content-Type ' => 'text/html ' ];
397
- $ response ->body = 'Lorem ipsum dolor sit amet. ' ;
398
+ $ response = new Response ($ body , $ code , $ headers );
398
399
399
400
return $ response ;
400
401
}
@@ -410,11 +411,11 @@ public function queryOauthCallback($url, $data, ?array $headers = null, $timeout
410
411
*/
411
412
public function getOauthCallback ($ url , ?array $ headers = null , $ timeout = null )
412
413
{
413
- $ response = new \stdClass ();
414
+ $ code = 200 ;
415
+ $ headers = ['Content-Type ' => 'text/html ' ];
416
+ $ body = 'Lorem ipsum dolor sit amet. ' ;
414
417
415
- $ response ->code = 200 ;
416
- $ response ->headers = ['Content-Type ' => 'text/html ' ];
417
- $ response ->body = 'Lorem ipsum dolor sit amet. ' ;
418
+ $ response = new Response ($ body , $ code , $ headers );
418
419
419
420
return $ response ;
420
421
}
0 commit comments