-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve tests and require strict metadata coverage (#359)
- Loading branch information
1 parent
303bb6c
commit ad65344
Showing
38 changed files
with
1,323 additions
and
153 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
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,13 +1,22 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="./vendor/autoload.php" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.3/phpunit.xsd" displayDetailsOnTestsThatTriggerWarnings="true" cacheDirectory=".phpunit.cache"> | ||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/11.2/phpunit.xsd" | ||
bootstrap="./vendor/autoload.php" | ||
cacheDirectory=".phpunit.cache" | ||
executionOrder="depends,defects" | ||
beStrictAboutOutputDuringTests="true" | ||
failOnRisky="true" failOnWarning="true" | ||
displayDetailsOnTestsThatTriggerWarnings="true" | ||
beStrictAboutCoverageMetadata="true" | ||
requireCoverageMetadata="true"> | ||
<testsuites> | ||
<testsuite name="better-video-rss"> | ||
<directory suffix=".php">./tests/</directory> | ||
<testsuite name="default"> | ||
<directory>./tests/</directory> | ||
</testsuite> | ||
</testsuites> | ||
<source> | ||
<source restrictNotices="true" restrictWarnings="true"> | ||
<include> | ||
<directory suffix=".php">./include/</directory> | ||
<directory>./include/</directory> | ||
</include> | ||
</source> | ||
</phpunit> | ||
</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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?php | ||
|
||
use PHPUnit\Framework\TestCase as TestCase; | ||
use App\Config; | ||
|
||
abstract class AbstractTestCase extends TestCase | ||
{ | ||
/** | ||
* Create config class stub | ||
* | ||
* Array example: `['getSelfUrl' => 'https://example.com/', 'getTimezone' => 'UTC']` | ||
* | ||
* @param array<string, mixed> $methods | ||
* @return PHPUnit\Framework\MockObject\Stub&Config | ||
*/ | ||
protected static function createConfigStub(array $methods): Config | ||
{ | ||
/** @var PHPUnit\Framework\MockObject\Stub&Config */ | ||
$config = self::createStub(Config::class); | ||
|
||
foreach ($methods as $method => $value) { | ||
$config->method($method)->willReturn($value); | ||
} | ||
|
||
return $config; | ||
} | ||
} |
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.