trait HasMethodTrait

Methods

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

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

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

Asserts that $subject has method named $method.

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

Asserts that $subject has no method named $method.

static HasMethod
hasMethod(string $method)

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

Details

at line 30
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 48
static void assertHasMethod(string $method, mixed $subject, string $message = '')

Asserts that $subject has method named $method.

Parameters

string $method

Name of the method to be expected

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 $method, mixed $subject, string $message = '')

Asserts that $subject has no method named $method.

Parameters

string $method

Name of the method to be expected

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 90
static HasMethod hasMethod(string $method)

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

Parameters

string $method

Name of the method to be expected

Return Value

HasMethod

Exceptions

InvalidArgumentException