Added tests that check comparisonClause()

Fixed version of https://github.com/silverstripe/silverstripe-framework/pull/3364