trait ImplementsInterfaceTrait

Methods

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

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

static void
assertImplementsInterface(string $interface, mixed $subject, string $message = '')

Asserts that $subject implements $interface.

static void
assertNotImplementsInterface(string $interface, mixed $subject, string $message = '')

Asserts that $subject does not implement $interface.

implementsInterface(string $interface)

Checks classes that they implement $interface.

Details

at line 29
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

at line 41
static void assertImplementsInterface(string $interface, mixed $subject, string $message = '')

Asserts that $subject implements $interface.

Parameters

string $interface

name of the interface that is expected to be implemented

mixed $subject

an object or a class name that is being examined

string $message

custom message

Return Value

void

Exceptions

ExpectationFailedException
InvalidArgumentException

at line 56
static void assertNotImplementsInterface(string $interface, mixed $subject, string $message = '')

Asserts that $subject does not implement $interface.

Parameters

string $interface

name of the interface that is expected to be implemented

mixed $subject

an object or a class name that is being examined

string $message

custom message

Return Value

void

Exceptions

ExpectationFailedException
InvalidArgumentException

at line 68
static ImplementsInterface implementsInterface(string $interface)

Checks classes that they implement $interface.

Parameters

string $interface

name of the interface that is expected to be implemented

Return Value

ImplementsInterface

Exceptions

InvalidArgumentException