From 3b251a18f7a38d3257b6627d6e7a535bbe5edaba Mon Sep 17 00:00:00 2001 From: Pradeep Nayak Date: Mon, 8 Feb 2016 20:42:48 +0530 Subject: [PATCH] CRM-16617, fixed checkstyle jenkin error ---------------------------------------- * CRM-16617: https://issues.civicrm.org/jira/browse/CRM-16617 --- tests/phpunit/CRM/Core/DAOTest.php | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/tests/phpunit/CRM/Core/DAOTest.php b/tests/phpunit/CRM/Core/DAOTest.php index 6d8c061416..d44b23b953 100644 --- a/tests/phpunit/CRM/Core/DAOTest.php +++ b/tests/phpunit/CRM/Core/DAOTest.php @@ -142,13 +142,17 @@ class CRM_Core_DAOTest extends CiviUnitTestCase { $this->assertEquals($expectSql, $actualSql); } - // CASE: Two params where the %2 is already present in the query - // NOTE: This case should rightly FAIL, as using strstr in the replace mechanism will turn - // the query into: SELECT * FROM whatever WHERE name = 'Alice' AND title = 'Bob' AND year LIKE ''Bob'012' - // So, to avoid such ERROR, the query should be framed like: - // 'SELECT * FROM whatever WHERE name = %1 AND title = %3 AND year LIKE '%2012' - // $params[3] = array('Bob', 'String'); - // i.e. the place holder should be unique and should not contain in any other operational use in query + /** + * + * CASE: Two params where the %2 is already present in the query + * NOTE: This case should rightly FAIL, as using strstr in the replace mechanism will turn + * the query into: SELECT * FROM whatever WHERE name = 'Alice' AND title = 'Bob' AND year LIKE ''Bob'012' + * So, to avoid such ERROR, the query should be framed like: + * 'SELECT * FROM whatever WHERE name = %1 AND title = %3 AND year LIKE '%2012' + * $params[3] = array('Bob', 'String'); + * i.e. the place holder should be unique and should not contain in any other operational use in query + * + */ public function testComposeQueryFailure() { $cases[] = array( 'SELECT * FROM whatever WHERE name = %1 AND title = %2 AND year LIKE \'%2012\' ', @@ -173,25 +177,25 @@ class CRM_Core_DAOTest extends CiviUnitTestCase { 'this is an even longer string which is exactly 60 character', 60, FALSE, - 'this is an even longer string which is exactly 60 character' + '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' + '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' + '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' + 'this is an even longer string which is a bit more th_c1cbd519', ), ); } -- 2.25.1