TestView
class TestView implements Stringable
Traits
Properties
| static protected array | $macros | The registered string macros. |
from Macroable |
| protected View | $view | The original view. |
|
| protected string | $rendered | The rendered view contents. |
Methods
Mix another object into the class.
Dynamically handle calls to the class.
Dynamically handle calls to the class.
Assert that the response view has a given piece of bound data.
Assert that the response view has a given list of bound data.
Assert that the response view is missing a piece of bound data.
Assert that the view's rendered content is empty.
Assert that the given string is contained within the view.
Assert that the given strings are contained in order within the view.
Assert that the given string is contained within the view text.
Assert that the given strings are contained in order within the view text.
Assert that the given string is not contained within the view.
Assert that the given string is not contained within the view text.
Flush all static state.
Get the string contents of the rendered view.
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.
in
Macroable at line 103
mixed
__call(string $method, array $parameters)
Dynamically handle calls to the class.
at line 34
__construct(View $view)
Create a new test view instance.
at line 45
TestView
assertViewHas(string|array $key, mixed $value = null)
Assert that the response view has a given piece of bound data.
at line 76
TestView
assertViewHasAll(array $bindings)
Assert that the response view has a given list of bound data.
at line 94
TestView
assertViewMissing(string $key)
Assert that the response view is missing a piece of bound data.
at line 106
TestView
assertViewEmpty()
Assert that the view's rendered content is empty.
at line 118
TestView
assertSee(string $value, bool $escape = true)
Assert that the given string is contained within the view.
at line 132
TestView
assertSeeInOrder(array $values, bool $escape = true)
Assert that the given strings are contained in order within the view.
at line 146
TestView
assertSeeText(string $value, bool $escape = true)
Assert that the given string is contained within the view text.
at line 160
TestView
assertSeeTextInOrder(array $values, bool $escape = true)
Assert that the given strings are contained in order within the view text.
at line 174
TestView
assertDontSee(string $value, bool $escape = true)
Assert that the given string is not contained within the view.
at line 188
TestView
assertDontSeeText(string $value, bool $escape = true)
Assert that the given string is not contained within the view text.
at line 200
static void
flushState()
Flush all static state.
at line 208
string
__toString()
Get the string contents of the rendered view.