Skip to content

Commit

Permalink
Awesome code coverage for phpunit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Maykonn committed May 23, 2018
1 parent 23c9449 commit fa0ad04
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.idea/
vendor/
test/_reports/
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,21 @@
## How to execute the program:
`php index.php < stdin.txt`

The output is the new position on Plateau for each Rover on Squad.

## How to execute the program test suite:
`make test`

The output is the test results.
You can see the tests results as html in /test/_reports after run the `make test` command.
Please, install XDebug to get awesome code coverage html report in the same directory:

`sudo apt-get install php7.2-xdebug`

`make test`

And access mars-rovers-squad/test/_reports/coverage/ using your browser.

## Overview
Purpose of this challenge is to enable you to demonstrate your proficiency in solving problems
using software engineering tools and processes. Read the specification below and produce a
Expand Down
14 changes: 14 additions & 0 deletions phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,15 @@
stopOnFailure="false"
verbose="true"
bootstrap="./vendor/autoload.php">
<filter>
<whitelist>
<directory>./src</directory>
<exclude>
<directory>./vendor</directory>
<directory>./test</directory>
</exclude>
</whitelist>
</filter>
<testsuites>
<testsuite name="MarsRover">
<file>./test/Service/CommandFactoryTest.php</file>
Expand All @@ -25,4 +34,9 @@
<file>./test/Model/Command/TurnRightTest.php</file>
</testsuite>
</testsuites>
<logging>
<log type="coverage-html" target="test/_reports/coverage" charset="UTF-8" yui="true" highlight="true"
lowUpperBound="35" highLowerBound="70"/>
<log type="testdox-html" target="test/_reports/coverage/index.html"/>
</logging>
</phpunit>

0 comments on commit fa0ad04

Please sign in to comment.