Skip to content

Commit 33c877b

Browse files
committed
Cleanup, tweak script
1 parent eabff5a commit 33c877b

6 files changed

+17
-29
lines changed

Diff for: CHANGELOG.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Changelog
22

3-
All notable changes to `phpunitrunfailed` will be documented in this file
3+
All notable changes to `phpunit-failed-runner` will be documented in this file
44

5-
## 1.0.0 - 201X-XX-XX
5+
## 1.0.0 - 2021-07-18
66

7-
- initial release
7+
- Initial release

Diff for: README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Very short description of the package
1+
# Run Only Your Failed Tests
22

33
[![Latest Version on Packagist](https://img.shields.io/packagist/v/chrisdicarl/phpunit-failed-runner.svg?style=flat-square)](https://packagist.org/packages/chrisdicarl/phpunit-failed-runner)
44
[![Total Downloads](https://img.shields.io/packagist/dt/chrisdicarl/phpunit-failed-runner.svg?style=flat-square)](https://packagist.org/packages/chrisdicarl/phpunit-failed-runner)
@@ -11,7 +11,7 @@ Small package that allows you to run only your previously failed tests.
1111
You can install the package via composer:
1212

1313
```bash
14-
composer require chrisdicarl/phpunit-failed-runner
14+
composer require chrisdicarl/phpunit-failed-runner --dev
1515
```
1616

1717
## Configuration

Diff for: composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "chrisdicarlo/phpunit-failed-runner",
3-
"description": "Run only your failed Phpunit tests",
3+
"description": "Run only your failed PHPUnit tests",
44
"keywords": [
55
"chrisdicarlo",
66
"phpunit-failed-runner",

Diff for: failed-tests.xsl

+5-10
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,13 @@
77
</xsl:template>
88

99
<xsl:template match="tests">
10-
<xsl:apply-templates select="./test[@status = '3']" />
10+
<xsl:apply-templates select="./test[@status = '3']" />
1111
</xsl:template>
1212

1313
<xsl:template match="test">
14-
<xsl:choose>
15-
<xsl:when test="@status = 3">
16-
<xsl:value-of select="@methodName" />
17-
<xsl:if test="position() != last()">
18-
<xsl:text>,</xsl:text>
19-
</xsl:if>
20-
</xsl:when>
21-
<xsl:otherwise />
22-
</xsl:choose>
14+
<xsl:value-of select="@methodName" />
15+
<xsl:if test="position() != last()">
16+
<xsl:text>|</xsl:text>
17+
</xsl:if>
2318
</xsl:template>
2419
</xsl:stylesheet>

Diff for: phpunit-failed-runner

+6-5
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,19 @@
22

33
logfile=./testdox.xml
44
if test -f "$logfile"; then
5-
echo "Logfile found. Filter for failed..."
6-
failed_tests="$(xmlstarlet tr --omit-decl ./vendor/chrisdicarlo/phpunit-failed-runner/failed-tests.xsl testdox.xml | sed s/\,/\|/g)"
5+
echo "Logfile found. Searching for failed tests..."
6+
failed_tests="$(xmlstarlet tr --omit-decl ./vendor/chrisdicarlo/phpunit-failed-runner/failed-tests.xsl testdox.xml)"
77

88
if [ "$failed_tests" = "" ]; then
9-
echo "No failed tests! Great job!"
9+
echo "No failed tests! Great job!"
10+
rm ./testdox.xml
1011
else
1112
./vendor/bin/phpunit --filter "'$failed_tests'"
1213
fi
1314

1415
else
15-
echo "Logfile not found. Running the full test suite..."
16-
./phpunit
16+
echo "Logfile not found. Running the full test suite..."
17+
./vendor/bin/phpunit
1718
fi
1819

1920
exit 0

Diff for: src/PhpunitRunFailed.php

-8
This file was deleted.

0 commit comments

Comments
 (0)