phpunit app

This commit is contained in:
Robin Appelman 2025-10-25 23:37:06 +02:00
commit d143b04ec3
4 changed files with 84 additions and 2 deletions

View file

@ -111,6 +111,11 @@ in
vendorHash = mkOption {
type = with types; str;
};
testDependencies = mkOption {
type = function;
default = pkgs: [];
description = "extra dependencies needed during testing";
};
};
config = mkMerge [
@ -123,6 +128,14 @@ in
inherit (config) composerJson composerLock vendorHash;
};
phpunit = final.callPackage ./apps/phpunit.nix {
phpunit = final.callPackage ./pkgs/phpunit.nix {
php = final.minPhp;
majorVersion = composerMeta.phpUnitVersion;
};
testDependencies = config.testDependencies final;
};
inherit composerMeta filteredSrc;
inherit (final.minPhp.packages) php-cs-fixer composer psalm phpstan;
})
@ -156,12 +169,16 @@ in
in
(optionalAttrs hasPsalm (forPhpVersions "psalm" ./checks/psalm.nix))
// (optionalAttrs hasPhpStan (forPhpVersions "phpstan" ./checks/phpstan.nix));
apps = {pkgs, ...}: {
phpunit = ''${getExe pkgs.phpunit} "$@"'';
};
})
{
devShells = {
default = {
packages = pkgs: (config.tools pkgs) ++ (with pkgs; [minPhp php-cs-fixer composer psalm phpstan]);
packages = pkgs: (config.tools pkgs) ++ (with pkgs; [minPhp php-cs-fixer composer psalm phpstan phpunit]);
};
};