1 import ../make-test-python.nix ({ pkgs, lib, php, ... }: {
2 name = "php-${php.version}-httpd-test";
3 meta.maintainers = lib.teams.php.members;
5 nodes.machine = { config, lib, pkgs, ... }: {
8 adminAddr = "admin@phpfpm";
9 virtualHosts."phpfpm" =
11 testdir = pkgs.writeTextDir "web/index.php" "<?php phpinfo();";
14 documentRoot = "${testdir}/web";
16 index = "index.php index.html";
23 testScript = { ... }: ''
24 machine.wait_for_unit("httpd.service")
26 # Check so we get an evaluated PHP back
27 response = machine.succeed("curl -fvvv -s http://127.0.0.1:80/")
28 assert "PHP Version ${php.version}" in response, "PHP version not detected"
30 # Check so we have database and some other extensions loaded
31 for ext in ["json", "opcache", "pdo_mysql", "pdo_pgsql", "pdo_sqlite"]:
32 assert ext in response, f"Missing {ext} extension"