Omeka_Test_Helper_Db

Package: Test\Helper

class Omeka_Test_Helper_Db

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

__construct(Zend_Db_Adapter_Abstract $dbAdapter, $prefix)
Parameters:
  • $dbAdapter (Zend_Db_Adapter_Abstract) –

  • $prefix

__call($method, $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

tableExists($tableName)

Check whether a table exists in the database.

Parameters:
  • $tableName (string) –

Returns:

bool

getTableCount($prefix = null)

Get the number of tables in the database.

Parameters:
  • $prefix (string) –

Returns:

int

dropTables($tables = null)

Drop the tables from the database.

Parameters:
  • $tables

truncateTables($tables = null)

Truncate the tables from the database.

Parameters:
  • $tables

install()
getTableNames()

Get the tables in the database.

Returns:

array

getRowCount($tableName)

Get the number of rows in a table.

Parameters:
  • $tableName (string) –

Returns:

int

getAdapter()
getPrefix()