make first test pass
authorChristian Weiske <cweiske@cweiske.de>
Mon, 13 Dec 2010 07:14:40 +0000 (08:14 +0100)
committerChristian Weiske <cweiske@cweiske.de>
Mon, 13 Dec 2010 07:14:40 +0000 (08:14 +0100)
Wrt3g.php
tests/index_wstatus1-aquiring.htm [moved from tests/status-2.htm with 100% similarity]
tests/index_wstatus1-aquiring.phpt [new file with mode: 0644]
tests/index_wstatus1-connected-excellent.htm [moved from tests/status-3.htm with 100% similarity]
tests/index_wstatus1-connected-good.htm [moved from tests/status-1.htm with 100% similarity]
tests/parseStatus.phpt [deleted file]

index 0cd9de0..1b55416 100644 (file)
--- a/Wrt3g.php
+++ b/Wrt3g.php
@@ -11,6 +11,7 @@
 * @link     http://cweiske.de/linksys-wrt3g-tools.htm
 */
 require_once 'HTTP/Request2.php';
+require_once 'Wrt3g/HtmlParser.php';
 
 
 class Wrt3g
@@ -90,6 +91,7 @@ class Wrt3g
         $arRetval = array();
 
         $strUrlBase = $this->getBaseUrl();
+        $parser = new Wrt3g_HtmlParser();
 
         /**
         * Connection status
diff --git a/tests/index_wstatus1-aquiring.phpt b/tests/index_wstatus1-aquiring.phpt
new file mode 100644 (file)
index 0000000..1435fcd
--- /dev/null
@@ -0,0 +1,21 @@
+--TEST--
+test Wrt3g_HtmlParser::index_wstatus1() when aquiring
+--FILE--
+<?php
+chdir(dirname(__FILE__));
+require_once dirname(__FILE__) . '/../Wrt3g/HtmlParser.php';
+$p = new Wrt3g_HtmlParser();
+var_dump(
+    $p->index_wstatus1(
+        file_get_contents('index_wstatus1-aquiring.htm')
+    )
+);
+--EXPECT--
+array(3) {
+  ["type"]=>
+  string(8) "aquiring"
+  ["network"]=>
+  string(8) "aquiring"
+  ["signal strength"]=>
+  string(8) "aquiring"
+}
diff --git a/tests/parseStatus.phpt b/tests/parseStatus.phpt
deleted file mode 100644 (file)
index 9bac5a2..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
---TEST--
-test wrt3g_parseStatus()
---FILE--
-<?php
-require_once dirname(__FILE__) . '/../Wrt3g.php';
-$w = new Wrt3g();
-var_dump(
-    $w->parseStatus(
-        file_get_contents('status-1.htm')
-    )
-);
---EXPECT--
-asd