-
Notifications
You must be signed in to change notification settings - Fork 22
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
Add support for PHPUnit10 and remove support for PHPUnit8 #60
Closed
Closed
Changes from 7 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
f9481d3
Add support for PHPUnit10 and remove support for PHPUnit8
nyamsprod 49564cf
Normalize class import and class alias
nyamsprod bc181d2
Resolve conflict
nyamsprod eb7f256
Resolve conflict
nyamsprod 929e905
Merge branch '1.x' into feature/support-phpunit-10
nyamsprod 4d0104a
Remove PHP7.2 from github workflows
nyamsprod f14ca35
Migrate phpunit.xml.dist configuration file
nyamsprod abc024e
Using FQN for PSR interfaces
nyamsprod File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,3 +13,4 @@ | |
/phpunit.xml.dist export-ignore | ||
/spec/ export-ignore | ||
/tests/ export-ignore | ||
/.phpunit.cache/ export-ignore | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
/.tmp | ||
/.phpunit.result.cache | ||
/.phpunit.cache | ||
/behat.yml | ||
/build/ | ||
/composer.lock | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -14,9 +14,9 @@ | |||||
} | ||||||
], | ||||||
"require": { | ||||||
"php": "^7.2 || ^8.0", | ||||||
"phpunit/phpunit": "^8.0 || ^9.3", | ||||||
"psr/http-message": "^1.0 || ^2.0" | ||||||
"php": "^7.3 || ^8.0", | ||||||
nyamsprod marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
"phpunit/phpunit": "^9.3 || ^10.0", | ||||||
nyamsprod marked this conversation as resolved.
Show resolved
Hide resolved
nyamsprod marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
"psr/http-message": "^1.0" | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
we should keep allowing http-message 2.0. i think this was one of the merge conflicts. |
||||||
}, | ||||||
"require-dev": { | ||||||
"guzzlehttp/psr7": "^1.7 || ^2.0", | ||||||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,39 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<phpunit backupGlobals="false" | ||
backupStaticAttributes="true" | ||
colors="true" | ||
convertErrorsToExceptions="true" | ||
convertNoticesToExceptions="true" | ||
convertWarningsToExceptions="true" | ||
processIsolation="false" | ||
stopOnFailure="false" | ||
bootstrap="vendor/autoload.php" | ||
> | ||
<phpunit | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
backupGlobals="false" | ||
colors="true" | ||
processIsolation="false" | ||
stopOnFailure="false" | ||
bootstrap="vendor/autoload.php" | ||
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.0/phpunit.xsd" | ||
cacheDirectory=".phpunit.cache" | ||
backupStaticProperties="true" | ||
> | ||
<coverage> | ||
<include> | ||
<directory>./</directory> | ||
</include> | ||
<exclude> | ||
<directory>./Tests</directory> | ||
<directory>./vendor</directory> | ||
</exclude> | ||
</coverage> | ||
<testsuites> | ||
<testsuite name="Guzzle"> | ||
<directory>./tests/Guzzle/</directory> | ||
</testsuite> | ||
|
||
<testsuite name="RingCentral"> | ||
<directory>./tests/RingCentral/</directory> | ||
</testsuite> | ||
|
||
<testsuite name="Slim"> | ||
<directory>./tests/Slim/</directory> | ||
<directory>./tests/Slim/</directory> | ||
</testsuite> | ||
|
||
<testsuite name="Laminas"> | ||
<directory>./tests/Laminas/</directory> | ||
<directory>./tests/Laminas/</directory> | ||
</testsuite> | ||
|
||
<testsuite name="Nyholm"> | ||
<directory>./vendor/nyholm/psr7/tests/Integration/</directory> | ||
<directory>./vendor/nyholm/psr7/tests/Integration/</directory> | ||
</testsuite> | ||
</testsuites> | ||
|
||
<filter> | ||
<whitelist> | ||
<directory>./</directory> | ||
<exclude> | ||
<directory>./Tests</directory> | ||
<directory>./vendor</directory> | ||
</exclude> | ||
</whitelist> | ||
</filter> | ||
</phpunit> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,12 +5,12 @@ | |
use GuzzleHttp\Psr7\Stream as GuzzleStream; | ||
use GuzzleHttp\Psr7\UploadedFile as GuzzleUploadedFile; | ||
use GuzzleHttp\Psr7\Uri as GuzzleUri; | ||
use GuzzleHttp\Psr7\Utils as GuzzleUtils; | ||
use Laminas\Diactoros\StreamFactory as LaminasStreamFactory; | ||
use Laminas\Diactoros\Uri as LaminasUri; | ||
use Laminas\Diactoros\UploadedFile as LaminasUploadedFile; | ||
use Nyholm\Psr7\Factory\Psr17Factory as NyholmFactory; | ||
use PHPUnit\Framework\TestCase; | ||
use Psr\Http\Message\UriInterface; | ||
use RingCentral\Psr7\Uri as RingCentralUri; | ||
use function RingCentral\Psr7\stream_for as ring_central_stream_for; | ||
use Slim\Psr7\Uri as SlimUri; | ||
|
@@ -33,11 +33,11 @@ protected function buildUri($uri) | |
if (defined('URI_FACTORY')) { | ||
$factoryClass = URI_FACTORY; | ||
$factory = new $factoryClass(); | ||
if ($factory instanceof \Http\Message\UriFactory) { | ||
if ($factory instanceof PsrUriFactory) { | ||
dbu marked this conversation as resolved.
Show resolved
Hide resolved
|
||
return $factory->createUri($uri); | ||
} | ||
if ($factory instanceof \Psr\Http\Message\UriFactoryInterface) { | ||
nyamsprod marked this conversation as resolved.
Show resolved
Hide resolved
|
||
if ($uri instanceof UriInterface) { | ||
if ($factory instanceof PsrUriFactoryInterface) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. missing |
||
if ($uri instanceof PsrUriInterface) { | ||
dbu marked this conversation as resolved.
Show resolved
Hide resolved
|
||
return $uri; | ||
} | ||
|
||
|
@@ -79,10 +79,10 @@ protected function buildStream($data) | |
if (defined('STREAM_FACTORY')) { | ||
$factoryClass = STREAM_FACTORY; | ||
$factory = new $factoryClass(); | ||
if ($factory instanceof \Http\Message\StreamFactory) { | ||
if ($factory instanceof HttpPlugStreamFactory) { | ||
dbu marked this conversation as resolved.
Show resolved
Hide resolved
|
||
return $factory->createStream($data); | ||
} | ||
if ($factory instanceof \Psr\Http\Message\StreamFactoryInterface) { | ||
if ($factory instanceof PsrStreamFactoryInterface) { | ||
if (is_string($data)) { | ||
return $factory->createStream($data); | ||
} | ||
|
@@ -94,7 +94,7 @@ protected function buildStream($data) | |
} | ||
|
||
if (class_exists(GuzzleStream::class)) { | ||
return \GuzzleHttp\Psr7\Utils::streamFor($data); | ||
return GuzzleUtils::streamFor($data); | ||
} | ||
|
||
$factory = null; | ||
|
@@ -127,7 +127,7 @@ protected function buildUploadableFile($data) | |
if (defined('UPLOADED_FILE_FACTORY')) { | ||
$factoryClass = UPLOADED_FILE_FACTORY; | ||
$factory = new $factoryClass(); | ||
if (!$factory instanceof \Psr\Http\Message\UploadedFileFactoryInterface) { | ||
if (!$factory instanceof PsrUploadedFileFactoryInterface) { | ||
throw new \RuntimeException('Constant "UPLOADED_FILE_FACTORY" must be a reference to a Psr\Http\Message\UploadedFileFactoryInterface'); | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is not committed and should not.
.gitattributes
tells github what to exclude when downloading the zip of a repository. we instead want tot add this in.gitignore