1 import ../make-test-python.nix ({pkgs, ...}:
3 testdir = pkgs.writeTextDir "www/info.php" "<?php phpinfo();";
6 name = "unit-php-test";
7 meta.maintainers = with pkgs.lib.maintainers; [ izorkin ];
9 nodes.machine = { config, lib, pkgs, ... }: {
12 config = pkgs.lib.strings.toJSON {
13 listeners."*:9081".application = "php_81";
14 applications.php_81 = {
19 root = "${testdir}/www";
21 options.file = "${pkgs.unit.usedPhp81}/lib/php.ini";
39 machine.wait_for_unit("unit.service")
40 machine.wait_for_open_port(9081)
42 # Check so we get an evaluated PHP back
43 response = machine.succeed("curl -f -vvv -s http://127.0.0.1:9081/")
44 assert "PHP Version ${pkgs.unit.usedPhp81.version}" in response, "PHP version not detected"
46 # Check so we have database and some other extensions loaded
47 for ext in ["json", "opcache", "pdo_mysql", "pdo_pgsql", "pdo_sqlite"]:
48 assert ext in response, f"Missing {ext} extension"