PHP Класс 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.
Наследование: extends Elgg\Database\EntityTable
Показать файл Открыть проект

Открытые свойства

Свойство Тип Описание
$rows stdClas\stdClass[]

Открытые методы

Метод Описание
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()

Описание методов

addDeleteQuerySpecs() публичный Метод

Query specs for DELETE operations
public addDeleteQuerySpecs ( stdClass $row ) : void
$row stdClass Data row
Результат void

addInsertQuerySpecs() публичный Метод

Query specs for INSERT operations
public addInsertQuerySpecs ( stdClass $row ) : void
$row stdClass Data row
Результат void

addQuerySpecs() публичный Метод

Add query specs
public addQuerySpecs ( stdClass $row ) : void
$row stdClass Entity table row
Результат void

addSelectQuerySpecs() публичный Метод

Add query specs for SELECT queries
public addSelectQuerySpecs ( stdClass $row ) : void
$row stdClass Data row
Результат void

addUpdateQuerySpecs() публичный Метод

Query specs for UPDATE operations
public addUpdateQuerySpecs ( stdClass $row ) : void
$row stdClass Data row
Результат void

clearQuerySpecs() публичный Метод

Clear query specs
public clearQuerySpecs ( integer $guid ) : void
$guid integer GUID
Результат void

insertRow() публичный Метод

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

iterate() публичный Метод

Iterate ID
public iterate ( ) : integer
Результат integer

setup() публичный Метод

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
Результат ElggEntity

updateRow() публичный Метод

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

validateRowAccess() публичный Метод

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
Результат boolean

Описание свойств

$rows публичное свойство

public stdClass[],stdClas $rows
Результат stdClas\stdClass[]