class CountInDatabase extends Constraint (View source)

Properties

protected Connection $database

The database connection.

protected int $expectedCount

The expected table entries count that will be checked against the actual count.

protected int $actualCount

The actual table entries count that will be checked against the expected count.

Methods

void
__construct(Connection $database, int $expectedCount)

Create a new constraint instance.

bool
matches(string $table)

Check if the expected and actual count are equal.

string
failureDescription(string $table)

Get the description of the failure.

string
toString(int $options = 0)

Get a string representation of the object.

Details

void __construct(Connection $database, int $expectedCount)

Create a new constraint instance.

Parameters

Connection $database
int $expectedCount

Return Value

void

bool matches(string $table)

Check if the expected and actual count are equal.

Parameters

string $table

Return Value

bool

string failureDescription(string $table)

Get the description of the failure.

Parameters

string $table

Return Value

string

string toString(int $options = 0)

Get a string representation of the object.

Parameters

int $options

Return Value

string