PHP Class Phalcon\Test\ModelTestCase

Inheritance: extends UnitTestCase
Datei anzeigen Open project: phalcon/incubator Class Usage Examples

Public Methods

Method Description
emptyTable ( string $table ) : boolean Empties a table in the database.
populateTable ( string $table, null $records = null ) Populates a table with default data
truncateTable ( string $table ) : boolean Disables FOREIGN_KEY_CHECKS and truncates database table

Protected Methods

Method Description
setDb ( string $dbType = 'mysql' ) : void Sets the database adapter in the DI container
setUp ( ) This method is called before a test is executed.

Method Details

emptyTable() public method

Empties a table in the database.
public emptyTable ( string $table ) : boolean
$table string
return boolean

populateTable() public method

Populates a table with default data
public populateTable ( string $table, null $records = null )
$table string
$records null

setDb() protected method

Sets the database adapter in the DI container
protected setDb ( string $dbType = 'mysql' ) : void
$dbType string Sets the database type for the test
return void

setUp() protected method

This method is called before a test is executed.
protected setUp ( )

truncateTable() public method

Disables FOREIGN_KEY_CHECKS and truncates database table
public truncateTable ( string $table ) : boolean
$table string table name
return boolean result of truncate operation