|
5 | 5 |
|
6 | 6 | Sample demonstrates techniques for using Testspace with PHP code and the [PHPUnit test framework](https://phpunit.de/). |
7 | 7 |
|
| 8 | +*** |
| 9 | +Using Multiple Online CI Services: |
| 10 | + |
8 | 11 | [](https://travis-ci.org/testspace-samples/php.phpunit) |
9 | | -[](https://samples.testspace.com/projects/86/spaces/290 "Test Cases") |
10 | | -[](https://samples.testspace.com/projects/86/spaces/290/metrics#metric-185 "Line/Statement Coverage") |
| 12 | +[](https://circleci.com/gh/testspace-samples/php.phpunit) |
| 13 | +[](https://app.shippable.com/projects/57029e282a8192902e1b8d56) |
| 14 | + |
| 15 | +*** |
| 16 | +Publishing **Test Content** using www.testspace.com. |
| 17 | + |
| 18 | +[](https://samples.testspace.com/projects/119/spaces/441 "Test Cases") |
| 19 | +[](https://samples.testspace.com/spaces/441/schema/Code%20Coverage "Code Coverage (statements)") |
| 20 | +[](https://samples.testspace.com/spaces/441/schema/Code%20Coverage "Code Coverage (methods)") |
| 21 | +[](https://samples.testspace.com/spaces/441/schema/Static%20Analysis "Static Analysis (issues)") |
11 | 22 |
|
12 | 23 |
|
13 | 24 | *** |
14 | 25 |
|
15 | 26 | In order to run this sample you will need a host workstation that supports the PHP. |
16 | 27 |
|
| 28 | +Installation |
| 29 | +<pre> |
| 30 | +composer update |
| 31 | +</pre> |
| 32 | + |
| 33 | +Running Static Analysis: |
| 34 | + |
| 35 | +<pre> |
| 36 | +vendor/bin/phpcs src tests --report-gitblame=analysis-sniffer-blame.txt --report-checkstyle=analysis-sniffer.xml |
| 37 | +vendor/bin/phpmd src,tests xml codesize,naming,unusedcode --reportfile analysis-mess.xml |
| 38 | +</pre> |
| 39 | + |
| 40 | +Running Tests with Code Coverage |
17 | 41 | <pre> |
18 | | -composer install |
19 | 42 | vendor/bin/phpunit tests/unit --log-junit tests-results.xml --coverage-clover coverage.xml |
20 | 43 | </pre> |
21 | 44 |
|
22 | | -Publishing results example: |
| 45 | +Publishing Results using **Testspace**: (note, `.testspace` contains files to publish) |
23 | 46 |
|
24 | 47 | <pre> |
25 | | -testspace publish [Tests]tests-results.xml{tests/unit} coverage.xml |
| 48 | +curl -s https://testspace-client.s3.amazonaws.com/testspace-linux.tgz | sudo tar -zxvf- -C /usr/local/bin |
| 49 | +testspace @.testspace $TESTSPACE_TOKEN/$BRANCH_NAME |
26 | 50 | </pre> |
27 | 51 |
|
28 | | -Checkout the [Space](https://samples.testspace.com/projects/php/spaces/phpunit). |
29 | 52 |
|
30 | | -*** |
| 53 | +Checkout the [Space](https://samples.testspace.com/projects/php/spaces/php.unit). |
31 | 54 |
|
| 55 | +*** |
32 | 56 |
|
33 | | -To fork this example using Travis requires: |
| 57 | +To replicate this sample: |
34 | 58 | - Account at www.testspace.com. |
35 | | - - Travis Environment Variable: |
36 | | - - `TESTSPACE_URL` = `credentials:@my-org-name.testspace.com/my-project/my-space` |
| 59 | + - CI Environment Variable called **TESTSPACE_TOKEN** required: |
| 60 | + - `TESTSPACE_TOKEN` = `[email protected]/my-project` |
37 | 61 | - `credentials` set to `username:password` or your [access token](http://help.testspace.com/using-your-organization:user-settings). |
38 | | - - `my-org-name.testspace.com/my-project/my-space` based on your subdomain, project, and space names. Refer [here](http://help.testspace.com/reference:runner-reference#login-credentials) for more details. |
39 | | - |
| 62 | + - `my-org-name.testspace.com/my-project` based on your *subdomain* and *project* names. Refer [here](http://help.testspace.com/reference:runner-reference#login-credentials) for more details. |
| 63 | + |
0 commit comments