sebastianbergmann/phpunit — pull request #645 by stjohnjohnson (2012-09-14 17:25:11+00:00)
Title: Time Threshold Annotation

Howdy!

Just looking to add method / class level time thresholds as an annotation.

By this I mean being able to specify the maximum amount of time before a test is considered a failure. We can use this to monitor when new changes cause drops in efficiency for time/speed sensitive applications.

```php
/**
* Some sort of test
* @threshold 10
*/
public function longTest() {
sleep(15);
}
```

Expected Exception:
> Method Time Threshold Exceeded
> Failed asserting that 15.02023 is less than 10.

I wasn't sure if this should be added at the `TestResult` layer (since time is already being stored and there is a generic timeout engine for s/m/l tests). But I felt it would be more appropriate in the `TestCase` class as most annotation checks are done there.

Let me know if you have any feedback.