Skip to content

Comments

fix: allow assertUrlIs() to accept path-only notation#201

Open
delabon wants to merge 1 commit intopestphp:4.xfrom
delabon:fix/assertUrlIs-path-only-notation
Open

fix: allow assertUrlIs() to accept path-only notation#201
delabon wants to merge 1 commit intopestphp:4.xfrom
delabon:fix/assertUrlIs-path-only-notation

Conversation

@delabon
Copy link

@delabon delabon commented Feb 21, 2026

Previously, assertUrlIs() only accepted full URLs because it matched against the complete URL including scheme, host, and port.

This made tests like ->assertUrlIs('/login') fail even when the browser was on the correct path.

Now the function intelligently detects whether the input is a full URL or just a path:

  • If input contains a scheme (e.g., http://), matches full URL
  • If input is just a path (e.g., /login), matches only the path portion

This change maintains backward compatibility while adding the expected convenience of path-only assertions.

Reported by pestphp/pest#1607

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.

1 participant