X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=tests%2Fphpunit%2FCiviTest%2FCiviUnitTestCase.php;h=1c11b5e095ab4eebf54f96c5961ce25585274420;hb=eff849bc837a99f8889f407e8c37064a74dd24b2;hp=32fb9e3ea9c964de122a45adbb03711e1929854e;hpb=5c484ea5c75cdac95575433c68c2826368ca8b42;p=civicrm-core.git diff --git a/tests/phpunit/CiviTest/CiviUnitTestCase.php b/tests/phpunit/CiviTest/CiviUnitTestCase.php index 32fb9e3ea9..1c11b5e095 100644 --- a/tests/phpunit/CiviTest/CiviUnitTestCase.php +++ b/tests/phpunit/CiviTest/CiviUnitTestCase.php @@ -2520,6 +2520,19 @@ AND ( TABLE_NAME LIKE 'civicrm_value_%' ) )); } + /** + * Assert 2 sql strings are the same, ignoring double spaces. + * + * @param string $expectedSQL + * @param string $actualSQL + * @param string $message + */ + protected function assertLike($expectedSQL, $actualSQL, $message = 'different sql') { + $expected = trim((preg_replace('/[ \r\n\t]+/', ' ', $expectedSQL))); + $actual = trim((preg_replace('/[ \r\n\t]+/', ' ', $actualSQL))); + $this->assertEquals($expected, $actual, $message); + } + /** * Create a price set for an event. *