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 or array of strings are contained within the rendered component.
Assert that the given HTML string or array of HTML strings are contained within the rendered component.
Assert that the given strings are contained in order within the rendered component.
Assert that the given HTML strings are contained in order within the rendered component.
Assert that the given string or array of strings are 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 or array of strings are not contained within the rendered component.
Assert that the given HTML string or array of HTML strings are not contained within the rendered component.
Assert that the given string or array of strings are 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 204
mixed
__call(string $method, array $parameters)
Dynamically call methods on the underlying component.
at line 48
TestComponent
assertSee(array|string $value, bool $escape = true)
Assert that the given string or array of strings are contained within the rendered component.
at line 67
TestComponent
assertSeeHtml(array|string $value)
Assert that the given HTML string or array of HTML strings are contained within the rendered component.
at line 78
TestComponent
assertSeeInOrder(array $values, bool $escape = true)
Assert that the given strings are contained in order within the rendered component.
at line 93
TestComponent
assertSeeHtmlInOrder(array $values)
Assert that the given HTML strings are contained in order within the rendered component.
at line 104
TestComponent
assertSeeText(array|string $value, bool $escape = true)
Assert that the given string or array of strings are contained within the rendered component text.
at line 121
TestComponent
assertSeeTextInOrder(array $values, bool $escape = true)
Assert that the given strings are contained in order within the rendered component text.
at line 136
TestComponent
assertDontSee(array|string $value, bool $escape = true)
Assert that the given string or array of strings are not contained within the rendered component.
at line 155
TestComponent
assertDontSeeHtml(array|string $value)
Assert that the given HTML string or array of HTML strings are not contained within the rendered component.
at line 166
TestComponent
assertDontSeeText(array|string $value, bool $escape = true)
Assert that the given string or array of strings are not contained within the rendered component text.
at line 180
static void
flushState()
Flush all static state.
at line 188
string
__toString()
Get the string contents of the rendered component.
at line 196
mixed
__get(string $attribute)
Dynamically access properties on the underlying component.