Skip to content

Commit f34a6a4

Browse files
Merge pull request #91 from Hi-Folks/feat/phpunit
Feat/phpunit
2 parents 09a3786 + 4ffce5e commit f34a6a4

20 files changed

Lines changed: 981 additions & 1052 deletions

.github/workflows/dependabot-auto-merge.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,19 @@ jobs:
1010
runs-on: ubuntu-latest
1111
if: ${{ github.actor == 'dependabot[bot]' }}
1212
steps:
13-
1413
- name: Dependabot metadata
1514
id: metadata
1615
uses: dependabot/fetch-metadata@v2.5.0
1716
with:
1817
github-token: "${{ secrets.GITHUB_TOKEN }}"
19-
18+
2019
- name: Auto-merge Dependabot PRs for semver-minor updates
2120
if: ${{steps.metadata.outputs.update-type == 'version-update:semver-minor'}}
2221
run: gh pr merge --auto --merge "$PR_URL"
2322
env:
2423
PR_URL: ${{github.event.pull_request.html_url}}
2524
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
26-
25+
2726
- name: Auto-merge Dependabot PRs for semver-patch updates
2827
if: ${{steps.metadata.outputs.update-type == 'version-update:semver-patch'}}
2928
run: gh pr merge --auto --merge "$PR_URL"

.github/workflows/run-tests.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ jobs:
99
fail-fast: true
1010
matrix:
1111
os: [ubuntu-latest, windows-latest]
12-
php: [8.1, 8.2, 8.3, 8.4]
12+
php: [8.2, 8.3, 8.4, 8.5]
1313
exclude:
1414
- os: windows-latest
15-
php: [8.1, 8.2, 8.4]
15+
php: [8.2, 8.3, 8.5]
1616

1717
name: P${{ matrix.php }} - ${{ matrix.os }}
1818

@@ -25,7 +25,7 @@ jobs:
2525
with:
2626
php-version: ${{ matrix.php }}
2727
extensions: dom, curl, libxml, mbstring, zip, pcntl, bcmath, soap, intl, iconv, fileinfo
28-
coverage: none
28+
coverage: xdebug
2929

3030
- name: Setup problem matchers
3131
run: |

.github/workflows/static-code-analysis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
fail-fast: true
1010
matrix:
1111
os: [ubuntu-latest]
12-
php: [8.3]
12+
php: [8.4]
1313
stability: [prefer-stable]
1414

1515
name: P${{ matrix.php }} - ${{ matrix.stability }} - ${{ matrix.os }}

.php-cs-fixer.dist.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?php
2+
3+
$finder = (new PhpCsFixer\Finder())
4+
->in([
5+
__DIR__ . '/src',
6+
__DIR__ . '/tests',
7+
]);
8+
9+
return (new PhpCsFixer\Config())
10+
->setRules([
11+
'@PER-CS' => true,
12+
])
13+
->setFinder($finder);

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## 1.2.0 - 2025-11-23
4+
- Welcome to PHP 8.5
5+
- Upgrading to PHPstan new rules (offsetAccess)
6+
37
## 1.1.4 - 2025-04-25
48
- Adding `fmean()` method for computing the arithmetic mean with float numbers.
59

composer.json

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,13 @@
1515
}
1616
],
1717
"require": {
18-
"php": "^8.1|^8.2|^8.3|^8.4"
18+
"php": "^8.2|^8.3|^8.4"
1919
},
2020
"require-dev": {
21-
"laravel/pint": "^1.18",
22-
"pestphp/pest": "^2.0",
21+
"friendsofphp/php-cs-fixer": "^3.65",
2322
"phpstan/phpstan": "^2",
23+
"phpstan/phpstan-phpunit": "^2.0",
24+
"phpunit/phpunit": "^11.0",
2425
"rector/rector": "^2"
2526
},
2627
"autoload": {
@@ -34,9 +35,9 @@
3435
}
3536
},
3637
"scripts": {
37-
"format": "vendor/bin/pint",
38-
"test": "vendor/bin/pest",
39-
"test-coverage": "vendor/bin/pest --coverage",
38+
"format": "vendor/bin/php-cs-fixer fix",
39+
"test": "vendor/bin/phpunit",
40+
"test-coverage": "vendor/bin/phpunit --coverage-text",
4041
"static-code": "vendor/bin/phpstan analyse -c phpstan.neon",
4142
"rector-dry-run": "rector process --dry-run",
4243
"rector": "rector process",
@@ -48,9 +49,7 @@
4849
},
4950
"config": {
5051
"sort-packages": true,
51-
"allow-plugins": {
52-
"pestphp/pest-plugin": true
53-
}
52+
"allow-plugins": {}
5453
},
5554
"minimum-stability": "dev",
5655
"prefer-stable": true

phpstan.neon

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1+
includes:
2+
- vendor/phpstan/phpstan-phpunit/extension.neon
3+
14
parameters:
25
level: 8
36
treatPhpDocTypesAsCertain: false
47
paths:
58
- src
9+
- tests

phpunit.xml.dist

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<phpunit
33
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4-
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.4/phpunit.xsd"
4+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/11.0/phpunit.xsd"
55
bootstrap="vendor/autoload.php"
66
colors="true"
77
executionOrder="random"
@@ -13,7 +13,7 @@
1313
>
1414
<testsuites>
1515
<testsuite name="HiFolks Test Suite">
16-
<directory>tests</directory>
16+
<directory suffix=".php">tests</directory>
1717
</testsuite>
1818
</testsuites>
1919
<coverage>

pint.json

Lines changed: 0 additions & 3 deletions
This file was deleted.

tests/ArchTest.php

Lines changed: 0 additions & 24 deletions
This file was deleted.

0 commit comments

Comments
 (0)