Re: [Wikitech-l] MediaWiki Stakeholders' meta-repository of extensions not in gerrit

2017-12-25 Thread K. Peachey
https://www.mediawiki.org/wiki/Category:Extensions_in_GitHub_version_control
https://www.mediawiki.org/wiki/Category:Extensions_in_Google_Code_version_control
https://www.mediawiki.org/wiki/Category:Extensions_in_SourceForge_version_control

On 24 December 2017 at 09:05, Mark A. Hershberger  wrote:
>
> This afternoon, while procrastinating by cleaning up my clone of
> gerrit's mediawiki extensions repository, I decided to make a meta
> repository for some non-WMF-hosted extensions.  (Hopefully this will
> mean less need to clean up the clone in the future.)
>
> I got some low-hanging fruit to start it off, but I'm hoping I can get
> some pull requests to add more repositories.
>
> Check it out: https://github.com/MWStake/nonwmf-extensions
>
> Thanks,
>
> Mark.
>
> ___
> Wikitech-l mailing list
> Wikitech-l@lists.wikimedia.org
> https://lists.wikimedia.org/mailman/listinfo/wikitech-l

___
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l

Re: [Wikitech-l] Setting logged in user context on unit tests

2017-12-25 Thread Gergo Tisza
On Mon, Dec 25, 2017 at 12:00 PM, Tony Thomas <01tonytho...@gmail.com>
wrote:

> 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 ?
>

No need to mimic, you can just inject it (as long as the special page
correctly uses $this->getUser() & co instead of using globals, which is
usually not a problem with special pages) :

$specialPage = $this->newSpecialPage();
$context = new DerivativeContext( RequestContext::getMain() );
$context->setUser( $user );
$context->setRequest( ... );
$specialPage->setContext( $context );
$res = $specialPage->onSubmit( $input );
___
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l

Re: [Wikitech-l] Setting logged in user context on unit tests

2017-12-25 Thread Amir Ladsgroup
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 <01tonytho...@gmail.com> 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/35/4/tests/specials/SpecialNewsletterCreateTest.php
>
>
> --
> Tony Thomas
> https://mediawiki.org/wiki/User:01tonythomas
> --
> ___
> Wikitech-l mailing list
> Wikitech-l@lists.wikimedia.org
> https://lists.wikimedia.org/mailman/listinfo/wikitech-l
___
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l

Re: [Wikitech-l] MediaWiki Stakeholders' meta-repository of extensions not in gerrit

2017-12-25 Thread Niklas Laxström
2017-12-24 1:05 GMT+02:00 Mark A. Hershberger :

>
> This afternoon, while procrastinating by cleaning up my clone of
> gerrit's mediawiki extensions repository, I decided to make a meta
> repository for some non-WMF-hosted extensions.  (Hopefully this will
> mean less need to clean up the clone in the future.)
>
> I got some low-hanging fruit to start it off, but I'm hoping I can get
> some pull requests to add more repositories.
>

Some more:
https://github.com/wikimedia/translatewiki/blob/master/repoconfig.yaml#L314-L433

Why submodules? Is someone planning to keep those up to date?

  -Niklas
___
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l

[Wikitech-l] Setting logged in user context on unit tests

2017-12-25 Thread Tony Thomas
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/35/4/tests/specials/SpecialNewsletterCreateTest.php


--
Tony Thomas
https://mediawiki.org/wiki/User:01tonythomas
--
___
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l