@param string $value
@param integer $timeout

@return \PHPUnit_Extensions_Selenium2TestCase_Element
193980
public function clickDisplayedElementByClass($value, $timeout = 0)
    {
        return $this->clickDisplayedElement(self::BY_CLASS_NAME, $value, $timeout, $timeout);
    }
695776
protected function Sub( $value )
	{
	    switch ( $value->GetValueCode() )
	    {
	        case TimeProxyFactory::Code:
	            return new DayTimeDurationProxy( TimeValue::Sub( $this->_value, /* TimeValue */ $value->getValue() ) );

	        case DayTimeDurationProxyFactory::Code:
	        	/**
	        	 * @var DayTimeDurationProxy $value
	        	 */
	        	// Clone the DateValue contained in the proxy or the original is changed
	        	$clone = new TimeValue( clone $this->_value->Value );
	        	$value->getValue()->Value->invert = ! $value->getValue()->Value->invert;
	        	return new TimeProxy( TimeValue::AddDayTimeDuration( $clone, $value->getValue() ) );
	        	// return new TimeProxy( TimeValue::Add(  $this->_value, - /* DayTimeDurationValue */ $value->getValue() ) );

	        default:
	            throw XPath2Exception::withErrorCodeAndParams( "XPTY0004", Resources::BinaryOperatorNotDefined,
					array(
						"op:sub",
						SequenceType::WithTypeCodeAndCardinality( SequenceType::GetXmlTypeCodeFromObject( $this->_value), XmlTypeCardinality::One ),
						SequenceType::WithTypeCodeAndCardinality( SequenceType::GetXmlTypeCodeFromObject( $value->getValue() ), XmlTypeCardinality::One )
					)
				);
	    }
	}
1230354
public static function time(string $value): bool
    {
        $matches = preg_match('/^(\d{2}):(\d{2}):(\d{2})$/', $value);
        return is_int($matches) && $matches > 0;
    }
349151
public function waitForElement($element, $timeout = 5000)
    {
        $this->session->timeouts()->postImplicit_wait(['ms' => $timeout]);

        try {
            $this->findByNameOrId($element);
        } catch (InvalidArgumentException $e) {
            throw new InvalidArgumentException(
                "Hey, what's happening... Look, I waited {$timeout} milliseconds to see an element with " .
                "a name or id of '{$element}', but no luck. \nIf you could take a look, that'd be greaaattt..."
            );
        }

        return $this;
    }
496070
public function setTimeout($timeout)
    {
        if (is_string($timeout) && ctype_digit($timeout)) {
            $timeout = (int) $timeout;
        } elseif (!is_int($timeout)) {
            throw new \RuntimeException('Unable to set timeout.');
        }
        $this->timeout = $timeout;

        return $this;
    }
223068
public function setTimeout($timeout)
    {
        if (null === $timeout) {
            $this->timeout = null;

            return $this;
        }

        $timeout = (float) $timeout;

        if ($timeout < 0) {
            throw new InvalidArgumentException('The timeout value must be a valid positive integer or float number.');
        }

        $this->timeout = $timeout;

        return $this;
    }
821544
public function setTimeout($timeout)
    {
        $this->params['timeout'] = (int) $timeout;
        $this->buffer->setParam('timeout', (int) $timeout);

        return $this;
    }
1265529
public function timeout($timeout = null, $connectTimeout = null)
    {
        if(null !== $timeout)
        {
            $this->timeout = $timeout;
        }
        if(null !== $connectTimeout)
        {
            $this->connectTimeout = $connectTimeout;
        }
        return $this;
    }
1241061
public function set($name, $value, $time = 3600)
    {

        return $this->getDriver()->add($name, $value, false, $time);
    }
588708
protected function vaidateValue($value, $element)
    {
        if (isset($this->patterns[$this->getRegexp()])) {
            return (bool) preg_match($this->patterns[$this->getRegexp()], $value);
        } elseif ($this->getRegexp()) {
            return (bool) preg_match('/^' . $this->getRegexp() . '$/' . $this->getModifiers(), $value);
        } else {
            return false;
        }
    }
399215
public function lt($value) {
        $this->rule = $value;
        $this->check_role = 'lt';
        $result = !is_null($this->value) && $this->value < $value;
        $this->checkResult($result);
        return $this;
    }
912969
public function connect($timeout = self::TIMEOUT, $test = false)
    {
        if ($this->socket) {
            return $this;
        }

        $host = $this->host;

        if ($this->ssl) {
            $host = 'ssl://' . $host;
        }

        $errno  =  0;
        $errstr = '';

        $this->socket = @fsockopen($host, $this->port, $errno, $errstr, $timeout);

        if (!$this->socket) {
            //throw exception
            Exception::instance()
                ->setMessage(Exception::SERVER_ERROR)
                ->addVariable($host.':'.$this->port)
                ->trigger();
        }

        if (strpos($this->getLine(), '* OK') === false) {
            $this->disconnect();
            //throw exception
            Exception::instance()
                ->setMessage(Exception::SERVER_ERROR)
                ->addVariable($host.':'.$this->port)
                ->trigger();
        }

        if ($this->tls) {
            $this->send('STARTTLS');
            if (!stream_socket_enable_crypto($this->socket, true, STREAM_CRYPTO_METHOD_TLS_CLIENT)) {
                $this->disconnect();
                //throw exception
                Exception::instance()
                ->setMessage(Exception::TLS_ERROR)
                ->addVariable($host.':'.$this->port)
                ->trigger();
            }
        }

        if ($test) {
            fclose($this->socket);

            $this->socket = null;
            return $this;
        }

        //login
        $result = $this->call('LOGIN', $this->escape($this->username, $this->password));

        if (!is_array($result) || strpos(implode(' ', $result), 'OK') === false) {
            $this->disconnect();
            //throw exception
            Exception::instance(Exception::LOGIN_ERROR)->trigger();
        }

        return $this;
    }
182181
public function element(\PHPUnit_Extensions_Selenium2TestCase_ElementCriteria $criteria)
	{
		$value = $this->postCommand('element', $criteria);
		return static::fromResponseValue($value, $this->url->ascend(), $this->driver);
	}
137696
public static function setTimeout($timeout = 60) {
        if (!is_int($timeout) || $timeout < 0) {
            return false;
        }

        self::$timeout = $timeout;
        return true;
    }
573205
public static function fromValue( $value )
	{
		$result = new ContextProvider();
		$result->m_iter = XPath2NodeIterator::Create( $value );
		return $result;
	}
656390
public function setValue(string $value = null) : Element
    {
        if (!is_null($value)) {
            $tmp = preg_replace('/[^\d]/', '', $value);
            if (strlen($tmp)) {
                $value = $tmp;
                if ($value{0} != '0') {
                    $value = "0$value";
                }
            }
        }
        return parent::setValue($value);
    }
483701
public function setTimeout($value)
    {
        if (!is_numeric($value) || $value <= 0) {
            $value = 15;
        }
        $this->timeout = $value;
        return $this;
    }