Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F4126432
AddChangeTagTest.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
AddChangeTagTest.php
View Options
<?php
namespace
MediaWiki\Tests\Maintenance
;
use
AddChangeTag
;
/**
* @covers \AddChangeTag
* @group Database
* @author Dreamy Jazz
*/
class
AddChangeTagTest
extends
MaintenanceBaseTestCase
{
public
function
getMaintenanceClass
()
{
return
AddChangeTag
::
class
;
}
public
function
testExecuteForEmptyTagOption
()
{
$this
->
expectCallToFatalError
();
$expectedErrorMessage
=
wfMessage
(
'tags-create-no-name'
)->
text
();
$this
->
expectOutputRegex
(
"/$expectedErrorMessage/"
);
$this
->
maintenance
->
setOption
(
'tag'
,
''
);
$this
->
maintenance
->
setOption
(
'reason'
,
'test'
);
$this
->
maintenance
->
execute
();
}
public
function
testExecuteForSuccessfulCreation
()
{
$this
->
maintenance
->
setOption
(
'tag'
,
'new-test-tag'
);
$this
->
maintenance
->
setOption
(
'reason'
,
'testing'
);
$this
->
expectOutputRegex
(
'/new-test-tag was created/'
);
$this
->
maintenance
->
execute
();
// Validate that the tag actually exists in the DB.
$this
->
newSelectQueryBuilder
()
->
select
(
'COUNT(*)'
)
->
from
(
'change_tag_def'
)
->
where
(
[
'ctd_name'
=>
'new-test-tag'
]
)
->
assertFieldValue
(
1
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Wed, Aug 19, 08:05 (2 w, 3 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
86/2a/7c5ad1589a6bbbaa92f7adc3f2cf
Default Alt Text
AddChangeTagTest.php (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment