-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14 from Art4/phpunit-10
Phpunit 10 and Code Coverage
- Loading branch information
Showing
58 changed files
with
248 additions
and
292 deletions.
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
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,4 +1,6 @@ | ||
/.code-coverage | ||
/.php-cs-fixer.cache | ||
/.phpunit.cache/ | ||
/.phpunit.result.cache | ||
/composer.lock | ||
/vendor/ |
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,19 +1,18 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/6.5/phpunit.xsd" | ||
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.3/phpunit.xsd" | ||
bootstrap="vendor/autoload.php" | ||
forceCoversAnnotation="true" | ||
beStrictAboutCoversAnnotation="true" | ||
beStrictAboutCoverageMetadata="false" | ||
beStrictAboutOutputDuringTests="true" | ||
beStrictAboutTodoAnnotatedTests="true" | ||
verbose="true"> | ||
<testsuite name="default"> | ||
<directory suffix="Test.php">tests</directory> | ||
</testsuite> | ||
|
||
<filter> | ||
<whitelist processUncoveredFilesFromWhitelist="true"> | ||
<directory suffix=".php">src</directory> | ||
</whitelist> | ||
</filter> | ||
cacheDirectory=".phpunit.cache" | ||
requireCoverageMetadata="false"> | ||
<coverage/> | ||
<testsuite name="default"> | ||
<directory suffix="Test.php">tests</directory> | ||
</testsuite> | ||
<source> | ||
<include> | ||
<directory suffix=".php">src</directory> | ||
</include> | ||
</source> | ||
</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
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 |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Art4\Requests\Tests\Exception\Psr\NetworkException; | ||
|
||
use Art4\Requests\Exception\Psr\NetworkException; | ||
use Psr\Http\Message\RequestInterface; | ||
use WpOrg\Requests\Exception\Transport; | ||
use Yoast\PHPUnitPolyfills\TestCases\TestCase; | ||
|
||
final class GetRequestTest extends TestCase | ||
{ | ||
/** | ||
* Tests receiving the request when using getRequest(). | ||
* | ||
* @covers \Art4\Requests\Exception\Psr\NetworkException::__construct | ||
* @covers \Art4\Requests\Exception\Psr\NetworkException::getRequest | ||
* | ||
* @return void | ||
*/ | ||
public function testGetRequestReturnsRequest() | ||
{ | ||
$request = $this->createMock(RequestInterface::class); | ||
$previous = $this->createMock(Transport::class); | ||
|
||
$exception = new NetworkException($request, $previous); | ||
|
||
$this->assertSame($request, $exception->getRequest()); | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Art4\Requests\Tests\Exception\Psr\RequestException; | ||
|
||
use Art4\Requests\Exception\Psr\RequestException; | ||
use Psr\Http\Message\RequestInterface; | ||
use WpOrg\Requests\Exception\Transport; | ||
use Yoast\PHPUnitPolyfills\TestCases\TestCase; | ||
|
||
final class GetRequestTest extends TestCase | ||
{ | ||
/** | ||
* Tests receiving the request when using getRequest(). | ||
* | ||
* @covers \Art4\Requests\Exception\Psr\RequestException::__construct | ||
* @covers \Art4\Requests\Exception\Psr\RequestException::getRequest | ||
* | ||
* @return void | ||
*/ | ||
public function testGetRequestReturnsRequest() | ||
{ | ||
$request = $this->createMock(RequestInterface::class); | ||
$previous = $this->createMock(Transport::class); | ||
|
||
$exception = new RequestException($request, $previous); | ||
|
||
$this->assertSame($request, $exception->getRequest()); | ||
} | ||
} |
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
Oops, something went wrong.