trait UsesTraitTrait

Methods

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

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

static void
assertUsesTrait(string $trait, mixed $subject, string $message = '')

Asserts that $subject uses $trait.

static void
assertNotUsesTrait(string $trait, mixed $subject, string $message = '')

Asserts that $subject does not use $trait.

static UsesTrait
usesTrait(string $trait)

Checks objects (an classes) that they use given $trait.

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
InvalidArgumentException

at line 42
static void assertUsesTrait(string $trait, mixed $subject, string $message = '')

Asserts that $subject uses $trait.

Parameters

string $trait

name of the trait that is supposed to be included by $subject

mixed $subject

an object or a class name that is being examined

string $message

custom message

Return Value

void

Exceptions

ExpectationFailedException
InvalidArgumentException
InvalidArgumentException

at line 58
static void assertNotUsesTrait(string $trait, mixed $subject, string $message = '')

Asserts that $subject does not use $trait.

Parameters

string $trait

name of the trait that is expected to be used by $subject

mixed $subject

an object or a class name that is being examined

string $message

custom message

Return Value

void

Exceptions

ExpectationFailedException
InvalidArgumentException
InvalidArgumentException

at line 70
static UsesTrait usesTrait(string $trait)

Checks objects (an classes) that they use given $trait.

Parameters

string $trait

name of the trait that is expected to be included

Return Value

UsesTrait

Exceptions

InvalidArgumentException