Page MenuHomePhabricator

assertTrue should be used instead of comparing to true
Closed, DeclinedPublic

Description

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Change 570794 had a related patch set uploaded (by DannyS712; owner: DannyS712):
[mediawiki/extensions/OAuthAuthentication@master] Use assertTrue instead of assertSame to compare with true

https://gerrit.wikimedia.org/r/570794

Change 570795 had a related patch set uploaded (by DannyS712; owner: DannyS712):
[mediawiki/extensions/CirrusSearch@master] Use assertTrue instead of assertSame to compare with true

https://gerrit.wikimedia.org/r/570795

Change 570796 had a related patch set uploaded (by DannyS712; owner: DannyS712):
[mediawiki/extensions/CentralAuth@master] Use assertTrue instead of assertSame to compare with true

https://gerrit.wikimedia.org/r/570796

Change 570797 had a related patch set uploaded (by DannyS712; owner: DannyS712):
[mediawiki/services/parsoid@master] Use assertTrue instead of assertSame to compare with true

https://gerrit.wikimedia.org/r/570797

Change 570803 had a related patch set uploaded (by DannyS712; owner: DannyS712):
[mediawiki/extensions/Popups@master] Use assertTrue instead of assertSame to compare with true

https://gerrit.wikimedia.org/r/570803

Change 570795 merged by jenkins-bot:
[mediawiki/extensions/CirrusSearch@master] Use assertTrue instead of assertSame to compare with true

https://gerrit.wikimedia.org/r/570795

Change 570803 merged by jenkins-bot:
[mediawiki/extensions/Popups@master] Use assertTrue instead of assertSame to compare with true

https://gerrit.wikimedia.org/r/570803

Change 570797 merged by jenkins-bot:
[mediawiki/services/parsoid@master] Use assertTrue instead of assertSame to compare with true

https://gerrit.wikimedia.org/r/570797

Change 585973 had a related patch set uploaded (by DannyS712; owner: DannyS712):
[mediawiki/tools/codesniffer@master] Add a sniff for using assertSame with null, true, or false

https://gerrit.wikimedia.org/r/585973

assertTrue should be used instead of comparing to true

What? No. Why?

Krinkle subscribed.
From Gerrit:

The problem is with assertEqual, which performs lose/weak comparison. assertSame is fine and should not be sniffed for.

Change 585973 abandoned by DannyS712:
Add a sniff for using assertSame with null, true, or false

https://gerrit.wikimedia.org/r/585973

Change 570796 abandoned by Thiemo Kreuz (WMDE):

[mediawiki/extensions/CentralAuth@master] Use assertTrue instead of assertSame to compare with true

Reason:

I forgot about this patch and accidentally did the change again as part of I4e0ff64. Sorry.

https://gerrit.wikimedia.org/r/570796