Skip to content

Commit df59762

Browse files
committed
Fix #88 - handle W3C in timeout abstraction
1 parent 70a5fd3 commit df59762

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

lib/WebDriver/Session.php

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -336,10 +336,14 @@ public function timeouts()
336336
}
337337

338338
if (func_num_args() === 2) {
339-
$arg = array(
340-
'type' => func_get_arg(0), // 'script' or 'implicit'
341-
'ms' => func_get_arg(1), // timeout in milliseconds
342-
);
339+
$arg = $this->w3c
340+
? array(
341+
func_get_arg(0) => func_get_arg(1), // 'script' or 'implicit' => timeout in milliseconds
342+
)
343+
: array(
344+
'type' => func_get_arg(0), // 'script' or 'implicit'
345+
'ms' => func_get_arg(1), // timeout in milliseconds
346+
);
343347

344348
$this->curl('POST', '/timeouts', $arg);
345349

0 commit comments

Comments
 (0)