TestView
class TestView (View source)
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 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.
Details
static void
macro(string $name, object|callable $macro)
Register a custom macro.
static void
mixin(object $mixin, bool $replace = true)
Mix another object into the class.
static bool
hasMacro(string $name)
Checks if macro is registered.
static void
flushMacros()
Flush the existing macros.
static mixed
__callStatic(string $method, array $parameters)
Dynamically handle calls to the class.
mixed
__call(string $method, array $parameters)
Dynamically handle calls to the class.
void
__construct(View $view)
Create a new test view instance.
$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.