Skip to content

Commit 008284f

Browse files
authored
Add MakefileTest (#195)
1 parent 5f9e090 commit 008284f

File tree

4 files changed

+61
-1
lines changed

4 files changed

+61
-1
lines changed

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ PHPSTAN = $(PHPSTAN_BIN)
2828

2929
PHPUNIT_BIN = vendor/bin/phpunit
3030
PHPUNIT = $(PHPUNIT_BIN)
31-
PHPUNIT_COVERAGE_INFECTION = XDEBUG_MODE=coverage $(PHPUNIT) --coverage-xml=$(COVERAGE_XML) --log-junit=$(COVERAGE_JUNIT)
31+
PHPUNIT_COVERAGE_INFECTION = XDEBUG_MODE=coverage $(PHPUNIT) --exclude-group autoreview --coverage-xml=$(COVERAGE_XML) --log-junit=$(COVERAGE_JUNIT)
3232
PHPUNIT_COVERAGE_HTML = XDEBUG_MODE=coverage $(PHPUNIT) --coverage-html=$(COVERAGE_HTML)
3333

3434
INFECTION_BIN = vendor/bin/infection

composer.json

+1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
"ext-json": "*",
3030
"bamarni/composer-bin-plugin": "^1.8",
3131
"ergebnis/composer-normalize": "^2.28",
32+
"fidry/makefile": "^0.2.1",
3233
"infection/infection": "^0.26.6",
3334
"jangregor/phpstan-prophecy": "^1.0",
3435
"phpspec/prophecy-phpunit": "^2.0",

infection.json5

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"src"
77
]
88
},
9+
"testFrameworkOptions": "--exclude-group=autoreview",
910
"logs": {
1011
"text": "dist/infection.log"
1112
},

tests/AutoReview/MakefileTest.php

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the Webmozarts Console Parallelization package.
5+
*
6+
* (c) Webmozarts GmbH <office@webmozarts.com>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
declare(strict_types=1);
13+
14+
namespace Webmozarts\Console\Parallelization\AutoReview;
15+
16+
use Fidry\Makefile\Test\BaseMakefileTestCase;
17+
18+
/**
19+
* @coversNothing
20+
* @group autoreview
21+
*
22+
* @internal
23+
*/
24+
final class MakefileTest extends BaseMakefileTestCase
25+
{
26+
protected static function getMakefilePath(): string
27+
{
28+
return __DIR__.'/../../Makefile';
29+
}
30+
31+
protected function getExpectedHelpOutput(): string
32+
{
33+
return <<<'EOF'
34+
Usage:
35+
make TARGET
36+
37+
#
38+
# Commands
39+
#---------------------------------------------------------------------------
40+
41+
cs: Fixes CS
42+
php_cs_fixer: Runs PHP-CS-Fixer
43+
gitignore_sort: Sorts the .gitignore entries
44+
composer_normalize: Normalizes the composer.json
45+
test: Runs all the tests
46+
phpstan: Runs PHPStan
47+
phpunit: Runs PHPUnit
48+
phpunit_coverage_infection: Runs PHPUnit with code coverage for Infection
49+
phpunit_coverage_html: Runs PHPUnit with code coverage with HTML report
50+
infection: Runs Infection
51+
validate-package: Validates the Composer package
52+
clear: Clears various artifacts
53+
clear_cache: Clears the integration test app cache
54+
clear_coverage: Clears the coverage reports
55+
56+
EOF;
57+
}
58+
}

0 commit comments

Comments
 (0)