TestComponent
class TestComponent implements Stringable
Traits
Properties
| static protected array | $macros | The registered string macros. |
from Macroable |
| Component | $component | The original component. |
|
| protected string | $rendered | The rendered component contents. |
Methods
Mix another object into the class.
Dynamically handle calls to the class.
Dynamically call methods on the underlying component.
Assert that the given string is contained within the rendered component.
Assert that the given strings are contained in order within the rendered component.
Assert that the given string is contained within the rendered component text.
Assert that the given strings are contained in order within the rendered component text.
Assert that the given string is not contained within the rendered component.
Assert that the given string is not contained within the rendered component text.
Flush all static state.
Get the string contents of the rendered component.
Dynamically access properties on the underlying component.
Details
in
Macroable at line 28
static void
macro(string $name, callable|object $macro)
Register a custom macro.
Boot-only. Macros persist in a static property for the worker lifetime and apply to every subsequent call on the macroable class.
in
Macroable at line 41
static void
mixin(object $mixin, bool $replace = true)
Mix another object into the class.
Boot-only. Delegates to macro() for each method; registered macros persist in a static property for the worker lifetime.
in
Macroable at line 57
static bool
hasMacro(string $name)
Check if macro is registered.
in
Macroable at line 68
static void
flushMacros()
Flush the existing macros.
Boot or tests only. Clears worker-wide macros; concurrent coroutines may resolve different methods depending on timing.
in
Macroable at line 78
static mixed
__callStatic(string $method, array $parameters)
Dynamically handle calls to the class.
at line 151
mixed
__call(string $method, array $parameters)
Dynamically call methods on the underlying component.
at line 45
TestComponent
assertSee(string $value, bool $escape = true)
Assert that the given string is contained within the rendered component.
at line 59
TestComponent
assertSeeInOrder(array $values, bool $escape = true)
Assert that the given strings are contained in order within the rendered component.
at line 73
TestComponent
assertSeeText(string $value, bool $escape = true)
Assert that the given string is contained within the rendered component text.
at line 87
TestComponent
assertSeeTextInOrder(array $values, bool $escape = true)
Assert that the given strings are contained in order within the rendered component text.
at line 101
TestComponent
assertDontSee(string $value, bool $escape = true)
Assert that the given string is not contained within the rendered component.
at line 115
TestComponent
assertDontSeeText(string $value, bool $escape = true)
Assert that the given string is not contained within the rendered component text.
at line 127
static void
flushState()
Flush all static state.
at line 135
string
__toString()
Get the string contents of the rendered component.
at line 143
mixed
__get(string $attribute)
Dynamically access properties on the underlying component.