Skip to content

Fix potential TypeError from getcwd() in SelectorTestCase#373

Merged
carlosas merged 2 commits intov0.12.4from
copilot/sub-pr-367-again
Mar 17, 2026
Merged

Fix potential TypeError from getcwd() in SelectorTestCase#373
carlosas merged 2 commits intov0.12.4from
copilot/sub-pr-367-again

Conversation

Copy link
Contributor

Copilot AI commented Mar 17, 2026

getcwd() returns string|false, but ContainerFactory expects string — passing false causes a TypeError that silently breaks all selector tests in CI/container environments where the working directory is unavailable.

Changes

  • tests/unit/selectors/SelectorTestCase.php: Replace getcwd() with dirname(__DIR__, 3) to derive the project root deterministically at compile time
// Before
$factory = new ContainerFactory(getcwd());

// After
$factory = new ContainerFactory(dirname(__DIR__, 3));

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: carlosas <29227794+carlosas@users.noreply.github.com>
Copilot AI changed the title [WIP] [WIP] Address feedback from review for Draft: v0.12.4 Fix potential TypeError from getcwd() in SelectorTestCase Mar 17, 2026
Copilot AI requested a review from carlosas March 17, 2026 15:55
@carlosas carlosas marked this pull request as ready for review March 17, 2026 16:42
@carlosas carlosas merged commit ff1c8d8 into v0.12.4 Mar 17, 2026
13 checks passed
@carlosas carlosas deleted the copilot/sub-pr-367-again branch March 17, 2026 16:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants