Skip to content

Commit a4651b8

Browse files
✨ Add coverage
1 parent 081d20b commit a4651b8

File tree

4 files changed

+16
-10
lines changed

4 files changed

+16
-10
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
.idea/
22
composer.phar
3+
coverage/
34
vendor/

SymfonyCustom/Tests/NamingConventions/ValidFileNameUnitTest.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,8 @@ class ValidFileNameUnitTest extends AbstractSniffUnitTest
2121
protected function getErrorList($filename = '')
2222
{
2323
switch ($filename) {
24-
case 'ValidFileNameUnitTest.inc':
25-
return [];
2624
case 'ValidFileNameUnitTest.Invalid.inc':
27-
return [
28-
1 => 1,
29-
];
25+
return [1 => 1];
3026
default:
3127
return [];
3228
}

build.xml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,15 @@
3939
</exec>
4040
</target>
4141

42+
<target name="coverage" depends="symlink-cs" description="Run coverage with PHPUnit">
43+
<exec executable="${phpunit.bin}" failonerror="true" >
44+
<arg value="--verbose"/>
45+
<arg value="--group=SymfonyCustom"/>
46+
<arg value="${phpcs.dir}/tests/AllTests.php"/>
47+
<arg value="--coverage-html=coverage"/>
48+
</exec>
49+
</target>
50+
4251
<target name="phpcs" depends="symlink-cs" description="Find coding standard violations using PHP Code Sniffer">
4352
<exec executable="${phpcs.bin}" failonerror="true">
4453
<arg value="--standard=SymfonyCustom"/>

phpunit.xml.dist

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
stopOnFailure="false"
1111
bootstrap="./bootstrap.php"
1212
>
13-
<testsuites>
14-
<testsuite name="Symfony Coding Standard Test Suite">
15-
<file>./vendor/squizlabs/php_codesniffer/tests/Standards/AllSniffs.php</file>
16-
</testsuite>
17-
</testsuites>
13+
<filter>
14+
<whitelist>
15+
<directory>./vendor/squizlabs/php_codesniffer/src/Standards/SymfonyCustom</directory>
16+
</whitelist>
17+
</filter>
1818
</phpunit>

0 commit comments

Comments
 (0)