add dummy responses
[linksys-wrt3g-tools.git] / Wrt3g / DummyRequest.php
index 97f3217bd644b05954fe519c30b913d98690a1a1..e09973630ab7499b614c4458f78febce3f89fd97 100644 (file)
@@ -10,7 +10,8 @@ class Wrt3g_DummyRequest extends HTTP_Request2
      * @var array
      */
     public static $mapping = array(
-        '/Status_NoAuth.asp' => 'tests/status_noauth-connected.htm'
+        '/Status_NoAuth.asp'  => 'tests/status_noauth-connected.htm',
+        '/index_wstatus1.asp' => 'tests/index_wstatus1-connected-excellent.htm'
     );
 
 
@@ -41,6 +42,14 @@ class Wrt3g_DummyRequest extends HTTP_Request2
     */
     public function send()
     {
+        $host = $this->url->getHost();
+        if (strlen($host) == 3 && is_numeric($host)) {
+            $this->adapter->addResponse(
+                "HTTP/1.0 $host dummy\n\nnothing"
+            );
+            return parent::send();
+        }
+
         $path = $this->url->getPath();
         if (!isset(self::$mapping[$path])) {
             throw new HTTP_Request2_Exception(