Follow-up to #1423244: #allowed_formats property for #type 'text_format' to filter available formats

The attached patch is for the followup: The return should be documented. Also, I think the return value should be the result of the assertFalse() not $select.

Ideally, all assertSomething() functions should return a bool indicating pass or fail. However, currently, assertSomething() functions exist all over Core that do not return a value, not just the Filter module.

Comments

lokapujya’s picture

Status: Active » Needs review
lokapujya’s picture

Issue summary: View changes
gábor hojtsy’s picture

Well, if we use the return value then we should rename the method. We can still assert the textarea there.

Crell’s picture

We're trying to move away from Simpletest anyway toward PHPUnit, at which point this is no longer our problem. Should we even bother? This seems like unnecessary busy work.

lokapujya’s picture

Yeah, the wider scope of updating asserts would be most efficiently tackled as we move the tests to phpUnit.

As is, the missing return documentation that is fixed by this patch causes a code standards warning in some modern IDE's. If we want the patch as exists, someone can RTBC it, or we can postpone that also.

lokapujya’s picture

Issue summary: View changes
gábor hojtsy’s picture

Status: Needs review » Needs work

The remaining asserts added in #1423244: #allowed_formats property for #type 'text_format' to filter available formats would need to be covered as well. All need the return value documented and actually returned as well.

lokapujya’s picture

Issue tags: +Novice

Setting to Novice for fixing the remaining asserts() mentioned in #7. (meaning just the new asserts added by that issue to the Filter module.)

tstoeckler’s picture

Status: Needs work » Needs review
StatusFileSize
new5.19 KB

Re #3: The return value is actually never used (and pointless). No clue why I put that there, that shouldn't be there.

Here's an updated patch which fixes this issue for FilterFormTest. Not sure if we want to make this a fix-all issue or not. As mentioned above (almost ?) all assertX methods are currently lacking return value documentation.

gábor hojtsy’s picture

Category: Task » Bug report
Status: Needs review » Reviewed & tested by the community

Looks good.

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed 47b25e9 and pushed to 8.x. Thanks!

  • alexpott committed 47b25e9 on 8.x
    Issue #2284383 by tstoeckler, lokapujya: Fixed All assertSomething()...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.