value = $value; } public function getResponse($url) { $options = array( CURLOPT_URL => $url, CURLOPT_HEADER => false, CURLOPT_TIMEOUT => 1, CURLOPT_RETURNTRANSFER => true ); $ch = curl_init(); curl_setopt_array($ch, $options); $response = @curl_exec($ch); curl_close($ch); return $response; } /** * Evaluates the constraint for parameter $other. Returns TRUE if the * constraint is met, FALSE otherwise. * * @param mixed $other Value or object to evaluate. * @return bool */ public function matches($other) { $this->actualCode = $this->getResponse($other); return $this->value === $this->actualCode; } /** * Returns a string representation of the constraint. * * @return string */ public function toString() { return 'does not return response text ' . $this->exporter->export($this->value) . ' it is ' . $this->actualCode; } }?>