Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F2752966
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
Fri, Jul 3, 20:37 (1 d, 9 h)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
70/10/f618de114607360e697d84f65e68
Default Alt Text
AddChangeTagTest.php (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment