Skip to content

Commit

Permalink
Update phpunit configuration, #4
Browse files Browse the repository at this point in the history
* Add php-fpm connection data to phpunit.xml
* Remove logging from phpunit.xml
* Move Xdebug filter to auto_prepend_file
* Ignore PHPUnit result cache in VCS
  • Loading branch information
hollodotme committed Jun 8, 2019
1 parent 078d334 commit de239fe
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 30 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/.idea/
/.vagrant/
/vendor/
/build/.phpunit.result.cache
/build/logs/
/composer.lock
32 changes: 17 additions & 15 deletions build/phpunit.xml
Original file line number Diff line number Diff line change
@@ -1,17 +1,24 @@
<phpunit
bootstrap="../tests/bootstrap.php"
verbose="true"
beStrictAboutOutputDuringTests="true"
beStrictAboutTestSize="true"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true">
bootstrap="../tests/bootstrap.php"
verbose="true"
beStrictAboutOutputDuringTests="true"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true">
<php>
<env name="network-socket-host" value="127.0.0.1"/>
<env name="network-socket-port" value="9001"/>
<env name="unix-domain-socket" value="/var/run/php-uds.sock"/>
<env name="restricted-unix-domain-socket" value="/var/run/php-ruds.sock"/>
<env name="non-existing-unix-domain-socket" value="/tmp/not/existing.sock"/>
<env name="invalid-unix-domain-socket" value="/Fixtures/test.sock"/>
</php>
<testsuites>
<testsuite name="FastCGI-Unit">
<testsuite name="Unit">
<directory suffix="Test.php">../tests/Unit</directory>
</testsuite>
<testsuite name="FastCGI-Integration">
<testsuite name="Integration">
<directory suffix="Test.php">../tests/Integration</directory>
</testsuite>
</testsuites>
Expand All @@ -20,9 +27,4 @@
<directory suffix=".php">../src</directory>
</whitelist>
</filter>
<logging>
<log type="coverage-html" target="logs/coverage"/>
<log type="coverage-clover" target="logs/clover.xml"/>
<log type="coverage-text" target="php://stdout" showUncoveredFiles="true"/>
</logging>
</phpunit>
14 changes: 14 additions & 0 deletions build/xdebug-filter.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?php declare(strict_types=1);

if ( !function_exists( 'xdebug_set_filter' ) )
{
return;
}

/** @noinspection PhpUndefinedFunctionInspection */
/** @noinspection PhpUndefinedConstantInspection */
xdebug_set_filter(
XDEBUG_FILTER_CODE_COVERAGE,
XDEBUG_PATH_WHITELIST,
[dirname( __DIR__ ) . '/src']
);
14 changes: 0 additions & 14 deletions tests/bootstrap.php
Original file line number Diff line number Diff line change
@@ -1,17 +1,3 @@
<?php declare(strict_types=1);

if (
extension_loaded( 'xdebug' )
&& version_compare( '2.6.0', phpversion( 'xdebug' ), '<=' )
)
{
/** @noinspection PhpUndefinedFunctionInspection */
/** @noinspection PhpUndefinedConstantInspection */
xdebug_set_filter(
XDEBUG_FILTER_CODE_COVERAGE,
XDEBUG_PATH_WHITELIST,
[dirname( __DIR__ ) . '/src']
);
}

require_once __DIR__ . '/../vendor/autoload.php';

0 comments on commit de239fe

Please sign in to comment.