abstract class ConstraintTestCase extends TestCase

internal  This class is not covered by the backward compatibility promise
 

Methods

static Constraint
createConstraint(mixed ...$args)

No description

from  TestCase
static string
getConstraintClass()

Returns constraint's class name.

from  TestCase
Constraint
examineCreateConstraint(array $args)

No description

from  TestCase
void
examineConstraintUnaryOperatorFailure(array $args, mixed $actual, string $message)

Tests whether the constraint throws expected exception with expected message when wrapped with an unary operator.

from  TestCase
void
examineConstraintMatchSucceeds(array $args, mixed $actual)

No description

from  TestCase
void
examineConstraintMatchFails(array $args, mixed $actual, string $message)

No description

from  TestCase
void
examineNotConstraintMatchSucceeds(array $args, mixed $actual)

No description

from  TestCase
void
examineNotConstraintMatchFails(array $args, mixed $actual, string $message)

No description

from  TestCase
UnaryOperator
wrapWithUnaryOperator(Constraint $constraint, string $operator = 'noop', int $precedence = 1)

Returns $constraint wrapped with an UnaryOperator.

from  TestCase
__construct(Constraint $constraint, string $operator, int $precedence)

No description

from  TestCase
string
operator()

No description

from  TestCase
int
precedence()

No description

from  TestCase
static string
subject()

No description

static string
selectable()

No description

static string
adjective()

No description

static array
provCreateConstraint()

No description

void
testCreateConstraint(array $args, array $expect)

No description

void
void
examineValuesMatchSucceeds(array $expect, mixed $actual)

No description

void
examineValuesMatchFails(array $expect, mixed $actual, string $string)

No description

void
examineNotValuesMatchSucceeds(array $expect, mixed $actual)

No description

void
examineNotValuesMatchFails(array $expect, mixed $actual, string $string)

No description

static string
message(string $export, bool $negative = false)

Assembles expected failure message out of pieces.

static string
statement(string $export, bool $negative = false)

Assembles a statement which is a part of failure message.

Details

in TestCase at line 34
abstract static Constraint createConstraint(mixed ...$args)

No description

Parameters

mixed ...$args

Return Value

Constraint

in TestCase at line 43
abstract static string getConstraintClass()

Returns constraint's class name.

Return Value

string

in TestCase at line 54
final Constraint examineCreateConstraint(array $args)

No description

Parameters

array $args

arguments for createConstraint()

Return Value

Constraint

Exceptions

Exception
ExpectationFailedException
InvalidArgumentException

in TestCase at line 76
final void examineConstraintUnaryOperatorFailure(array $args, mixed $actual, string $message)

Tests whether the constraint throws expected exception with expected message when wrapped with an unary operator.

Parameters

array $args

arguments for createConstraint()

mixed $actual

actual value that shall cause the constraint to fail

string $message

expected exception message

Return Value

void

Exceptions

Exception
ExpectationFailedException
ReflectionException
RuntimeException
InvalidArgumentException

in TestCase at line 99
final void examineConstraintMatchSucceeds(array $args, mixed $actual)

No description

Parameters

array $args

arguments passed to createConstraint()

mixed $actual

actual value

Return Value

void

Exceptions

ExpectationFailedException
InvalidArgumentException

in TestCase at line 114
final void examineConstraintMatchFails(array $args, mixed $actual, string $message)

No description

Parameters

array $args

arguments passed to createConstraint()

mixed $actual
string $message

Return Value

void

Exceptions

ExpectationFailedException
CircularDependencyException
InvalidArgumentException

in TestCase at line 134
final void examineNotConstraintMatchSucceeds(array $args, mixed $actual)

No description

Parameters

array $args

arguments passed to createConstraint()

mixed $actual

Return Value

void

Exceptions

ExpectationFailedException
InvalidArgumentException

in TestCase at line 148
final void examineNotConstraintMatchFails(array $args, mixed $actual, string $message)

No description

Parameters

array $args

arguments passed to createConstraint()

mixed $actual
string $message

Return Value

void

Exceptions

ExpectationFailedException
InvalidArgumentException

in TestCase at line 168
final protected UnaryOperator wrapWithUnaryOperator(Constraint $constraint, string $operator = 'noop', int $precedence = 1)

Returns $constraint wrapped with an UnaryOperator.

Parameters

Constraint $constraint
string $operator
int $precedence

Return Value

UnaryOperator

Exceptions

Exception
RuntimeException
ReflectionException

in TestCase at line 180
__construct(Constraint $constraint, string $operator, int $precedence)

No description

Parameters

Constraint $constraint
string $operator
int $precedence

in TestCase at line 187
string operator()

No description

Return Value

string

in TestCase at line 192
int precedence()

No description

Return Value

int

at line 31
abstract static string subject()

No description

Return Value

string

at line 33
abstract static string selectable()

No description

Return Value

string

at line 35
abstract static string adjective()

No description

Return Value

string

at line 42
static array provCreateConstraint()

No description

Return Value

array

at line 65
final void testCreateConstraint(array $args, array $expect)

No description

Parameters

array $args
array $expect

Return Value

void

Exceptions

Exception
ExpectationFailedException
InvalidArgumentException

at line 78
final void testConstraintUnaryOperatorFailure()

No description

Return Value

void

Exceptions

Exception
ExpectationFailedException
ReflectionException
RuntimeException
InvalidArgumentException

at line 94
final void examineValuesMatchSucceeds(array $expect, mixed $actual)

No description

Parameters

array $expect
mixed $actual

Return Value

void

Exceptions

ExpectationFailedException
InvalidArgumentException

at line 108
final void examineValuesMatchFails(array $expect, mixed $actual, string $string)

No description

Parameters

array $expect
mixed $actual
string $string

Return Value

void

Exceptions

ExpectationFailedException
InvalidArgumentException
CircularDependencyException

at line 124
final void examineNotValuesMatchSucceeds(array $expect, mixed $actual)

No description

Parameters

array $expect
mixed $actual

Return Value

void

Exceptions

ExpectationFailedException
InvalidArgumentException

at line 137
final void examineNotValuesMatchFails(array $expect, mixed $actual, string $string)

No description

Parameters

array $expect
mixed $actual
string $string

Return Value

void

Exceptions

ExpectationFailedException
InvalidArgumentException

at line 155
final static protected string message(string $export, bool $negative = false)

Assembles expected failure message out of pieces.

Parameters

string $export

A noun representing the actual value, such as "123" or "array" or "object stdClass"

bool $negative

indicates whether the generated message is for the tested constraint (false) or a constraint negated with LogicalNot (true)

Return Value

string

at line 170
final static protected string statement(string $export, bool $negative = false)

Assembles a statement which is a part of failure message.

Parameters

string $export

A noun representing the actual value, such as "123" or "array" or "object stdClass"

bool $negative

indicates whether the generated statement is for the constraint under test (false) or a constraint negated with LogicalNot (true)

Return Value

string