trait HasMethodTrait

Methods

static void
assertThat(mixed $value, Constraint $constraint, string $message = '')

Evaluates a \PHPUnit\Framework\Constraint\Constraint matcher object.

static void
assertHasMethod(string $methodSpec, mixed $subject, string $message = '')

Asserts that $subject has method specified with $methodSpec.

static void
assertNotHasMethod(string $methodSpec, mixed $subject, string $message = '')

Asserts that $subject has no method specified with $methodSpec.

static HasMethod
hasMethod(string $methodSpec)

Checks if an object, class, trait or interface has given method.

Details

at line 31
abstract static void assertThat(mixed $value, Constraint $constraint, string $message = '')

Evaluates a \PHPUnit\Framework\Constraint\Constraint matcher object.

Parameters

mixed $value
Constraint $constraint
string $message

Return Value

void

Exceptions

ExpectationFailedException
InvalidArgumentException
InvalidArgumentException

at line 50
static void assertHasMethod(string $methodSpec, mixed $subject, string $message = '')

Asserts that $subject has method specified with $methodSpec.

Parameters

string $methodSpec

Method specification (name and optionally specified modifiers)

mixed $subject

An object, or a name of class, trait or interface to be examined

string $message

Optional failure message

Return Value

void

Exceptions

ExpectationFailedException
InvalidArgumentException
InvalidArgumentException

at line 72
static void assertNotHasMethod(string $methodSpec, mixed $subject, string $message = '')

Asserts that $subject has no method specified with $methodSpec.

Parameters

string $methodSpec

Method specification (name and optionally specified modifiers)

mixed $subject

An object, or a name of class, trait or interface to be examined

string $message

Optional failure message

Return Value

void

Exceptions

ExpectationFailedException
InvalidArgumentException
InvalidArgumentException

at line 88
static HasMethod hasMethod(string $methodSpec)

Checks if an object, class, trait or interface has given method.

Parameters

string $methodSpec

Method specification (name and optionally specified modifiers)

Return Value

HasMethod

Exceptions

InvalidArgumentException