Skip to content

Report PHPT test as risky when --SKIPIF-- does not have standard-output side-effect #6000

Closed

Description

@staabm

since #5998 we know which side-effects the PHPT skipif code has.

A skipif condition is expected to output a string starting with "skip", in case the test should be skipped.
this also means a SKIPIF condition which does not at all produce output, can never have a "skipping-effect" on the test-code.

-> we could report a test as "risky" when SKIPIF is declared but does not have such a expected standard output side-effect. I remember we talked about marking such test as "error" instead of "risky", but decided against it because some people use the skipif section to prepare something for the test-case (without the intention to skip it)

--TEST--
PHPT with --SKIPIF-- but without standard output side-effect is risky
--INI--
error_reporting=-1
--SKIPIF--
<?php declare(strict_types=1);
if (1 == 2) {
   exit(1);
}
--FILE--
<?php declare(strict_types=1);
echo "Hello, World!\n";
--EXPECT--
Hello, World!

Activity

  1. added
    type/enhancement
    on Oct 19, 2024
  2. added
    feature/phpt
    feature/test-runner
    on Oct 19, 2024
  3. changed the title [-]Report test as risky, if skipif does not has standard-output side-effect[/-] [+]Report PHPT test as risky when `--SKIPIF--` does not have standard-output side-effect[/+] on Apr 12, 2026
  4. added a commit that references this issue on Apr 12, 2026
    09fa8f7
  5. locked as resolved and limited conversation to collaborators on May 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

feature/phptfeature/test-runnertype/enhancement

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions