Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F4070993
PhpFileWriterTest.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
981 B
Referenced Files
None
Subscribers
None
PhpFileWriterTest.php
View Options
<?php
use
MediaWiki\Extension\CLDR\PhpFileWriter
;
/**
* @license GPL-2.0-or-later
*
* @covers MediaWiki\Extension\CLDR\PhpFileWriter
*/
class
PhpFileWriterTest
extends
MediaWikiIntegrationTestCase
{
/**
* @dataProvider provideSavePhp
* @param array $data
* @param string $expectedText
*/
public
function
testSavePhp
(
$data
,
$expectedText
)
{
$tmpFile
=
tempnam
(
sys_get_temp_dir
(),
'testSavePhp'
);
$writer
=
new
PhpFileWriter
();
$writer
->
savephp
(
$data
,
$tmpFile
);
$this
->
assertEquals
(
$expectedText
,
file_get_contents
(
$tmpFile
)
);
}
public
static
function
provideSavePhp
()
{
return
[
'no data'
=>
[
[],
''
],
'basic'
=>
[
[
'testEmpty'
=>
[],
'testStr'
=>
[
'foo'
],
'testList'
=>
[
'foo'
=>
'bar'
],
],
<<<
'EOT'
<?
php
// This file is generated by rebuild.php. Do not edit it directly.
$testStr
=
[
'foo'
,
];
$testList
=
[
'foo'
=>
'bar'
,
];
EOT
,
],
];
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Aug 17 2026, 02:27 (11 w, 5 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
a7/6b/923d57c71c8c4c678994db454276
Default Alt Text
PhpFileWriterTest.php (981 B)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment