17 $this->assertEquals( $expected,
$job->toString() );
21 $mockToStringObj = $this->getMockBuilder(
'stdClass' )
22 ->setMethods( [
'__toString' ] )->getMock();
23 $mockToStringObj->expects( $this->
any() )
24 ->method(
'__toString' )
25 ->will( $this->returnValue(
'{STRING_OBJ_VAL}' ) );
27 $requestId =
'requestId=' . WebRequest::getRequestId();
32 'someCommand ' . $requestId
36 'someCommand key=val ' . $requestId
39 $this->
getMockJob( [
'key' => [
'inkey' =>
'inval' ] ] ),
40 'someCommand key={"inkey":"inval"} ' . $requestId
44 'someCommand 0=val1 ' . $requestId
48 'someCommand 0=val1 1=val2 ' . $requestId
52 'someCommand 0=object(stdClass) ' . $requestId
56 'someCommand 0={STRING_OBJ_VAL} ' . $requestId
66 "rootJobSignature" =>
"45868e99bba89064e4483743ebb9b682ef95c1a7",
67 "rootJobTimestamp" =>
"20160309110158",
69 "file" =>
"db1023-bin.001288",
71 "asOfTime" => 1457521464.3814
73 "triggeredRecursive" =>
true
75 'someCommand pages={"932737":[0,"Robert_James_Waller"]} ' .
76 'rootJobSignature=45868e99bba89064e4483743ebb9b682ef95c1a7 ' .
77 'rootJobTimestamp=20160309110158 masterPos=' .
78 '{"file":"db1023-bin.001288","pos":"308257743","asOfTime":1457521464.3814} ' .
79 'triggeredRecursive=1 ' .
86 $mock = $this->getMockForAbstractClass(
102 $this->mergeMWGlobalArrayValue(
'wgJobClasses', [
'testdummy' =>
$handler ] );
105 $this->assertInstanceOf( NullJob::class,
$job );
107 $job2 =
Job::factory(
'testdummy', Title::newMainPage(), [] );
108 $this->assertInstanceOf( NullJob::class, $job2 );
109 $this->assertNotSame(
$job, $job2,
'should not reuse instance' );
114 'class name' => [
'NullJob' ],
118 'function' => [ [ $this,
'newNullJob' ] ],
119 'static function' => [ self::class .
'::staticNullJob' ]
they could even be mouse clicks or menu items whatever suits your program You should also get your if any
newNullJob(Title $title, array $params)
testJobFactory( $handler)
provideTestJobFactory
static staticNullJob(Title $title, array $params)
testToString( $job, $expected)
provideTestToString
static factory( $command, Title $title, $params=[])
Create the appropriate object to handle a specific job.
Degenerate job that does nothing, but can optionally replace itself in the queue and/or sleep for a b...
Represents a title within MediaWiki.
namespace and then decline to actually register it file or subcat img or subcat $title
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 modifiable after all normalizations have been except for the $wgMaxImageArea check set to true or false to override the $wgMaxImageArea check result gives extension the possibility to transform it themselves $handler
if(count( $args)< 1) $job