Skip to content

Commit

Permalink
Php unit10 (#124)
Browse files Browse the repository at this point in the history
* Static PHPUnit providers
* Limit PHP upgrades till new PHP version is tested
* Upgrade PHPUnit config schema
  • Loading branch information
phpfui authored Mar 21, 2023
1 parent 1d41ca6 commit 1b8d71d
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 23 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
vendor/
.idea/
composer.lock
.phpunit.cache
.phpunit.result.cache
.vscode
.php-cs-fixer.cache
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

},
"require": {
"php": ">=8.0"
"php": ">=8.0 <8.3"
},
"require-dev": {
"phpunit/phpunit": ">=9.0",
Expand Down
30 changes: 12 additions & 18 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,20 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>

<phpunit backupGlobals="false"
backupStaticAttributes="false"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
convertDeprecationsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
bootstrap="./tests/bootstrap.php"
>

<testsuites>
<testsuite name="Math Executor tests">
<directory>./tests/</directory>
</testsuite>
</testsuites>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
backupGlobals="false"
colors="true"
processIsolation="false"
stopOnFailure="false"
bootstrap="./tests/bootstrap.php"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.0/phpunit.xsd">
<testsuites>
<testsuite name="Math Executor tests">
<directory>./tests/</directory>
</testsuite>
</testsuites>
</phpunit>
8 changes: 4 additions & 4 deletions tests/MathTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public function testCalculating(string $expression) : void
*
* @return array<array<string>>
*/
public function providerExpressions()
public static function providerExpressions()
{
return [
['-5'],
Expand Down Expand Up @@ -295,7 +295,7 @@ public function testBCMathCalculating(string $expression, string $expected = '')
*
* @return array<array<string>>
*/
public function bcMathExpressions()
public static function bcMathExpressions()
{
return [
['-5'],
Expand Down Expand Up @@ -518,7 +518,7 @@ public function testIncorrectExpressionException(string $expression) : void
*
* @return array<array<string>>
*/
public function incorrectExpressions()
public static function incorrectExpressions()
{
return [
['1 * + '],
Expand Down Expand Up @@ -1091,7 +1091,7 @@ public function testCalculatingValues(string $expression, mixed $value) : void
*
* @return array<array<mixed>>
*/
public function providerExpressionValues()
public static function providerExpressionValues()
{
return [
['arccos(0.5)', \acos(0.5)],
Expand Down

0 comments on commit 1b8d71d

Please sign in to comment.