Skip to content

Testing: ServeTest PATH_INFO front-controller dispatch #276

Description

@PurHur

Problem

lib/Web/DevServer.php already splits /index.php/hello into SCRIPT_NAME, PATH_INFO, and REQUEST_URI (see handleConnection() around the .php regex). #121 closed the $_SERVER population side.

There is no integration test proving a front-controller script reads $_SERVER['PATH_INFO'] through phpc serve / bin/serve.php. #210 / #254 depend on this behavior but only describe it in prose.

Goal

Add ServeTest coverage for PATH_INFO routing without waiting for #3-MiniWebApp.

Scope

  • Temp docroot under test/fixtures/ or inline makeDocroot():
    // index.php
    $path = $_SERVER['PATH_INFO'] ?? '/';
    if ($path === '/hello') { echo 'hi'; }
  • HTTP GET /index.php/hello200 + body hi
  • Assert $_SERVER['SCRIPT_NAME'] === '/index.php' and PATH_INFO === '/hello'
  • Negative: /missing.php/foo404
  • Run under @group serve; verify with Docker:
    docker run --rm -v "$(pwd):/compiler" -w /compiler php-compiler:22.04-dev \
      ./script/ci-local.sh --filter ServeTest

Acceptance criteria

Test passes on host and in php-compiler:22.04-dev when loopback bind works. Skips only when PHP_COMPILER_SKIP_SERVE_TESTS=1 (document in #245 matrix).

Dependencies

Related

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions