/**
* @dataProvider composeQueryExamples
+ * @param $inputSql
+ * @param $inputParams
+ * @param $expectSql
*/
public function testComposeQuery($inputSql, $inputParams, $expectSql) {
$actualSql = CRM_Core_DAO::composeQuery($inputSql, $inputParams);
public function sqlNameDataProvider() {
return array(
array('this is a long string', 30, FALSE, 'this is a long string'),
-
- array('this is an even longer string which is exactly 60 character', 60, FALSE, 'this is an even longer string which is exactly 60 character'),
- array('this is an even longer string which is exactly 60 character', 60, TRUE , 'this is an even longer string which is exactly 60 character'),
-
- array('this is an even longer string which is a bit more than 60 character', 60, FALSE, 'this is an even longer string which is a bit more than 60 ch'),
- array('this is an even longer string which is a bit more than 60 character', 60, TRUE , 'this is an even longer string which is a bit more th_c1cbd519'),
+ array(
+ 'this is an even longer string which is exactly 60 character',
+ 60,
+ FALSE,
+ 'this is an even longer string which is exactly 60 character'
+ ),
+ array(
+ 'this is an even longer string which is exactly 60 character',
+ 60,
+ TRUE,
+ 'this is an even longer string which is exactly 60 character'
+ ),
+ array(
+ 'this is an even longer string which is a bit more than 60 character',
+ 60,
+ FALSE,
+ 'this is an even longer string which is a bit more than 60 ch'
+ ),
+ array(
+ 'this is an even longer string which is a bit more than 60 character',
+ 60,
+ TRUE,
+ 'this is an even longer string which is a bit more th_c1cbd519'
+ ),
);
}
/**
* @dataProvider sqlNameDataProvider
+ * @param $inputData
+ * @param $length
+ * @param $makeRandom
+ * @param $expectedResult
*/
public function testShortenSQLName($inputData, $length, $makeRandom, $expectedResult) {
$this->assertEquals($expectedResult, CRM_Core_DAO::shortenSQLName($inputData, $length, $makeRandom));