hashar edited the task description. (Show Details) |
EDIT DETAILS
Case that works
============
Instead of trying to lookup the static method via namespace, if we refer to the canonical class path it seems to work:
```
lang=php
<?php
class CanonicalPathTest extends MediaWikiTestCase {
function testHamcrest() {
\Hamcrest\Matchers::both();
}
}
```
Global functions
=======
```
<?php
#use Hamcrest\Matchers;
Hamcrest\Util::registerGlobalFunctions();
class BlaTest extends MediaWikiTestCase {
function testHamcrest() {
assertThat();
#\Hamcrest\Matchers::both();
both();
}
}
```
Other findings
...
```Case that works
============
Instead of trying to lookup the static method via namespace, if we refer to the canonical class path it seems to work:
```
lang=php
<?php
class CanonicalPathTest extends MediaWikiTestCase {
function testHamcrest() {
\Hamcrest\Matchers::both();
}
}
```
Global functions
=======
```
<?php
#use Hamcrest\Matchers;
Hamcrest\Util::registerGlobalFunctions();
class BlaTest extends MediaWikiTestCase {
function testHamcrest() {
assertThat();
#\Hamcrest\Matchers::both();
both();
}
}
```
Other findings
...
TASK DETAIL
EMAIL PREFERENCES
To: hashar
Cc: gerritbot, hashar, Addshore, Aleksey_WMDE, aude, Aklapper, Th3d3v1ls, Ramalepe, Liugev6, Lewizho99, Maathavan, D3r1ck01, Izno, Wikidata-bugs, Mbch331
Cc: gerritbot, hashar, Addshore, Aleksey_WMDE, aude, Aklapper, Th3d3v1ls, Ramalepe, Liugev6, Lewizho99, Maathavan, D3r1ck01, Izno, Wikidata-bugs, Mbch331
_______________________________________________ Wikidata-bugs mailing list Wikidata-bugs@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs