Go to the documentation of this file.
18 $this->tablesUsed = array_merge(
20 [
'change_tag',
'change_tag_def',
'logging' ]
25 $name =
'Help:' . ucfirst( __FUNCTION__ );
36 $this->assertArrayHasKey(
'delete', $apiResult );
37 $this->assertArrayHasKey(
'title', $apiResult[
'delete'] );
38 $this->assertSame(
$name, $apiResult[
'delete'][
'title'] );
39 $this->assertArrayHasKey(
'logid', $apiResult[
'delete'] );
47 $name =
'Help:' . ucfirst( __FUNCTION__ );
48 for ( $i = 1; $i <= 3; $i++ ) {
57 $this->assertArrayHasKey(
'delete', $apiResult );
58 $this->assertArrayHasKey(
'title', $apiResult[
'delete'] );
59 $this->assertSame(
$name, $apiResult[
'delete'][
'title'] );
60 $this->assertArrayHasKey(
'scheduled', $apiResult[
'delete'] );
61 $this->assertTrue( $apiResult[
'delete'][
'scheduled'] );
62 $this->assertArrayNotHasKey(
'logid', $apiResult[
'delete'] );
75 "The page you specified doesn't exist." );
79 'title' =>
'This page deliberately left nonexistent',
85 'The action you have requested is limited to users in the group:' );
87 $name =
'Help:' . ucfirst( __FUNCTION__ );
98 'token' =>
$user->getEditToken(),
99 ],
null,
null,
$user );
107 $name =
'Help:' . ucfirst( __FUNCTION__ );
114 'action' =>
'delete',
116 'tags' =>
'custom tag',
122 $this->assertSame(
'custom tag', $dbw->selectField(
123 [
'change_tag',
'logging' ],
127 'log_title' => ucfirst( __FUNCTION__ ),
131 [
'change_tag' => [
'INNER JOIN',
'ct_log_id = log_id' ] ]
137 $name =
'Help:' . ucfirst( __FUNCTION__ );
144 'action' =>
'delete',
146 'tags' =>
'custom tag',
152 $this->assertSame(
'custom tag', $dbw->selectField(
153 [
'change_tag',
'logging',
'change_tag_def' ],
157 'log_title' => ucfirst( __FUNCTION__ ),
162 'change_tag' => [
'INNER JOIN',
'ct_log_id = log_id' ],
163 'change_tag_def' => [
'INNER JOIN',
'ctd_id = ct_tag_id' ]
170 'You do not have permission to apply change tags along with your changes.' );
172 $name =
'Help:' . ucfirst( __FUNCTION__ );
176 [
'user' => [
'applychangetags' =>
true ] ] );
182 'action' =>
'delete',
184 'tags' =>
'custom tag',
193 'Deletion aborted by hook. It gave no explanation.' );
195 $name =
'Help:' . ucfirst( __FUNCTION__ );
213 $name =
'Help:' . ucfirst( __FUNCTION__ );
214 $user = self::$users[
'sysop']->getUser();
227 $name =
'Help:' . ucfirst( __FUNCTION__ );
228 $user = self::$users[
'sysop']->getUser();
Maintenance script that runs pending jobs.
please add to it if you re going to add events to the MediaWiki code where normally authentication against an external auth plugin would be creating a account $user
static newFromText( $text, $defaultNamespace=NS_MAIN)
Create a new Title from text, such as what one would find in a link.
loadParamsAndArgs( $self=null, $opts=null, $args=null)
Process command line arguments $mOptions becomes an array with keys set to the option names $mArgs be...
const MIGRATION_WRITE_BOTH
static destroySingletons()
Destroy the singleton instances.
injection txt This is an overview of how MediaWiki makes use of dependency injection The design described here grew from the discussion of RFC T384 The term dependency this means that anything an object needs to operate should be injected from the the object itself should only know narrow no concrete implementation of the logic it relies on The requirement to inject everything typically results in an architecture that based on two main types of and essentially stateless service objects that use other service objects to operate on the value objects As of the beginning MediaWiki is only starting to use the DI approach Much of the code still relies on global state or direct resulting in a highly cyclical dependency which acts as the top level factory for services in MediaWiki which can be used to gain access to default instances of various services MediaWikiServices however also allows new services to be defined and default services to be redefined Services are defined or redefined by providing a callback the instantiator that will return a new instance of the service When it will create an instance of MediaWikiServices and populate it with the services defined in the files listed by thereby bootstrapping the DI framework Per $wgServiceWiringFiles lists includes ServiceWiring php
doApiRequest(array $params, array $session=null, $appendModule=false, User $user=null, $tokenType=null)
Does the API request and returns the result.
Tests for MediaWiki api.php?action=delete.
wfGetDB( $db, $groups=[], $wiki=false)
Get a Database object.
doApiRequestWithToken(array $params, array $session=null, User $user=null, $tokenType='auto')
Convenience function to access the token parameter of doApiRequest() more succinctly.
Allows to change the fields on the form that will be generated $name
const GAID_FOR_UPDATE
Used to be GAID_FOR_UPDATE define.
testDeleteWithoutTagPermission()
testDeleteAbortedByHook()
you have access to all of the normal MediaWiki so you can get a DB use the etc For full docs on the Maintenance class
testDeletionWithoutPermission()
testDeleteWithTagNewBackend()