Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

FILE_EXTERNAL breaks __DIR__ #6025

Copy link
Copy link
@Bilge

Description

@Bilge
Issue body actions
Q A
PHPUnit version 11.3.6
PHP version 8.2.15
Installation Method Composer

Summary

An external PHP source file referenced by FILE_EXTERNAL breaks assumptions about __DIR__ pointing to directory of the source file so referenced.

Current behavior

It seems __DIR__ resolves to the directory of the test file including the source so specified in the FILE_EXTERNAL section, instead of the external file itself.

How to reproduce

# my.phpt

--FILE_EXTERNAL--
../external.php
# ../external.php

echo __DIR__, "\n";

Expected behavior

Should print the parent directory of my.phpt.
Currently prints the same directory as my.phpt.

Reactions are currently unavailable

Metadata

Metadata

Labels

feature/phptEnd-to-end tests in PHPT formatEnd-to-end tests in PHPT formattype/bugSomething is brokenSomething is brokenversion/12Something affects PHPUnit 12Something affects PHPUnit 12version/13Something affects PHPUnit 13Something affects PHPUnit 13

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.