Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Symfony 6 support #132

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
runs-on: 'ubuntu-latest'
strategy:
matrix:
php: [ '5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0' ]
php: [ '7.3', '7.4', '8.0' ]
steps:
- uses: actions/checkout@v2

Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
],

"require": {
"php": "^5.5.9 || ^7.0.8 || ^7.1.3 || ^7.2.5 || ^8.0.0",
"symfony/http-foundation": "~3.0|~4.0|~5.0"
"php": "^7.3 || ^8.0",
"symfony/http-foundation": "~3.0|~4.0|~5.0|~6.0"
},
"require-dev": {
"phpunit/phpunit": "^5.0 || ^6.0 || ^8.0 || ^9.0.0"
Expand Down
1 change: 0 additions & 1 deletion phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
syntaxCheck="false"
bootstrap="vendor/autoload.php"
>
<testsuites>
Expand Down
2 changes: 1 addition & 1 deletion tests/OAuth2ImplicitGrantTypeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public function testGrantAccessTokenWithGrantImplicit()
'state' => '42',
)));

$this->assertRegExp('/^http:\/\/www.example.com\/\?foo=bar#state=42&access_token=[^"]+&expires_in=3600&token_type=bearer$/', $response->headers->get('Location'));
$this->assertMatchesRegularExpression('/^http:\/\/www.example.com\/\?foo=bar#state=42&access_token=[^"]+&expires_in=3600&token_type=bearer$/', $response->headers->get('Location'));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does assertMatchesRegularExpression work in all phpunit versions supported by the constraint (that you did not update) ?

}

/**
Expand Down
4 changes: 2 additions & 2 deletions tests/OAuth2OutputTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public function testGrantAccessTokenWithGrantAuthCodeSuccess()
$response = $this->fixture->grantAccessToken($request);

// Successful token grant will return a JSON encoded token:
$this->assertRegExp('/{"access_token":".*","expires_in":\d+,"token_type":"bearer"/', $response->getContent());
$this->assertMatchesRegularExpression('/{"access_token":".*","expires_in":\d+,"token_type":"bearer"/', $response->getContent());
}

/**
Expand All @@ -58,7 +58,7 @@ public function testGrantAccessTokenWithGrantAuthCodeSuccessWithoutRedirect()
$response = $this->fixture->grantAccessToken($request);

// Successful token grant will return a JSON encoded token:
$this->assertRegExp('/{"access_token":".*","expires_in":\d+,"token_type":"bearer"/', $response->getContent());
$this->assertMatchesRegularExpression('/{"access_token":".*","expires_in":\d+,"token_type":"bearer"/', $response->getContent());
}

// Utility methods
Expand Down
18 changes: 9 additions & 9 deletions tests/OAuth2Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ public function testGrantAccessTokenWithClientCredentialsSuccess()
$response = $this->fixture->grantAccessToken($request);

// Successful token grant will return a JSON encoded token WITHOUT a refresh token:
$this->assertRegExp('/^{"access_token":"[^"]+","expires_in":[^"]+,"token_type":"bearer","scope":null}$/', $response->getContent());
$this->assertMatchesRegularExpression('/^{"access_token":"[^"]+","expires_in":[^"]+,"token_type":"bearer","scope":null}$/', $response->getContent());
}

/**
Expand Down Expand Up @@ -425,7 +425,7 @@ public function testGrantAccessTokenWithGrantUser()
array('date' => null)
));

$this->assertRegExp('{"access_token":"[^"]+","expires_in":3600,"token_type":"bearer","scope":null}', $response->getContent());
$this->assertMatchesRegularExpression('{"access_token":"[^"]+","expires_in":3600,"token_type":"bearer","scope":null}', $response->getContent());

$token = $stub->getLastAccessToken();
$this->assertSame('cid', $token->getClientId());
Expand Down Expand Up @@ -490,7 +490,7 @@ public function testGrantAccessTokenWithGrantUserWithScope()
array('date' => null)
));

$this->assertRegExp('{"access_token":"[^"]+","expires_in":3600,"token_type":"bearer","scope":"scope1 scope2"}', $response->getContent());
$this->assertMatchesRegularExpression('{"access_token":"[^"]+","expires_in":3600,"token_type":"bearer","scope":"scope1 scope2"}', $response->getContent());

$token = $stub->getLastAccessToken();
$this->assertSame('cid', $token->getClientId());
Expand Down Expand Up @@ -524,7 +524,7 @@ public function testGrantAccessTokenWithGrantUserWithReducedScope()
array('date' => null)
));

$this->assertRegExp('{"access_token":"[^"]+","expires_in":3600,"token_type":"bearer","scope":"scope1"}', $response->getContent());
$this->assertMatchesRegularExpression('{"access_token":"[^"]+","expires_in":3600,"token_type":"bearer","scope":"scope1"}', $response->getContent());

$token = $stub->getLastAccessToken();
$this->assertSame('cid', $token->getClientId());
Expand Down Expand Up @@ -557,7 +557,7 @@ public function testGrantAccessTokenWithGrantUserWithNoScope()
array('date' => null)
));

$this->assertRegExp('{"access_token":"[^"]+","expires_in":3600,"token_type":"bearer","scope":"scope1 scope2"}', $response->getContent());
$this->assertMatchesRegularExpression('{"access_token":"[^"]+","expires_in":3600,"token_type":"bearer","scope":"scope1 scope2"}', $response->getContent());

$token = $stub->getLastAccessToken();
$this->assertSame('cid', $token->getClientId());
Expand Down Expand Up @@ -646,7 +646,7 @@ public function testGrantAccessTokenWithGrantExtension()
array('date' => null)
));

$this->assertRegExp('{"access_token":"[^"]+","expires_in":3600,"token_type":"bearer"}', $response->getContent());
$this->assertMatchesRegularExpression('{"access_token":"[^"]+","expires_in":3600,"token_type":"bearer"}', $response->getContent());
}

/**
Expand Down Expand Up @@ -682,7 +682,7 @@ public function testGrantAccessTokenWithGrantExtensionLimitedLifetime()
array('date' => null)
));

$this->assertRegExp('{"access_token":"[^"]+","expires_in":86400,"token_type":"bearer"}', $response->getContent());
$this->assertMatchesRegularExpression('{"access_token":"[^"]+","expires_in":86400,"token_type":"bearer"}', $response->getContent());
}

/**
Expand Down Expand Up @@ -719,7 +719,7 @@ public function testGrantAccessTokenWithGrantExtensionJwtBearer()
array('date' => null)
));

$this->assertRegExp('{"access_token":"[^"]+","expires_in":3600,"token_type":"bearer","scope":null,"refresh_token":"[^"]+"}', $response->getContent());
$this->assertMatchesRegularExpression('{"access_token":"[^"]+","expires_in":3600,"token_type":"bearer","scope":null,"refresh_token":"[^"]+"}', $response->getContent());

$token = $stub->getLastAccessToken();
$this->assertSame('cid', $token->getClientId());
Expand Down Expand Up @@ -760,7 +760,7 @@ public function testFinishClientAuthorization()
)));

$this->assertSame(302, $response->getStatusCode());
$this->assertRegExp('#^http://www\.example\.com/\?foo=bar&state=42&code=#', $response->headers->get('location'));
$this->assertMatchesRegularExpression('#^http://www\.example\.com/\?foo=bar&state=42&code=#', $response->headers->get('location'));

$code = $stub->getLastAuthCode();
$this->assertSame('blah', $code->getClientId());
Expand Down
Loading