Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .env.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# define your env variables for the test env here
KERNEL_CLASS='App\Kernel'
APP_SECRET='$ecretf0rt3st'
35 changes: 35 additions & 0 deletions .github/workflows/phpunit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: PHPUnit

on:
pull_request:
branches: ['main']
push:
branches: ['main']

env:
APP_ENV: test

jobs:
phpunit:
name: PHPUnit
runs-on: ubuntu-24.04

strategy:
matrix:
php-version:
- '8.4'

steps:
- name: Checkout
uses: actions/checkout@v5

- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}

- name: Install Composer dependencies
uses: ramsey/composer-install@v3

- name: Run PHPUnit
run: vendor/bin/phpunit
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,8 @@
/public/assets/
/assets/vendor/
###< symfony/asset-mapper ###

###> phpunit/phpunit ###
/phpunit.xml
/.phpunit.cache/
###< phpunit/phpunit ###
13 changes: 13 additions & 0 deletions Taskfile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,16 @@ tasks:
desc: Generate PHPStan baseline
cmds:
- symfony php vendor/bin/phpstan analyse --generate-baseline

test:
desc: Run tests
env:
APP_ENV: test
cmds:
- symfony php vendor/bin/phpunit

ci:
desc: Run lint & tests
cmds:
- task: lint
- task: test
23 changes: 23 additions & 0 deletions bin/phpunit
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/usr/bin/env php
<?php

if (!ini_get('date.timezone')) {
ini_set('date.timezone', 'UTC');
}

if (is_file(dirname(__DIR__).'/vendor/phpunit/phpunit/phpunit')) {
if (PHP_VERSION_ID >= 80000) {
require dirname(__DIR__).'/vendor/phpunit/phpunit/phpunit';
} else {
define('PHPUNIT_COMPOSER_INSTALL', dirname(__DIR__).'/vendor/autoload.php');
require PHPUNIT_COMPOSER_INSTALL;
PHPUnit\TextUI\Command::main();
}
} else {
if (!is_file(dirname(__DIR__).'/vendor/symfony/phpunit-bridge/bin/simple-phpunit.php')) {
echo "Unable to find the `simple-phpunit.php` script in `vendor/symfony/phpunit-bridge/bin/`.\n";
exit(1);
}

require dirname(__DIR__).'/vendor/symfony/phpunit-bridge/bin/simple-phpunit.php';
}
38 changes: 21 additions & 17 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,48 +6,52 @@
"php": ">=8.2.0",
"ext-ctype": "*",
"ext-iconv": "*",
"doctrine/doctrine-bundle": "^2.13.0",
"doctrine/doctrine-migrations-bundle": "^3.3.1",
"doctrine/orm": "^3.2.2",
"league/flysystem-async-aws-s3": "^3.29.0",
"doctrine/doctrine-bundle": "^2.16.2",
"doctrine/doctrine-migrations-bundle": "^3.4.2",
"doctrine/orm": "^3.5.2",
"league/flysystem-async-aws-s3": "^3.30.0",
"league/flysystem-aws-s3-v3": "^3.29.0",
"league/flysystem-bundle": "^3.3.5",
"leapt/core-bundle": "^5.3.2",
"leapt/froala-editor-bundle": "^1.7.1",
"leapt/slug-type-bundle": "^1.3",
"league/flysystem-bundle": "^3.5.0",
"leapt/core-bundle": "^5.6.0",
"leapt/froala-editor-bundle": "^1.8.0",
"leapt/slug-type-bundle": "^1.4",
"symfony/asset": "7.3.*",
"symfony/asset-mapper": "7.3.*",
"symfony/console": "7.3.*",
"symfony/dotenv": "7.3.*",
"symfony/flex": "^2.4.7",
"symfony/flex": "^2.8.2",
"symfony/framework-bundle": "7.3.*",
"symfony/runtime": "7.3.*",
"symfony/stimulus-bundle": "^2.20.0",
"symfony/stimulus-bundle": "^2.30.0",
"symfony/twig-bundle": "7.3.*",
"symfony/yaml": "7.3.*",
"twig/extra-bundle": "^3.13.0",
"twig/twig": "^3.14.0"
"twig/extra-bundle": "^3.21.0",
"twig/twig": "^3.21.1"
},
"require-dev": {
"phpstan/extension-installer": "^1.4.3",
"phpstan/phpstan": "^2.1.25",
"phpstan/phpstan": "^2.1.30",
"phpstan/phpstan-deprecation-rules": "^2.0.3",
"phpstan/phpstan-doctrine": "^2.0.6",
"phpstan/phpstan-doctrine": "^2.0.10",
"phpstan/phpstan-symfony": "^2.0.8",
"phpunit/phpunit": "^12.4",
"symfony/browser-kit": "7.3.*",
"symfony/css-selector": "7.3.*",
"symfony/debug-bundle": "7.3.*",
"symfony/maker-bundle": "^1.61.0",
"symfony/maker-bundle": "^1.64.0",
"symfony/monolog-bundle": "^3.10.0",
"symfony/stopwatch": "7.3.*",
"symfony/web-profiler-bundle": "7.3.*",
"symplify/easy-coding-standard": "^12.3.6",
"zenstruck/foundry": "^2.1.0"
"symplify/easy-coding-standard": "^12.6.0",
"zenstruck/foundry": "^2.7.3"
},
"config": {
"allow-plugins": {
"symfony/flex": true,
"symfony/runtime": true,
"phpstan/extension-installer": true
},
"bump-after-update": true,
"preferred-install": {
"*": "dist"
},
Expand Down
Loading