class TestView implements Stringable (View source)
| Macroable |
| static protected array | $macros | The registered string macros. | from Macroable |
| protected View | $view | The original view. | |
| protected string | $rendered | The rendered view contents. |
| static void | macro(string $name, object|callable $macro)
Register a custom macro. | from Macroable |
| static void | mixin(object $mixin, bool $replace = true)
Mix another object into the class. | from Macroable |
| static bool | hasMacro(string $name)
Checks if macro is registered. | from Macroable |
| static void | flushMacros()
Flush the existing macros. | from Macroable |
| static mixed | __callStatic(string $method, array $parameters)
Dynamically handle calls to the class. | from Macroable |
| mixed | __call(string $method, array $parameters)
Dynamically handle calls to the class. | from Macroable |
| void | __construct(View $view)
Create a new test view instance. | |
| $this | assertViewHas(string|array $key, mixed $value = null)
Assert that the response view has a given piece of bound data. | |
| $this | assertViewHasAll(array $bindings)
Assert that the response view has a given list of bound data. | |
| $this | assertViewMissing(string $key)
Assert that the response view is missing a piece of bound data. | |
| $this | assertViewEmpty()
Assert that the view's rendered content is empty. | |
| $this | assertSee(string $value, bool $escape = true)
Assert that the given string is contained within the view. | |
| $this | assertSeeInOrder(array $values, bool $escape = true)
Assert that the given strings are contained in order within the view. | |
| $this | assertSeeText(string $value, bool $escape = true)
Assert that the given string is contained within the view text. | |
| $this | assertSeeTextInOrder(array $values, bool $escape = true)
Assert that the given strings are contained in order within the view text. | |
| $this | assertDontSee(string $value, bool $escape = true)
Assert that the given string is not contained within the view. | |
| $this | assertDontSeeText(string $value, bool $escape = true)
Assert that the given string is not contained within the view text. | |
| string | __toString()
Get the string contents of the rendered view. |
Register a custom macro.
Mix another object into the class.
Checks if macro is registered.
Flush the existing macros.
Dynamically handle calls to the class.
Dynamically handle calls to the class.
Create a new test view instance.
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.
Get the string contents of the rendered view.
© Taylor Otwell
Licensed under the MIT License.
Laravel is a trademark of Taylor Otwell.
https://laravel.com/api/11.x/Illuminate/Testing/TestView.html