Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F6028398
bootstrap.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
bootstrap.php
View Options
<?php
/**
* Bootstrap file for PHP_CodeSniffer unit tests.
*
* @author Greg Sherwood <gsherwood@squiz.net>
* @copyright 2006-2017 Squiz Pty Ltd (ABN 77 084 670 600)
* @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence
*/
if
(
defined
(
'PHP_CODESNIFFER_IN_TESTS'
)
===
false
)
{
define
(
'PHP_CODESNIFFER_IN_TESTS'
,
true
);
}
if
(
defined
(
'PHP_CODESNIFFER_CBF'
)
===
false
)
{
define
(
'PHP_CODESNIFFER_CBF'
,
false
);
}
if
(
defined
(
'PHP_CODESNIFFER_VERBOSITY'
)
===
false
)
{
define
(
'PHP_CODESNIFFER_VERBOSITY'
,
0
);
}
require_once
__DIR__
.
'/../autoload.php'
;
$tokens
=
new
\PHP_CodeSniffer\Util\Tokens
();
// Compatibility for PHPUnit < 6 and PHPUnit 6+.
if
(
class_exists
(
'PHPUnit_Framework_TestSuite'
)
===
true
&&
class_exists
(
'PHPUnit
\F
ramework
\T
estSuite'
)
===
false
)
{
class_alias
(
'PHPUnit_Framework_TestSuite'
,
'PHPUnit'
.
'
\F
ramework
\T
estSuite'
);
}
if
(
class_exists
(
'PHPUnit_Framework_TestCase'
)
===
true
&&
class_exists
(
'PHPUnit
\F
ramework
\T
estCase'
)
===
false
)
{
class_alias
(
'PHPUnit_Framework_TestCase'
,
'PHPUnit'
.
'
\F
ramework
\T
estCase'
);
}
if
(
class_exists
(
'PHPUnit_TextUI_TestRunner'
)
===
true
&&
class_exists
(
'PHPUnit
\T
extUI
\T
estRunner'
)
===
false
)
{
class_alias
(
'PHPUnit_TextUI_TestRunner'
,
'PHPUnit'
.
'
\T
extUI
\T
estRunner'
);
}
if
(
class_exists
(
'PHPUnit_Framework_TestResult'
)
===
true
&&
class_exists
(
'PHPUnit
\F
ramework
\T
estResult'
)
===
false
)
{
class_alias
(
'PHPUnit_Framework_TestResult'
,
'PHPUnit'
.
'
\F
ramework
\T
estResult'
);
}
/**
* A global util function to help print unit test fixing data.
*
* @return void
*/
function
printPHPCodeSnifferTestOutput
()
{
echo
PHP_EOL
.
PHP_EOL
;
$output
=
'The test files'
;
$data
=
[];
$codeCount
=
count
(
$GLOBALS
[
'PHP_CODESNIFFER_SNIFF_CODES'
]);
if
(
empty
(
$GLOBALS
[
'PHP_CODESNIFFER_SNIFF_CASE_FILES'
])
===
false
)
{
$files
=
call_user_func_array
(
'array_merge'
,
$GLOBALS
[
'PHP_CODESNIFFER_SNIFF_CASE_FILES'
]);
$files
=
array_unique
(
$files
);
$fileCount
=
count
(
$files
);
$output
=
'%d sniff test files'
;
$data
[]
=
$fileCount
;
}
$output
.=
' generated %d unique error codes'
;
$data
[]
=
$codeCount
;
if
(
$codeCount
>
0
)
{
$fixes
=
count
(
$GLOBALS
[
'PHP_CODESNIFFER_FIXABLE_CODES'
]);
$percent
=
round
((
$fixes
/
$codeCount
*
100
),
2
);
$output
.=
'; %d were fixable (%d%%)'
;
$data
[]
=
$fixes
;
$data
[]
=
$percent
;
}
vprintf
(
$output
,
$data
);
}
//end printPHPCodeSnifferTestOutput()
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Oct 4 2026, 17:14 (5 w, 4 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
d1/e9/4cf2592c9989b18d36ea00992179
Default Alt Text
bootstrap.php (2 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment