Skip to content

Commit

Permalink
fix: fix failing tests, by not forking process while running tests
Browse files Browse the repository at this point in the history
  • Loading branch information
bhushan committed Aug 21, 2023
1 parent 5229e30 commit 9dbb904
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
15 changes: 15 additions & 0 deletions phpunit.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
bootstrap="vendor/autoload.php"
colors="true"
>
<testsuites>
<testsuite name="Unit">
<directory>tests/Unit</directory>
</testsuite>
</testsuites>
<php>
<const name="ARE_TESTS_RUNNING" value="true"/>
</php>
</phpunit>
2 changes: 1 addition & 1 deletion src/Treblle.php
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ public function onShutdown(): void
$payload = '{}';
}

if (!\function_exists('pcntl_fork')) {
if (!\function_exists('pcntl_fork') || (\defined('ARE_TESTS_RUNNING') && ARE_TESTS_RUNNING)) {
$this->collectData($payload);

return;
Expand Down

0 comments on commit 9dbb904

Please sign in to comment.