Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update phpunit #799

Merged
merged 6 commits into from
Sep 15, 2023
Merged

Update phpunit #799

merged 6 commits into from
Sep 15, 2023

Conversation

coudot
Copy link
Member

@coudot coudot commented Sep 6, 2023

  • Update tests to recent phpunit versions
  • Add a workflow in github

@coudot coudot added this to the 1.6.0 milestone Sep 6, 2023
@coudot coudot changed the base branch from 1.5 to master September 6, 2023 15:20
@markus-96
Copy link
Contributor

It seams to me that you are missing some configuration. I got it to work with these additions:
In ci.yml, replace uses: php-actions/phpunit@v3 with the following:

        - name: PHPUnit Tests for php7.4
        uses: php-actions/phpunit@v3
        env:
          TEST_NAME: Scarlett
        with:
          bootstrap: lib/vendor/autoload.php
          configuration: tests/phpunit.xml
          version: 5.7.25
          php_version: 7.4
          args: --coverage-text

This will test against php7.4, for other versions of php you can add additional blocks.

The phpunit.xml can look like this (working for me):

<?xml version="1.0"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" colors="true" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
	<coverage>
		<include>
			<directory suffix=".php">../../src</directory>
		</include>
		<report>
			<html outputDirectory="./_coverage" lowUpperBound="35" highLowerBound="70"/>
			<text outputFile="php://stdout" showUncoveredFiles="true"/>
		</report>
	</coverage>
	<testsuites>
		<testsuite name="main">
			<directory suffix="Test.php">.</directory>
		</testsuite>
	</testsuites>
	<logging/>
</phpunit>

The things about coverage tests can be removed I think..

@coudot
Copy link
Member Author

coudot commented Sep 15, 2023

Thanks @markus-96, it is now working!

@coudot coudot merged commit f8c6e00 into master Sep 15, 2023
1 check passed
@coudot coudot deleted the update-phpunit branch September 15, 2023 12:58
@markus-96
Copy link
Contributor

Thanks @markus-96, it is now working!

Happy to hear that!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants