Skip to content
This repository was archived by the owner on Jan 13, 2022. It is now read-only.

Commit a335ed8

Browse files
Use const for URL parts
1 parent 56d4c3f commit a335ed8

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

tests/Helpers/FacebookRedirectLoginHelperTest.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ class FacebookRedirectLoginHelperTest extends \PHPUnit_Framework_TestCase
4444
protected $redirectLoginHelper;
4545

4646
const REDIRECT_URL = 'http://invalid.zzz';
47+
const FOO_CODE = "foo_code";
48+
const FOO_STATE = "foo_state";
49+
const FOO_PARAM = "some_param=blah";
4750

4851
protected function setUp()
4952
{
@@ -94,10 +97,10 @@ public function testLogoutURL()
9497
public function testAnAccessTokenCanBeObtainedFromRedirect()
9598
{
9699
$this->persistentDataHandler->set('state', 'foo_state');
97-
$_GET['state'] = 'foo_state';
98-
$_GET['code'] = 'foo_code';
100+
$_GET['state'] = static::FOO_STATE;
101+
$_GET['code'] = static::FOO_CODE;
99102

100-
$fullUrl = self::REDIRECT_URL . '?state=foo_state&code=foo_code&some_param=blah';
103+
$fullUrl = self::REDIRECT_URL . '?state=' . static::FOO_STATE . '&code=' . static::FOO_CODE . '&' . static::FOO_PARAM;
101104

102105
$accessToken = $this->redirectLoginHelper->getAccessToken($fullUrl);
103106

0 commit comments

Comments
 (0)