Skip to content

[11.x] Allow TestComponent to be macroable#54359

Merged
taylorotwell merged 2 commits into
laravel:11.xfrom
ziadoz:macro-test-component
Jan 26, 2025
Merged

[11.x] Allow TestComponent to be macroable#54359
taylorotwell merged 2 commits into
laravel:11.xfrom
ziadoz:macro-test-component

Conversation

@ziadoz

@ziadoz ziadoz commented Jan 26, 2025

Copy link
Copy Markdown
Contributor

This PR allows the TestComponent class to be macroable like TestView.

In my case, I'd like to be able to chain on my own custom HTML assertion methods:

TestComponent::macro('assertElement', fn (): => //...);
public function test_my_component(): void
{
    $this->component(MyComponent::class, [...])->assertElement(...);
}

@taylorotwell taylorotwell merged commit 4673387 into laravel:11.x Jan 26, 2025
@ziadoz ziadoz deleted the macro-test-component branch June 23, 2025 15:00
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