Merge pull request #14516 from eileenmcnaughton/except
[civicrm-core.git] / tests / phpunit / CiviTest / CiviUnitTestCase.php
index 32fb9e3ea9c964de122a45adbb03711e1929854e..1c11b5e095ab4eebf54f96c5961ce25585274420 100644 (file)
@@ -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.
    *