@@ -54,8 +54,10 @@ public function i_stop_measuring(string $name) {
54
54
*
55
55
* @Then /^"([^"]+)" should have taken (less than|more than|exactly) (\d+(?:\.\d+)? (?:seconds|milliseconds))$/
56
56
*/
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 ) {
58
58
$ measuretiming = $ this ->get_performance_measure ($ measure );
59
+ $ comparison = $ this ->parse_comparison ($ comparison );
60
+ $ expectedtime = $ this ->parse_time ($ expectedtime );
59
61
60
62
if (!call_user_func ($ comparison , $ measuretiming ->duration , $ expectedtime )) {
61
63
throw new ExpectationException (
@@ -70,11 +72,10 @@ public function timing_should_have_taken(string $measure, Closure $comparison, f
70
72
/**
71
73
* Parse time.
72
74
*
73
- * @Transform /^\d+(?:\.\d+)? (?:seconds|milliseconds)$/
74
75
* @param string $text Time string.
75
76
* @return float
76
77
*/
77
- public function parse_time (string $ text ): float {
78
+ private function parse_time (string $ text ): float {
78
79
$ spaceindex = strpos ($ text , ' ' );
79
80
$ value = floatval (substr ($ text , 0 , $ spaceindex ));
80
81
@@ -88,11 +89,10 @@ public function parse_time(string $text): float {
88
89
/**
89
90
* Parse a comparison function.
90
91
*
91
- * @Transform /^less than|more than|exactly$/
92
92
* @param string $text Comparison string.
93
93
* @return Closure
94
94
*/
95
- public function parse_comparison (string $ text ): Closure {
95
+ private function parse_comparison (string $ text ): Closure {
96
96
switch ($ text ) {
97
97
case 'less than ' :
98
98
return function ($ a , $ b ) {
0 commit comments