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
Datei anzeigen Open project: elgg/elgg

Public Properties

Property Type Description
$rows stdClas\stdClass[]

Public Methods

Method 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 method

Query specs for DELETE operations
public addDeleteQuerySpecs ( stdClass $row ) : void
$row stdClass Data row
return void

addInsertQuerySpecs() public method

Query specs for INSERT operations
public addInsertQuerySpecs ( stdClass $row ) : void
$row stdClass Data row
return void

addQuerySpecs() public method

Add query specs
public addQuerySpecs ( stdClass $row ) : void
$row stdClass Entity table row
return void

addSelectQuerySpecs() public method

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

addUpdateQuerySpecs() public method

Query specs for UPDATE operations
public addUpdateQuerySpecs ( stdClass $row ) : void
$row stdClass Data row
return void

clearQuerySpecs() public method

Clear query specs
public clearQuerySpecs ( integer $guid ) : void
$guid integer GUID
return void

insertRow() public method

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

iterate() public method

Iterate ID
public iterate ( ) : integer
return integer

setup() public method

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
return ElggEntity

updateRow() public method

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

validateRowAccess() public method

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
return boolean

Property Details

$rows public_oe property

public stdClass[],stdClas $rows
return stdClas\stdClass[]