Skip to content

Commit cfdfa5d

Browse files
authored
Merge pull request #339 from LibreSign/chore/update-codebase
chore: update codebase
2 parents 3851b08 + 40db59a commit cfdfa5d

27 files changed

Lines changed: 130 additions & 215 deletions

.github/workflows/tests.yml

Lines changed: 10 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -7,49 +7,39 @@ jobs:
77
strategy:
88
matrix:
99
php:
10-
- "5.3"
11-
- "5.4"
12-
- "5.5"
13-
- "5.6"
14-
- "7.0"
15-
- "7.1"
16-
- "7.2"
17-
- "7.3"
18-
- "7.4"
19-
- "8.0"
10+
- "8.1"
11+
- "8.2"
12+
- "8.3"
13+
- "8.4"
2014
steps:
2115
- name: Checkout
22-
uses: actions/checkout@v2
16+
uses: actions/checkout@v5
2317

2418
- name: Install pdftk
2519
run: |
2620
cd /tmp
27-
sudo wget http://mirrors.kernel.org/ubuntu/pool/universe/p/pdftk-java/pdftk-java_3.0.9-1_all.deb
28-
sudo apt install -y -q ./pdftk-java_3.0.9-1_all.deb
21+
sudo wget https://mirrors.edge.kernel.org/ubuntu/pool/universe/p/pdftk-java/pdftk-java_3.3.3-2_all.deb
22+
sudo apt install -y -q ./pdftk-java_3.3.3-2_all.deb
2923
pdftk --version
3024
3125
- name: Install PHP
3226
uses: shivammathur/setup-php@v2
3327
with:
3428
php-version: ${{ matrix.php }}
35-
tools: composer:v2
36-
37-
- name: Update composer
38-
run: composer self-update
3929

4030
- name: Get composer cache directory
4131
id: composer-cache
4232
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
4333

4434
- name: Cache composer cache
45-
uses: actions/cache@v2
35+
uses: actions/cache@v4
4636
with:
4737
path: ${{ steps.composer-cache.outputs.dir }}
4838
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
4939
restore-keys: ${{ runner.os }}-composer-
5040

5141
- name: Install composer packages
52-
run: composer update --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi
42+
run: composer install
5343

5444
- name: Run phpunit
55-
run: vendor/bin/phpunit --color=always
45+
run: composer test:unit

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
phpunit.xml
22
composer.lock
33
/vendor/
4+
/vendor-bin/**/vendor/
45
*.swp
56
.phpunit.result.cache
7+
/tests/logs

composer.json

Lines changed: 36 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,9 @@
1111
}
1212
],
1313
"require": {
14-
"php": ">=5.3.0",
15-
"mikehaertl/php-shellcommand": "^1.6.3",
16-
"mikehaertl/php-tmpfile": "^1.1.0"
17-
},
18-
"require-dev": {
19-
"phpunit/phpunit": ">4.0 <9.4"
14+
"php": ">=8.1",
15+
"mikehaertl/php-shellcommand": "^1.7",
16+
"mikehaertl/php-tmpfile": "^1.3"
2017
},
2118
"autoload": {
2219
"psr-4": {
@@ -27,5 +24,38 @@
2724
"psr-4": {
2825
"tests\\": "tests"
2926
}
27+
},
28+
"require-dev": {
29+
"bamarni/composer-bin-plugin": "^1.8"
30+
},
31+
"scripts": {
32+
"bin": "echo 'bin not installed'",
33+
"lint": "find . -name \\*.php -not -path './vendor/*' -not -path './vendor-bin/*' -print0 | xargs -0 -n1 php -l",
34+
"post-install-cmd": [
35+
"@composer bin all install --ansi",
36+
"composer dump-autoload"
37+
],
38+
"post-update-cmd": [
39+
"composer dump-autoload"
40+
],
41+
"test:unit": "vendor/bin/phpunit --no-coverage --colors=always --fail-on-warning --fail-on-risky --display-deprecations --display-phpunit-deprecations",
42+
"test:coverage": "XDEBUG_MODE=coverage vendor/bin/phpunit"
43+
},
44+
"config": {
45+
"optimize-autoloader": true,
46+
"classmap-authoritative": true,
47+
"sort-packages": true,
48+
"allow-plugins": {
49+
"bamarni/composer-bin-plugin": true
50+
},
51+
"platform": {
52+
"php": "8.1"
53+
}
54+
},
55+
"extra": {
56+
"bamarni-bin": {
57+
"bin-links": true,
58+
"forward-command": true
59+
}
3060
}
3161
}

phpunit.xml.dist

Lines changed: 25 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,33 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
3-
<phpunit backupGlobals="false"
4-
backupStaticAttributes="false"
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd"
4+
backupGlobals="false"
5+
backupStaticProperties="false"
6+
beStrictAboutCoverageMetadata="true"
7+
beStrictAboutOutputDuringTests="true"
8+
bootstrap="vendor/autoload.php"
9+
cacheDirectory=".phpunit.result.cache"
510
colors="true"
6-
convertErrorsToExceptions="true"
7-
convertNoticesToExceptions="true"
8-
convertWarningsToExceptions="true"
11+
displayDetailsOnTestsThatTriggerWarnings="true"
12+
failOnNotice="true"
13+
failOnRisky="true"
14+
failOnWarning="true"
915
processIsolation="false"
10-
stopOnFailure="false"
11-
bootstrap="./tests/bootstrap.php"
12-
>
16+
stopOnFailure="false">
1317
<testsuites>
1418
<testsuite name="phppdftk Test Suite">
15-
<directory phpVersion="7.2.0" phpVersionOperator=">=">./tests/phpunit89</directory>
16-
<directory phpVersion="7.2.0" phpVersionOperator="lt">./tests/phpunit4567</directory>
19+
<directory suffix="Test.php">./tests/unit</directory>
1720
</testsuite>
1821
</testsuites>
22+
<coverage>
23+
<report>
24+
<clover outputFile="./tests/logs/clover.xml"/>
25+
<html outputDirectory="./tests/logs/html-coverage" lowUpperBound="50" highLowerBound="90"/>
26+
</report>
27+
</coverage>
28+
<source>
29+
<include>
30+
<directory suffix=".php">src</directory>
31+
</include>
32+
</source>
1933
</phpunit>

tests/bootstrap.php

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

tests/phpunit4567/CommandTest.php

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

tests/phpunit4567/DataFieldsTest.php

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

tests/phpunit4567/FdfFileTest.php

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

tests/phpunit4567/InfoFieldsTest.php

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

tests/phpunit4567/InfoFileTest.php

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

0 commit comments

Comments
 (0)