Omeka_Test_Helper_Db

class Omeka_Test_Helper_Db

Package: Test\Helper

Catch-all class for database helper methods that are shared across test cases.

property _dbAdapter

Database adapter object.

property _prefix
__construct(Zend_Db_Adapter_Abstract $dbAdapter, $prefix)
Parameters:
  • $dbAdapter (Zend_Db_Adapter_Abstract) –
  • $prefix (unknown) –
__call(string $method, array $args)

Proxy to the db adapter object for all other requests.

Parameters:
  • $method (string) – Method name.
  • $args (array) – Method arguments.
Returns:

array

factory($dbConfig)

Create an instance of the helper that is configured for the correct database.

Parameters:
  • $dbConfig (unknown) –
tableExists(string $tableName)

Check whether a table exists in the database.

Parameters:
  • $tableName (string) –
Returns:

boolean

getTableCount(string $prefix)

Get the number of tables in the database.

Parameters:
  • $prefix (string) –
Returns:

integer

dropTables($tables)

Drop the tables from the database.

Parameters:
  • $tables (unknown) –
Returns:

void

truncateTables($tables)

Truncate the tables from the database.

Parameters:
  • $tables (unknown) –
Returns:

void

install()
getTableNames()

Get the tables in the database.

Returns:array
getRowCount(string $tableName)

Get the number of rows in a table.

Parameters:
  • $tableName (string) –
Returns:

integer

getAdapter()
getPrefix()

Project Versions

Previous topic

Libraries/Omeka/Test/Helper

Next topic

Omeka_Test_Helper_DbProfiler

This Page