Skip to content

Commit 35a4b1c

Browse files
🚨 Fix tests execution
1 parent 24295cd commit 35a4b1c

File tree

4 files changed

+1574
-2
lines changed

4 files changed

+1574
-2
lines changed

bootstrap.php

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?php
2+
3+
$myStandardName = 'SymfonyCustom';
4+
5+
require_once __DIR__.'/vendor/squizlabs/php_codesniffer/tests/bootstrap.php';
6+
7+
// Add this Standard
8+
PHP_CodeSniffer\Config::setConfigData(
9+
'installed_paths',
10+
__DIR__.DIRECTORY_SEPARATOR.'SymfonyCustom',
11+
true
12+
);
13+
14+
// Ignore all other Standards in tests
15+
$standards = PHP_CodeSniffer\Util\Standards::getInstalledStandards();
16+
$standards[] = 'Generic';
17+
18+
$ignoredStandardsStr = implode(
19+
',',
20+
array_filter(
21+
$standards,
22+
function ($v) use ($myStandardName) {
23+
return $v !== $myStandardName;
24+
}
25+
)
26+
);
27+
28+
putenv("PHPCS_IGNORE_TESTS={$ignoredStandardsStr}");

composer.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,8 @@
1717
],
1818
"require": {
1919
"squizlabs/php_codesniffer": "3.2.*"
20+
},
21+
"require-dev": {
22+
"phpunit/phpunit": "^6.0"
2023
}
2124
}

0 commit comments

Comments
 (0)