DbTestTrait
trait DbTestTrait
Class DbTestTrait
Methods
No description
Generic function to compare expected values after an api call to retrieved.
Request a record from the DB by seachColumn+searchValue. Success if a record is found.
Request a record from the DB by seachColumn+searchValue. Success if returnColumn value is NULL.
Request a record from the DB by id. Success if row not found.
Request a record from the DB by id. Success if row not found.
Compare a single column value in a retrieved DB record to an expected value.
Compare all values in a single retrieved DB record to an array of expected values.
Assert that a SQL query returns a given value.
Details
at line 13
abstract
assertAttributesEquals($expectedValues, $actualValues, $message = NULL)
at line 30
assertDBState($daoName, $id, $match, bool $delete = FALSE)
Generic function to compare expected values after an api call to retrieved.
DB values.
at line 85
null|string
assertDBNotNull(string $daoName, $searchValue, $returnColumn, $searchColumn, $message)
Request a record from the DB by seachColumn+searchValue. Success if a record is found.
at line 103
assertDBNull(string $daoName, $searchValue, $returnColumn, $searchColumn, $message)
Request a record from the DB by seachColumn+searchValue. Success if returnColumn value is NULL.
at line 114
assertDBRowNotExist(string $daoName, int $id, null $message = NULL)
Request a record from the DB by id. Success if row not found.
at line 126
assertDBRowExist(string $daoName, int $id, null $message = NULL)
Request a record from the DB by id. Success if row not found.
at line 141
assertDBCompareValue(string $daoName, $searchValue, $returnColumn, $searchColumn, $expectedValue, $message)
Compare a single column value in a retrieved DB record to an expected value.
at line 155
assertDBCompareValues(string $daoName, array $searchParams, $expectedValues)
Compare all values in a single retrieved DB record to an array of expected values.
at line 180
assertDBQuery($expected, $query, array $params = array(), string $message = '')
Assert that a SQL query returns a given value.
The first argument is an expected value. The remaining arguments are passed to CRM_Core_DAO::singleValueQuery
Example: $this->assertSql(2, 'select count(*) from foo where foo.bar like "%1"', array(1 => array("Whiz", "String")));