You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SpeedTrap reports on slow-running tests in your PHPUnit test suite right in your console.
5
+
SpeedTrap reports on slow-running PHPUnit tests right in the console.
6
6
7
-
Many factors affect test execution time. A test not properly isolated from variable latency (database, network, etc.) and even basic load on your test machine will cause test times to fluctuate.
7
+
Many factors affect test execution time. A test not properly isolated from variable latency (database, network, etc.) and even basic load on the test machine will cause test execution times to fluctuate.
8
8
9
-
SpeedTrap helps you **identify slow tests** but cannot tell you **why** those tests are slow. For that you should check out [Blackfire.io](https://blackfire.io)for easy profiling your test suite, or another PHPUnit listener [PHPUnit\_Listener\_XHProf](https://github.com/sebastianbergmann/phpunit-testlistener-xhprof), to help identify specifically which methods in your call stack are slow.
9
+
SpeedTrap helps **identify slow tests** but cannot explain **why** those tests are slow. For that consider using [Blackfire.io](https://blackfire.io)to profile the test suite, or another PHPUnit listener [PHPUnit\_Listener\_XHProf](https://github.com/sebastianbergmann/phpunit-testlistener-xhprof), to specifically identify slow code.
10
10
11
11

12
12
@@ -19,7 +19,7 @@ SpeedTrap is installable via [Composer](http://getcomposer.org) and should be ad
19
19
20
20
## Usage
21
21
22
-
Enable with all defaults by adding the following to your test suite's `phpunit.xml` file:
22
+
Enable with all defaults by adding the following code to your project's `phpunit.xml` file:
23
23
24
24
```xml
25
25
<phpunitbootstrap="vendor/autoload.php">
@@ -30,7 +30,7 @@ Enable with all defaults by adding the following to your test suite's `phpunit.x
30
30
</phpunit>
31
31
```
32
32
33
-
Now run your test suite as normal. If tests run that exceed the slowness threshold (500ms by default), SpeedTrap will report on them in the console after the suite completes.
33
+
Now run the test suite as normal. If one or more test executions exceed the slowness threshold (500ms by default), SpeedTrap will report on those tests in the console after all tests have completed.
34
34
35
35
## Configuration
36
36
@@ -62,13 +62,13 @@ These configuration parameters are set in `phpunit.xml` when adding the listener
62
62
</phpunit>
63
63
```
64
64
65
-
This allows you to set your own criteria for "slow" tests, and how many you care to know about.
65
+
This allows customizing what the project considers a "slow" test and how many are reported on to project maintainers.
66
66
67
-
## Custom slow threshold per-test method
67
+
## Custom slowness threshold per-test case
68
68
69
-
You may have a few tests in your suite that take a little bit longer to run, and want to have a higher slow threshold than the rest of your suite.
69
+
Some projects have a few complex tests that take a long time to run. It is possible to set a different slowness threshold for individual test cases.
70
70
71
-
You can use the annotation `@slowThreshold` to set a custom slow threshold on a per-test method basis. This number can be higher or lower than the default threshold and will be used in place of the default threshold for that specific test.
71
+
Use the annotation `@slowThreshold` to set a custom slowness threshold for single test cases. This number may be higher or lower than the default threshold and will be used in place of the default threshold for that specific test.
72
72
73
73
```php
74
74
class SomeTestCase extends \PHPUnit_Framework_TestCase
@@ -78,7 +78,7 @@ class SomeTestCase extends \PHPUnit_Framework_TestCase
0 commit comments