Skip to content

Commit

Permalink
Fixes phpunit
Browse files Browse the repository at this point in the history
  • Loading branch information
butschster committed Apr 30, 2024
1 parent 7d6ea6d commit 18f8b1e
Show file tree
Hide file tree
Showing 11 changed files with 63 additions and 66 deletions.
21 changes: 0 additions & 21 deletions .github/workflows/phpunit-database.yml

This file was deleted.

20 changes: 0 additions & 20 deletions .github/workflows/phpunit-memory.yml

This file was deleted.

34 changes: 34 additions & 0 deletions .github/workflows/phpunit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
on:
pull_request: null

name: phpunit

jobs:
phpunit-db:
uses: buggregator/gh-actions/.github/workflows/phpunit.yml@master
with:
extensions: >-
['sockets', 'mongodb', 'pgsql', 'pdo_pgsql', 'pdo_mysql']
os: >-
['ubuntu-latest']
php: >-
['8.3']
stability: >-
['prefer-stable']
env:
PERSISTENCE_DRIVER: db
DB_DRIVER: sqlite

phpunit-memory:
uses: buggregator/gh-actions/.github/workflows/phpunit.yml@master
with:
extensions: >-
['sockets', 'mongodb', 'pgsql', 'pdo_pgsql', 'pdo_mysql']
os: >-
['ubuntu-latest']
php: >-
['8.3']
stability: >-
['prefer-stable']
env:
PERSISTENCE_DRIVER: memory
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ protoc-gen-php-grpc*
.php-cs-fixer.cache
.deptrac.cache
.phpunit.cache
build
.cache
20 changes: 20 additions & 0 deletions .php-cs-fixer.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php

declare(strict_types=1);

if (!\file_exists(__DIR__ . '/app')) {
exit(0);
}

return (new PhpCsFixer\Config())
->setRules([
'@PER-CS2.0' => true,
])
->setRiskyAllowed(true)
->setFinder(
(new PhpCsFixer\Finder())
->files()
->name('*.php')
->in([__DIR__ . '/app/src', __DIR__ . '/app/modules']),
)
->setCacheFile('.cache/.php-cs-fixer.cache');
18 changes: 0 additions & 18 deletions .styleci.yml

This file was deleted.

4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@
"rr get-binary"
],
"psalm": "vendor/bin/psalm --config=psalm.xml ./app",
"cs-check": "vendor/bin/php-cs-fixer fix ./app/src --rules=@PER-CS2.0 --dry-run",
"cs-fix": "vendor/bin/php-cs-fixer fix ./app/src --rules=@PER-CS2.0",
"cs-check": "vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.php --dry-run",
"cs-fix": "vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.php -vvv --dry-run --using-cache=no",
"deptrack": [
"deptrac analyze --report-uncovered"
]
Expand Down
2 changes: 1 addition & 1 deletion deptrac.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# deptrac.yaml
# deptrac
deptrac:
paths:
- ./app/src
Expand Down
2 changes: 1 addition & 1 deletion phpunit.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd" bootstrap="vendor/autoload.php"
backupGlobals="false" colors="true" stderr="false" cacheDirectory=".phpunit.cache"
backupGlobals="false" colors="true" stderr="false" cacheDirectory=".cache/phpunit"
backupStaticProperties="false">
<php>
<env name="BROADCAST_CONNECTION" value="in-memory"/>
Expand Down
5 changes: 3 additions & 2 deletions psalm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="https://getpsalm.org/schema/config"
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
cacheDirectory=".cache/psalm"
>
<projectFiles>
<directory name="app/src" />
<directory name="app/src"/>
<ignoreFiles>
<directory name="vendor" />
<directory name="vendor"/>
</ignoreFiles>
</projectFiles>
</psalm>
1 change: 1 addition & 0 deletions rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
__DIR__ . '/app',
__DIR__ . '/tests',
])
->withCache(cacheDirectory: __DIR__ . '.cache/rector')
// uncomment to reach your current PHP version
// ->withPhpSets()
->withRules([
Expand Down

0 comments on commit 18f8b1e

Please sign in to comment.