Skip to content

Commit 6f2ea0a

Browse files
committedJun 6, 2014
Travis checks if PHPUnit correctly fails.
1 parent 58bead2 commit 6f2ea0a

File tree

3 files changed

+24
-1
lines changed

3 files changed

+24
-1
lines changed
 

‎.travis.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ before_script:
1212
- composer self-update
1313
- composer install --no-interaction --prefer-source --dev
1414

15-
script: ./phpunit --configuration ./build/travis-ci.xml
15+
script:
16+
- ./phpunit --configuration ./build/travis-ci.xml
17+
- ./phpunit --configuration ./build/travis-ci-fail.xml > /dev/null; if [ $? -eq 0 ]; then echo "SHOULD FAIL"; exit 1; else echo "fail checked"; fi;
1618

1719
notifications:
1820
email: false

‎build/travis-ci-fail.xml

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.2/phpunit.xsd"
4+
bootstrap="../tests/bootstrap-travis.php"
5+
backupGlobals="false"
6+
verbose="true">
7+
<testsuites>
8+
<testsuite name="small">
9+
<directory suffix=".phpt">../tests/Fail</directory>
10+
</testsuite>
11+
</testsuites>
12+
13+
<php>
14+
<const name="PHPUNIT_TESTSUITE" value="true"/>
15+
</php>
16+
</phpunit>

‎tests/Fail/fail.phpt

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
--TEST--
2+
// This test intentionally fails and it is checked by Travis.
3+
--FILE--
4+
--EXPECTF--
5+
unexpected

0 commit comments

Comments
 (0)
Please sign in to comment.