Yoast / Yoast/wp-test-utils

Definied ABSPATH as bool

Open Beginner friendly
#111 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PHP
Stars
62
Forks
2
PR merge metrics
No merged PRs in 30d

Description

Hello,

for my understanding defining \define( 'ABSPATH', true ); as a bool is not a good idea.

I have late a strict comparsion like ABSPATH === $path in my test code and that will result in false becasue the $path will have the ABSPATH but converted to a sting.

Better use define( 'ABSPATH', sys_get_temp_dir() . '/' );

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at src/BrainMonkey/bootstrap.php line 13 and inspect how ABSPATH is defined. Verify the strict comparison behavior described in the issue, then run the repository's PHPUnit tests. Done means ABSPATH can be compared with a filesystem path without a type mismatch.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
testing-qa
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
72/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.