Skip to content

Failure to resolve PDO as required extension in tests #12878

Closed
@ltrk2

Description

@ltrk2

Description

The following code:

--TEST--
test
--EXTENSIONS--
PDO
--FILE--
<?php
print("hello");
?>
--EXPECTF--
hello

When executed using the test runner as

php -n generated/run-tests.php -n -P -q test.phpt

Resulted in this output:

=====================================================================
Running selected tests.
SKIP test [test.phpt] reason: Required extension missing: PDO
=====================================================================
Number of tests :     1                 0
Tests skipped   :     1 (100.0%) --------
Tests warned    :     0 (  0.0%) (  0.0%)
Tests failed    :     0 (  0.0%) (  0.0%)
Tests passed    :     0 (  0.0%) (  0.0%)
---------------------------------------------------------------------
Time taken      :     0 seconds
=====================================================================

But I expected this output instead:

=====================================================================
Running selected tests.
=====================================================================
Number of tests :     1                 1
Tests skipped   :     0 (  0.0%) --------
Tests warned    :     0 (  0.0%) (  0.0%)
Tests failed    :     0 (  0.0%) (  0.0%)
Tests passed    :     1 (100.0%) (100.0%)
---------------------------------------------------------------------
Time taken      :     0 seconds
=====================================================================

It works fine in PHP 8.2. I'd gladly just use pdo, but we have a set of tests that run on versions 7.0 through 8.3 and the lower versions only support PDO.

What are your thoughts regarding this?

PHP Version

PHP 8.3.0

Operating System

Ubuntu 22.04

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions