class Illuminate / Testing / Constraints / CountInDatabase
You're browsing the documentation for an upcoming version of Laravel. The documentation and features of this release are subject to change.

CountInDatabase

Extends

    PHPUnit\...\Constraint

Properties

protected

$database Connection

The database connection.

Default: null
protected

$expectedCount int

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

Default: null
protected

$actualCount int

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

Default: null

Methods

public

__construct ( Connection $database , int $expectedCount ) : void

Create a new constraint instance.

Parameters

public

matches ( $table ) : bool

Check if the expected and actual count are equal.

Parameters

  • $table string
public

failureDescription ( $table ) : string

Get the description of the failure.

Parameters

  • $table string
public

toString ( $options ) : string

Get a string representation of the object.

Parameters

  • $options int