Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F6008429
UploadStashTest.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
UploadStashTest.php
View Options
<?php
use
MediaWiki\Request\FauxRequest
;
/**
* @group Database
*
* @covers \UploadStash
*/
class
UploadStashTest
extends
MediaWikiIntegrationTestCase
{
/**
* @var string
*/
private
$tmpFile
;
protected
function
setUp
():
void
{
parent
::
setUp
();
$this
->
tmpFile
=
$this
->
getNewTempFile
();
file_put_contents
(
$this
->
tmpFile
,
"
\x
00"
);
}
public
static
function
provideInvalidRequests
()
{
return
[
'Check failure on bad wpFileKey'
=>
[
new
FauxRequest
(
[
'wpFileKey'
=>
'foo'
]
)
],
'Check failure on bad wpSessionKey'
=>
[
new
FauxRequest
(
[
'wpSessionKey'
=>
'foo'
]
)
],
];
}
/**
* @dataProvider provideInvalidRequests
*/
public
function
testValidRequestWithInvalidRequests
(
$request
)
{
$this
->
assertFalse
(
UploadFromStash
::
isValidRequest
(
$request
)
);
}
public
static
function
provideValidRequests
()
{
return
[
'Check good wpFileKey'
=>
[
new
FauxRequest
(
[
'wpFileKey'
=>
'testkey-test.test'
]
)
],
'Check good wpSessionKey'
=>
[
new
FauxRequest
(
[
'wpFileKey'
=>
'testkey-test.test'
]
)
],
'Check key precedence'
=>
[
new
FauxRequest
(
[
'wpFileKey'
=>
'testkey-test.test'
,
'wpSessionKey'
=>
'foo'
]
)
],
];
}
/**
* @dataProvider provideValidRequests
*/
public
function
testValidRequestWithValidRequests
(
$request
)
{
$this
->
assertTrue
(
UploadFromStash
::
isValidRequest
(
$request
)
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Oct 4 2026, 09:07 (5 w, 2 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
3e/04/72aab532fb8e54a95aa128b8f780
Default Alt Text
UploadStashTest.php (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment