$dbInitialized
$dbInitialized : boolean
Has database been initialized
PHPUnit test case for testing view templates
NOTE: This was written for MySQL and probably won't work with other databases.
Database is initialized on first use by coping the structure of existing tables and creating temporary tables on top of them. The temporary tables are then truncated and reused on additional tests to speed up performance. Temporary tables are changed to use the Memory engine when possible to speed up performance.
$dbInitialized : boolean
Has database been initialized
$dbAdapter : \Zend\Db\Adapter\AdapterInterface
Database adapter
$cloneServices : boolean
Should services be cloned from prototype or created from scratch. This is experimental and should be used with caution.
$serviceManagerPrototype : \Zend\ServiceManager\ServiceManager
Service Manager Prototype
$services : \Zend\ServiceManager\ServiceLocatorInterface
Service Manager
getServices() : \Zend\ServiceManager\ServiceLocatorInterface
Get Service Manager
setServices(\Zend\ServiceManager\ServiceLocatorInterface $services)
Set Service Manager
\Zend\ServiceManager\ServiceLocatorInterface | $services |
getServiceLocator() : \Zend\ServiceManager\ServiceLocatorInterface
Provides compatibility ServiceLocatorAwareInterface
setServiceLocator(\Zend\ServiceManager\ServiceLocatorInterface $services)
Provides compatibility ServiceLocatorAwareInterface
\Zend\ServiceManager\ServiceLocatorInterface | $services |
getServiceManager() : \Zend\ServiceManager\ServiceLocatorInterface
Provides compatibility ServiceManagerAwareInterface
setServiceManager(\Zend\ServiceManager\ServiceLocatorInterface $services)
Provides compatibility ServiceManagerAwareInterface
\Zend\ServiceManager\ServiceLocatorInterface | $services |
assertTableRowCount(integer $count, string|\Zend\Db\TableGateway $table, string|array|\Spork\Test\TestCase\Closure|\Spork\Test\TestCase\PredicateInterface $where = null)
Assert that a table has specified number for rows
integer | $count | |
string|\Zend\Db\TableGateway | $table | |
string|array|\Spork\Test\TestCase\Closure|\Spork\Test\TestCase\PredicateInterface | $where |
on $table not a table name or TableGateway instance
initializePrototype()
Create a Service Manager Prototype object
initializeDatabase(\Zend\Db\Adapter\Adapter $source, \Zend\Db\Adapter\Adapter $dest)
\Zend\Db\Adapter\Adapter | $source | |
\Zend\Db\Adapter\Adapter | $dest |
createTestTable(string $table, \Zend\Db\Adapter\Adapter $source, \Zend\Db\Adapter\Adapter $dest)
Copies table structure and creates temporary table on top of it.
string | $table | Table name |
\Zend\Db\Adapter\Adapter | $source | |
\Zend\Db\Adapter\Adapter | $dest |
getCreateTable(string $table, \Zend\Db\Adapter\Adapter $db) : mixed
Gets table structure
string | $table | Table name |
\Zend\Db\Adapter\Adapter | $db |
getTables(\Zend\Db\Adapter\Adapter $db) : array
Get list of tables in current schema
\Zend\Db\Adapter\Adapter | $db |