Why:
- Anon authority will generate manual log entries with an anonymous
actor, which won't work with temp accounts enabled
What:
- Switch test cases to use registered authority mock
Bug: T365669
Change-Id: I4d3a79506d2f1fc744fc32b75e560f084738bdd7
Parsing titles is expensive, it happens in the test function itself via
Title::newFromText and also the called editPage() needs to parse the
title, better to pass the title object there.
Title::newFromText has a cache, that share the title object between the
api code and the test code.
Use independent title objects for testing. This requires some
Title::READ_LATEST to ensure the changed database after the api call is
used.
Change-Id: I00c14e270a5f4078f80d78696ca2e39acf138e95
Error messages are not guaranteed to be stable, and these tests
prevent us from improving them.
Error codes are supposed to be stable, so we should be asserting
that they do not change (especially since many of them are
dynamically generated by the dodgy code in ApiMessageTrait).
Introduce helpers assertApiErrorCode() and expectApiErrorCode()
to be used instead of the usual PHPUnit assertions/expectations
for this case.
Change-Id: I752f82f29bf5f9405ea117ebf9e5cf70335464ad
So, typehint setComment and then fix tests so they always pass a summary.
This also introduces an api change.
Bug: T311567
Change-Id: I478e62b6753d6009017ab0acc295e6cee7d3b017
This is a demo, a lot of tests could be rewritten as a followup
to pass proper Authority when executing tests instead of writing
globals. Much cleaner imho.
An improvement idea is to allow overriding 'default permissions'
when creating a mock Authority.
Change-Id: I38570024e0d5a67a8e1c52f7456c458090ec2b6e
Should be expected, and then actual
Switched some assertEquals to assertSame to fix failing
phpcs sniffs
Change-Id: I7257c5afacd22fed78a58f3cc918b721ac11a46d
Since this isn't a test for the Revision code, it should have
been updated to use RevisionRecord a while ago rather
than just suppressing the deprecation, oops.
Bug: T247143
Change-Id: I2daf5ecac7fbc4fea78e98688023090febb90282
Following 23c3c70d7f, soft deprecate the static methods on
DatabaseBlock that have been moved to DatabaseBlockStore:
* ::insert
* ::delete
* ::update
* ::purgeExpired
Update calls to the deprecated methods from core.
Change-Id: I1272eb978594fd4f386bda12cbc24131ad7d882f
This patch tries to make assertions in tests more readable by using more
self-documenting assertions as provided by modern PHPUnit versions. Among
a few others, these two main changes are done:
* I found a lot of assertions with the expected value being the *second*
parameter. I did not changed all of them. Only some that can be replaced
with assertNull() and such.
* I try to replace all `assertTrue( is_…() )` with dedicated assertions.
Change-Id: I1fc72188fbd0edacf13886e7f9a9eacbd85f13c2
Currently, users who are partially blocked are prevented from deleting
revisions. The system should check to see if the user can edit the page.
Bug: T228486
Change-Id: Id08dfab9b0ebe9721d3552564ee9f9d1e1a4805a
These callers just need to load some data from DB_MASTER.
Subsequent code needing that latest title data should also use the
required flags, rather than relying on flakey global cache state.
Change-Id: I53248ea4b5bf1cd953f956c41b8244831ec5ef04
Use booleans, not the old empty-string-or-undefined.
This bugfix is a breaking change, but chances are it won't affect many
clients.
Bug: T153518
Change-Id: If5fa2cdcb973b186349307b29e4266daceef0a9d
It looks like there is something missing after the last statement
Also remove some other empty lines at begin of functions, ifs or loops
while at these files
Change-Id: Ib00b5cfd31ca4dcd0c32ce33754d3c80bae70641