Skip to content

Commit

Permalink
Tests: Refresh PHPUnit config
Browse files Browse the repository at this point in the history
  • Loading branch information
GaryJones committed Aug 26, 2024
1 parent 511f8fc commit 6e0931e
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 20 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/.phpunit.cache/
/logs/
/node_modules/
/vendor/
/composer.lock
/.phpcs.xml
/phpcs.xml
/phpunit.xml
/.phpunit.result.cache
41 changes: 25 additions & 16 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,30 +1,39 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/7.2/phpunit.xsd"
bootstrap="tests/bootstrap.php"
beStrictAboutCoversAnnotation="true"
beStrictAboutOutputDuringTests="true"
beStrictAboutTodoAnnotatedTests="true"
colors="true"
defaultTestSuite="unit"
verbose="true">
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.6/phpunit.xsd"
bootstrap="tests/bootstrap.php"
beStrictAboutCoversAnnotation="true"
beStrictAboutOutputDuringTests="true"
beStrictAboutTodoAnnotatedTests="true"
cacheResultFile=".phpunit.cache/test-results"
colors="true"
defaultTestSuite="unit"
executionOrder="depends,defects"
failOnRisky="true"
failOnWarning="true"
testdox="true"
verbose="true"
>
<testsuites>
<testsuite name="unit">
<directory suffix="Test.php">tests/Unit</directory>
<directory>tests/Unit</directory>
</testsuite>
<testsuite name="integration">
<directory suffix="Test.php">tests/Integration</directory>
<directory>tests/Integration</directory>
</testsuite>
</testsuites>

<filter>
<whitelist processUncoveredFilesFromWhitelist="true">
<coverage processUncoveredFiles="true">
<include>
<directory suffix=".php">src</directory>
</whitelist>
</filter>
</include>
<report>
<text outputFile="php://stdout"/>
</report>
</coverage>

<logging>
<log type="coverage-text" target="php://stdout"/>
<!--<log type="coverage-html" target="coverage"/>-->
</logging>
</phpunit>
6 changes: 3 additions & 3 deletions tests/Unit/FooTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,23 +23,23 @@ class FooTest extends TestCase {
/**
* A single example test.
*/
public function test_sample(): void {
public function test_method_asserts_as_true(): void {
// Replace this with some actual testing code.
static::assertTrue( ( new Testee() )->is_true() );
}

/**
* A single example test.
*/
public function test_foo(): void {
public function test_false_asserts_as_false(): void {
// Replace this with some actual testing code.
static::assertFalse( false );
}

/**
* A single example test.
*/
public function test_bar(): void {
public function test_method_call_value_equals_method_call_value(): void {
// Replace this with some actual testing code.
static::assertEquals( 'Foo::bar()', ( new Testee() )->bar() );
}
Expand Down

0 comments on commit 6e0931e

Please sign in to comment.