@@ -54,8 +54,10 @@ public function i_stop_measuring(string $name) {
5454 *
5555 * @Then /^"([^"]+)" should have taken (less than|more than|exactly) (\d+(?:\.\d+)? (?:seconds|milliseconds))$/
5656 */
57- public function timing_should_have_taken (string $ measure , Closure $ comparison , float $ expectedtime ) {
57+ public function timing_should_have_taken (string $ measure , string $ comparison , string $ expectedtime ) {
5858 $ measuretiming = $ this ->get_performance_measure ($ measure );
59+ $ comparison = $ this ->parse_comparison ($ comparison );
60+ $ expectedtime = $ this ->parse_time ($ expectedtime );
5961
6062 if (!call_user_func ($ comparison , $ measuretiming ->duration , $ expectedtime )) {
6163 throw new ExpectationException (
@@ -70,11 +72,10 @@ public function timing_should_have_taken(string $measure, Closure $comparison, f
7072 /**
7173 * Parse time.
7274 *
73- * @Transform /^\d+(?:\.\d+)? (?:seconds|milliseconds)$/
7475 * @param string $text Time string.
7576 * @return float
7677 */
77- public function parse_time (string $ text ): float {
78+ private function parse_time (string $ text ): float {
7879 $ spaceindex = strpos ($ text , ' ' );
7980 $ value = floatval (substr ($ text , 0 , $ spaceindex ));
8081
@@ -88,11 +89,10 @@ public function parse_time(string $text): float {
8889 /**
8990 * Parse a comparison function.
9091 *
91- * @Transform /^less than|more than|exactly$/
9292 * @param string $text Comparison string.
9393 * @return Closure
9494 */
95- public function parse_comparison (string $ text ): Closure {
95+ private function parse_comparison (string $ text ): Closure {
9696 switch ($ text ) {
9797 case 'less than ' :
9898 return function ($ a , $ b ) {
0 commit comments