forked from djoos/Symfony-coding-standard
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tests_bootstrap.php
37 lines (31 loc) · 951 Bytes
/
tests_bootstrap.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<?php
/**
* Bootstrap file for PHP_CodeSniffer Symfony Coding Standard unit tests.
*
* PHP version 5
*
* @category PHP
* @package Symfony-coding-standard
* @author Xaver Loppenstedt <xaver@loppenstedt.de>
* @license http://spdx.org/licenses/MIT MIT License
* @link https://github.com/djoos/Symfony-coding-standard
*/
$myStandardName = 'Symfony';
require_once __DIR__.'/vendor/squizlabs/php_codesniffer/tests/bootstrap.php';
// Add this Standard
PHP_CodeSniffer\Config::setConfigData(
'installed_paths',
__DIR__.DIRECTORY_SEPARATOR.'Symfony',
true
);
// Ignore all other Standards in tests
$standards = PHP_CodeSniffer\Util\Standards::getInstalledStandards();
$standards[] = 'Generic';
$ignoredStandardsStr = implode(
',', array_filter(
$standards, function ($v) use ($myStandardName) {
return $v !== $myStandardName;
}
)
);
putenv("PHPCS_IGNORE_TESTS={$ignoredStandardsStr}");