{"issue":{"state":"closed","created_at":"2011-12-03T02:05:07Z","updated_at":"2011-12-03T02:09:30Z","comments":1,"user":{"gravatar_id":"5a52648523d2248e022753e924125dfb","id":213141,"url":"https://api.github.com/users/soid","avatar_url":"https://secure.gravatar.com/avatar/5a52648523d2248e022753e924125dfb?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","login":"soid"},"body":"In \"Chapter 19. Extending PHPUnit\" http://www.phpunit.de/manual/3.6/en/extending-phpunit.html#extending-phpunit.PHPUnit_Framework_Test \r\nyou have a data-driven test example. There's a bug in this example. I fixed it:\r\n\r\n    25c25,26\r\n    <  \r\n    ---\r\n    >             $stopTime = NULL; \r\n    > \r\n    35c36,37\r\n    <                 $result->addFailure($this, $e, PHP_Timer::stop());\r\n    ---\r\n    >                 $stopTime = PHP_Timer::stop();\r\n    >                 $result->addFailure($this, $e, $stopTime);\r\n    39c41,42\r\n    <                 $result->addError($this, $e, PHP_Timer::stop()());\r\n    ---\r\n    >                 $stopTime = PHP_Timer::stop();\r\n    >                 $result->addError($this, $e, $stopTime);\r\n    41,42c44,48\r\n    <  \r\n    <             $result->endTest($this, PHP_Timer::stop());\r\n    ---\r\n    >             \r\n    >             if ($stopTime === NULL) {\r\n    >                 $stopTime = PHP_Timer::stop();\r\n    >             }\r\n    >             $result->endTest($this, $stopTime);\r\n\r\nThis is because in case of failure or error PHP_Timer::stop() will be called two times and test duration will be detected incorrectly. My patch solves this.\r\n\r\nPS. Sorry if it's the wrong place for bugs in documentation but I didn't find where I should put it to.","assignee":null,"id":2435371,"pull_request":{"patch_url":null,"html_url":null,"diff_url":null},"number":431,"labels":[],"title":"Bug in documentation - Extending PHPUnit example","html_url":"https://github.com/sebastianbergmann/phpunit/issues/431","closed_at":"2011-12-03T02:09:30Z","url":"https://api.github.com/repos/sebastianbergmann/phpunit/issues/431","milestone":null},"action":"closed"}