I recently stumbled across a great test suite called ApiQueryWatchlistIntegrationTest https://github.com/wikimedia/mediawiki/blob/master/tests/phpunit/includes/api/ApiQueryWatchlistIntegrationTest.php
I think that answers your question. Feel free to ask question if it's unclear. Best On Mon, Dec 25, 2017 at 9:00 PM Tony Thomas <[email protected]> wrote: > Dear Team, > > Came across a situation similar to [1] where I had to call submit() > function of a FormSpecialPage during a unit test. We have something going > on in the background, and $this->getUser() needs to return a valid user. > > Is there a way to mimic this context inside the unit test, so that I can > manually set a $user in the unit test, and this would be used while > performing inner operations ? > > > [1] > > https://gerrit.wikimedia.org/r/#/c/399995/4/tests/specials/SpecialNewsletterCreateTest.php > > > -- > Tony Thomas > https://mediawiki.org/wiki/User:01tonythomas > -- > _______________________________________________ > Wikitech-l mailing list > [email protected] > https://lists.wikimedia.org/mailman/listinfo/wikitech-l _______________________________________________ Wikitech-l mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/wikitech-l
