class TestComponent implements Stringable (View source)

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

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 call methods on the underlying component.

__construct(Component $component, View $view)

Create a new test component instance.

$this
assertSee(string|list<string> $value, bool $escape = true)

Assert that the given string or array of strings are contained within the rendered component.

$this
assertSeeHtml(string|list<string> $value)

Assert that the given HTML string or array of HTML strings are contained within the rendered component.

$this
assertSeeInOrder(array $values, bool $escape = true)

Assert that the given strings are contained in order within the rendered component.

$this
assertSeeHtmlInOrder(array $values)

Assert that the given HTML strings are contained in order within the rendered component.

$this
assertSeeText(string|list<string> $value, bool $escape = true)

Assert that the given string or array of strings are contained within the rendered component text.

$this
assertSeeTextInOrder(array $values, bool $escape = true)

Assert that the given strings are contained in order within the rendered component text.

$this
assertDontSee(string|list<string> $value, bool $escape = true)

Assert that the given string or array of strings are not contained within the rendered component.

$this
assertDontSeeHtml(string|list<string> $value)

Assert that the given HTML string or array of HTML strings are not contained within the rendered component.

$this
assertDontSeeText(string|list<string> $value, bool $escape = true)

Assert that the given string or array of strings are not contained within the rendered component text.

string
__toString()

Get the string contents of the rendered component.

mixed
__get(string $attribute)

Dynamically access properties on the underlying component.

Details

static void macro(string $name, object|callable $macro)

Register a custom macro.

Parameters

string $name
object|callable $macro

Return Value

void

static void mixin(object $mixin, bool $replace = true)

Mix another object into the class.

Parameters

object $mixin
bool $replace

Return Value

void

Exceptions

ReflectionException

static bool hasMacro(string $name)

Checks if macro is registered.

Parameters

string $name

Return Value

bool

static void flushMacros()

Flush the existing macros.

Return Value

void

static mixed __callStatic(string $method, array $parameters)

Dynamically handle calls to the class.

Parameters

string $method
array $parameters

Return Value

mixed

Exceptions

BadMethodCallException

mixed __call(string $method, array $parameters)

Dynamically call methods on the underlying component.

Parameters

string $method
array $parameters

Return Value

mixed

__construct(Component $component, View $view)

Create a new test component instance.

Parameters

Component $component
View $view

$this assertSee(string|list<string> $value, bool $escape = true)

Assert that the given string or array of strings are contained within the rendered component.

Parameters

string|list<string> $value
bool $escape

Return Value

$this

$this assertSeeHtml(string|list<string> $value)

Assert that the given HTML string or array of HTML strings are contained within the rendered component.

Parameters

string|list<string> $value

Return Value

$this

$this assertSeeInOrder(array $values, bool $escape = true)

Assert that the given strings are contained in order within the rendered component.

Parameters

array $values
bool $escape

Return Value

$this

$this assertSeeHtmlInOrder(array $values)

Assert that the given HTML strings are contained in order within the rendered component.

Parameters

array $values

Return Value

$this

$this assertSeeText(string|list<string> $value, bool $escape = true)

Assert that the given string or array of strings are contained within the rendered component text.

Parameters

string|list<string> $value
bool $escape

Return Value

$this

$this assertSeeTextInOrder(array $values, bool $escape = true)

Assert that the given strings are contained in order within the rendered component text.

Parameters

array $values
bool $escape

Return Value

$this

$this assertDontSee(string|list<string> $value, bool $escape = true)

Assert that the given string or array of strings are not contained within the rendered component.

Parameters

string|list<string> $value
bool $escape

Return Value

$this

$this assertDontSeeHtml(string|list<string> $value)

Assert that the given HTML string or array of HTML strings are not contained within the rendered component.

Parameters

string|list<string> $value

Return Value

$this

$this assertDontSeeText(string|list<string> $value, bool $escape = true)

Assert that the given string or array of strings are not contained within the rendered component text.

Parameters

string|list<string> $value
bool $escape

Return Value

$this

string __toString()

Get the string contents of the rendered component.

Return Value

string

mixed __get(string $attribute)

Dynamically access properties on the underlying component.

Parameters

string $attribute

Return Value

mixed

Laravel Cloud is the best place to deploy Laravel, Nuxt, Express, Hono, Node.js, Bun, Go, Flask, Python, and more, with dedicated infrastructure available on AWS through Laravel Private Cloud.