class Illuminate / Testing / Constraints / HasInDatabase

HasInDatabase

Extends

    PHPUnit\...\Constraint

Properties

protected

$show int

Number of records that will be shown in the console in case of failure.

Default: 3
protected

$database Connection

The database connection.

Default: null
protected

$data array

The data that will be used to narrow the search in the database table.

Default: null

Methods

public

__construct ( Connection $database , array $data ) : void

Create a new constraint instance.

Parameters

public

matches ( $table ) : bool

Check if the data is found in the given table.

Parameters

  • $table string
public

failureDescription ( $table ) : string

Get the description of the failure.

Parameters

  • $table string
protected

getAdditionalInfo ( $table ) : string

Get additional info about the records found in the database table.

Parameters

  • $table string
public

toString ( $options ) : string

Get a string representation of the object.

Parameters

  • $options int