PHP Класс CIPHPUnitTestDbTestCase, ci-phpunit-test

См. также: https://github.com/bcit-ci/CodeIgniter4/blob/59e1587a9875141586f8333ff9cc64cdae2173c4/system/Test/CIDatabaseTestCase.php
Автор: CodeIgniter Dev Team
Наследование: extends CIPHPUnitTestCase
Показать файл Открыть проект

Защищенные свойства (Protected)

Свойство Тип Описание
$db
$insertCache array Stores information needed to remove any rows inserted via $this->hasInDatabase();

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

Метод Описание
dontSeeInDatabase ( string $table, array $where ) : boolean Asserts that records that match the conditions in $where do not exist in the database.
grabFromDatabase ( string $table, string $column, array $where ) : boolean Fetches a single column from a database row with criteria matching $where.
hasInDatabase ( string $table, array $data ) Inserts a row into to the database. This row will be removed after the test has run.
seeInDatabase ( string $table, array $where ) : boolean Asserts that records that match the conditions in $where DO exist in the database.
seeNumRecords ( integer $expected, string $table, array $where = [] ) : boolean Asserts that the number of rows in the database that match $where is equal to $expected.

Защищенные методы

Метод Описание
loadDependencies ( )
setUp ( )
tearDown ( ) Takes care of any required cleanup after the test, like removing any rows inserted via $this->hasInDatabase()

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

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

Asserts that records that match the conditions in $where do not exist in the database.
public dontSeeInDatabase ( string $table, array $where ) : boolean
$table string
$where array
Результат boolean

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

Fetches a single column from a database row with criteria matching $where.
public grabFromDatabase ( string $table, string $column, array $where ) : boolean
$table string
$column string
$where array
Результат boolean

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

Inserts a row into to the database. This row will be removed after the test has run.
public hasInDatabase ( string $table, array $data )
$table string
$data array

loadDependencies() защищенный Метод

protected loadDependencies ( )

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

Asserts that records that match the conditions in $where DO exist in the database.
public seeInDatabase ( string $table, array $where ) : boolean
$table string
$where array
Результат boolean

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

Asserts that the number of rows in the database that match $where is equal to $expected.
public seeNumRecords ( integer $expected, string $table, array $where = [] ) : boolean
$expected integer
$table string
$where array
Результат boolean

setUp() защищенный Метод

protected setUp ( )

tearDown() защищенный Метод

Takes care of any required cleanup after the test, like removing any rows inserted via $this->hasInDatabase()
protected tearDown ( )

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

$db защищенное свойство

protected $db

$insertCache защищенное свойство

Stores information needed to remove any rows inserted via $this->hasInDatabase();
protected array $insertCache
Результат array