PHP Class Elgg\Mocks\Database\EntityTable

It populates the mock database with query specifications for predictable results when entities are requested, updated or deleted. Note that this mock is not designed for testing the entity table itself. When testing the entity table, you should define query specs individually for the method being tested.
Inheritance: extends Elgg\Database\EntityTable
Afficher le fichier Open project: elgg/elgg

Méthodes publiques

Свойство Type Description
$rows stdClas\stdClass[]

Méthodes publiques

Méthode Description
addDeleteQuerySpecs ( stdClass $row ) : void Query specs for DELETE operations
addInsertQuerySpecs ( stdClass $row ) : void Query specs for INSERT operations
addQuerySpecs ( stdClass $row ) : void Add query specs
addSelectQuerySpecs ( stdClass $row ) : void Add query specs for SELECT queries
addUpdateQuerySpecs ( stdClass $row ) : void Query specs for UPDATE operations
clearQuerySpecs ( integer $guid ) : void Clear query specs
insertRow ( stdClass $row, array $attributes = [] )
iterate ( ) : integer Iterate ID
setup ( integer $guid, string $type, string $subtype, array $attributes = [] ) : ElggEntity Setup a mock entity
updateRow ( $guid, stdClass $row )
validateRowAccess ( stdClass $row ) : boolean Check if the user logged in when the query is run, has access to a given data row This is a reverse engineered approach to an SQL query generated by AccessCollections::getWhereSql()

Method Details

addDeleteQuerySpecs() public méthode

Query specs for DELETE operations
public addDeleteQuerySpecs ( stdClass $row ) : void
$row stdClass Data row
Résultat void

addInsertQuerySpecs() public méthode

Query specs for INSERT operations
public addInsertQuerySpecs ( stdClass $row ) : void
$row stdClass Data row
Résultat void

addQuerySpecs() public méthode

Add query specs
public addQuerySpecs ( stdClass $row ) : void
$row stdClass Entity table row
Résultat void

addSelectQuerySpecs() public méthode

Add query specs for SELECT queries
public addSelectQuerySpecs ( stdClass $row ) : void
$row stdClass Data row
Résultat void

addUpdateQuerySpecs() public méthode

Query specs for UPDATE operations
public addUpdateQuerySpecs ( stdClass $row ) : void
$row stdClass Data row
Résultat void

clearQuerySpecs() public méthode

Clear query specs
public clearQuerySpecs ( integer $guid ) : void
$guid integer GUID
Résultat void

insertRow() public méthode

public insertRow ( stdClass $row, array $attributes = [] )
$row stdClass
$attributes array

iterate() public méthode

Iterate ID
public iterate ( ) : integer
Résultat integer

setup() public méthode

Setup a mock entity
public setup ( integer $guid, string $type, string $subtype, array $attributes = [] ) : ElggEntity
$guid integer GUID of the mock entity
$type string Type of the mock entity
$subtype string Subtype of the mock entity
$attributes array Attributes of the mock entity
Résultat ElggEntity

updateRow() public méthode

public updateRow ( $guid, stdClass $row )
$row stdClass

validateRowAccess() public méthode

Check if the user logged in when the query is run, has access to a given data row This is a reverse engineered approach to an SQL query generated by AccessCollections::getWhereSql()
public validateRowAccess ( stdClass $row ) : boolean
$row stdClass Data row
Résultat boolean

Property Details

$rows public_oe property

public stdClass[],stdClas $rows
Résultat stdClas\stdClass[]