Re: [Wikitech-l] How to fake a login with AuthManager?

2016-07-12 Thread Daniel Barrett
>On Tue, Jul 12, 2016 at 11:01 AM, Daniel Barrett >wrote: >> What is the proper incantation for faking a successful login (for a given >> user) as part of a unit test? My old code was: >> >> $context = RequestContext::getMain(); >> $specialPage = new LoginForm( $context-

Re: [Wikitech-l] How to fake a login with AuthManager?

2016-07-12 Thread Brad Jorsch (Anomie)
On Tue, Jul 12, 2016 at 11:01 AM, Daniel Barrett wrote: > What is the proper incantation for faking a successful login (for a given > user) as part of a unit test? My old code was: > > $context = RequestContext::getMain(); > $specialPage = new LoginForm( $context->getRequest() ); > $user->logout(

[Wikitech-l] How to fake a login with AuthManager?

2016-07-12 Thread Daniel Barrett
What is the proper incantation for faking a successful login (for a given user) as part of a unit test? My old code was: $context = RequestContext::getMain(); $specialPage = new LoginForm( $context->getRequest() ); $user->logout(); $specialPage->showReturnToPage('successredirect'); $specialPage->