Skip to content

Commit 3d2ae24

Browse files
Merge pull request #113 from jmleroux/phpunit
test: introduce PhpUnit
2 parents 453b74d + f857352 commit 3d2ae24

26 files changed

Lines changed: 481 additions & 380 deletions

.github/workflows/php.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,8 @@ jobs:
5858
- name: Coding Standard Checks
5959
run: docker compose run --rm ${{ matrix.container }} bin/php-cs-fixer fix --verbose --diff --dry-run
6060

61-
- name: Run tests (phpspec)
62-
run: docker compose run --rm ${{ matrix.container }} ./bin/phpspec run --format=pretty
63-
64-
- name: Run coverage tests (phpspec)
65-
run: docker compose run --rm ${{ matrix.container }} bash -c "XDEBUG_MODE=coverage bin/phpspec run -f progress -c phpspec-coverage.yml"
61+
- name: Unit tests
62+
run: docker compose run --rm ${{ matrix.container }} ./bin/phpunit
6663

6764
- name: Run behat tests
6865
run: docker compose run --rm ${{ matrix.container }} ./bin/behat --snippets-for

.php-cs-fixer.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
'binary_operator_spaces' => ['operators' => ['=>' => 'align', '=' => 'align']],
1919
'phpdoc_align' => ['align' => 'vertical'],
2020
'phpdoc_summary' => false,
21+
'php_unit_test_annotation' => ['style' => 'annotation'],
2122
])
2223
->setFinder($finder)
2324
;

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
## [v3.2.0] - 2025-10-13
2+
3+
### Added
4+
* add phpunit/phpunit composer dependency
5+
6+
### Removed
7+
* remove PhpSpec
8+
9+
### Changed
10+
* convert specs to PhpUnit tests
11+
12+
113
## [v3.1.0] - 2024-01-07
214

315
### Added

composer.json

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,8 @@
2323
"psr-4": { "PUGX\\Poser\\": "src/" }
2424
},
2525
"autoload-dev": {
26-
"psr-4": { "spec\\PUGX\\": "spec/PUGX/" }
26+
"psr-4": { "PUGX\\Poser\\Tests\\": "tests/" }
2727
},
28-
"repositories": [
29-
{
30-
"type": "vcs",
31-
"url": "https://github.com/madisoft/phpspec-data-provider-extension"
32-
}
33-
],
3428
"require": {
3529
"php": "^8.1",
3630
"ext-gd": "*",
@@ -41,11 +35,9 @@
4135
},
4236
"require-dev": {
4337
"behat/behat": "^3.13",
44-
"friends-of-phpspec/phpspec-code-coverage": "^6.3",
4538
"friendsofphp/php-cs-fixer": "^3.41",
46-
"moave/phpspec-data-provider-extension": "dev-master",
47-
"phpspec/phpspec": "^7.4 || ^8.0",
48-
"vimeo/psalm": "^4.30"
39+
"phpunit/phpunit": "^10.5 | ^11.5 | ^12.0",
40+
"vimeo/psalm": "^6.13"
4941
},
5042
"config": {
5143
"bin-dir": "bin",
@@ -58,8 +50,6 @@
5850
"scripts": {
5951
"php-cs-fixer-dry-run": "bin/php-cs-fixer fix --verbose --diff --dry-run --ansi",
6052
"php-cs-fixer": "bin/php-cs-fixer fix -v --ansi",
61-
"phpspec": "bin/phpspec run --format=pretty --ansi",
62-
"phpspec-coverage": "bin/phpspec run -f progress -c phpspec-coverage.yml --ansi",
6353
"behat": "bin/behat --snippets-for",
6454
"docker:build:php81": "docker build -t pugx/poser:php81 -f .docker/base/php81/Dockerfile .",
6555
"docker:push:php81": "docker push pugx/poser:php81",

phpspec-coverage.yml

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

phpspec.yml

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

phpunit.xml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd" bootstrap="vendor/autoload.php"
4+
colors="true" failOnRisky="true" beStrictAboutOutputDuringTests="true">
5+
<testsuites>
6+
<testsuite name="Poser Test Suite">
7+
<directory>tests</directory>
8+
</testsuite>
9+
</testsuites>
10+
<source>
11+
<include>
12+
<directory suffix=".php">src</directory>
13+
</include>
14+
</source>
15+
</phpunit>

spec/PUGX/Poser/BadgeSpec.php

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

spec/PUGX/Poser/Calculator/GDTextSizeCalculatorSpec.php

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

spec/PUGX/Poser/Calculator/SvgTextSizeCalculatorSpec.php

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

0 commit comments

Comments
 (0)