6class ClassCollectorTest
extends PHPUnit\Framework\TestCase {
8 use MediaWikiCoversValidator;
10 public static function provideCases() {
17 "namespace Example;\nclass Foo {}\nclass Bar {}",
18 [
'Example\Foo',
'Example\Bar' ],
21 "class_alias( 'Foo', 'Bar' );",
25 "namespace Example;\nclass Foo {}\nclass_alias( 'Example\Foo', 'Foo' );",
26 [
'Example\Foo',
'Foo' ],
29 "namespace Example;\nclass Foo {}\nclass_alias( 'Example\Foo', 'Bar' );",
30 [
'Example\Foo',
'Bar' ],
33 "class_alias( Foo::class, 'Bar' );",
39 "class_alias( Example\Foo::class, 'Bar' );",
43 "namespace Example;\nclass Foo {}\nclass_alias( Foo::class, 'Bar' );",
44 [
'Example\Foo',
'Bar' ],
47 "new class() extends Foo {}",
56 public function testGetClasses(
$code,
array $classes, $message =
null ) {
58 $this->assertEquals( $classes, $cc->getClasses(
"<?php\n$code" ), $message );
Reads PHP code and returns the FQCN of every class defined within it.
this hook is for auditing only or null if authentication failed before getting that far or null if we can t even determine that probably a stub it is not rendered in wiki pages or galleries in category pages allow injecting custom HTML after the section Any uses of the hook need to handle escaping see BaseTemplate::getToolbox and BaseTemplate::makeListItem for details on the format of individual items inside of this array or by returning and letting standard HTTP rendering take place modifiable or by returning false and taking over the output modifiable & $code
The wiki should then use memcached to cache various data To use multiple just add more items to the array To increase the weight of a make its entry a array("192.168.0.1:11211", 2))