From: Christian Weiske Date: Mon, 13 Dec 2010 07:14:40 +0000 (+0100) Subject: make first test pass X-Git-Tag: 1.0.0~56 X-Git-Url: https://git.cweiske.de/linksys-wrt3g-tools.git/commitdiff_plain/d8d058b279bec651e4b07c570df502e3f6ec9753 make first test pass --- diff --git a/Wrt3g.php b/Wrt3g.php index 0cd9de0..1b55416 100644 --- 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/status-2.htm b/tests/index_wstatus1-aquiring.htm similarity index 100% rename from tests/status-2.htm rename to tests/index_wstatus1-aquiring.htm diff --git a/tests/index_wstatus1-aquiring.phpt b/tests/index_wstatus1-aquiring.phpt new file mode 100644 index 0000000..1435fcd --- /dev/null +++ b/tests/index_wstatus1-aquiring.phpt @@ -0,0 +1,21 @@ +--TEST-- +test Wrt3g_HtmlParser::index_wstatus1() when aquiring +--FILE-- +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/status-3.htm b/tests/index_wstatus1-connected-excellent.htm similarity index 100% rename from tests/status-3.htm rename to tests/index_wstatus1-connected-excellent.htm diff --git a/tests/status-1.htm b/tests/index_wstatus1-connected-good.htm similarity index 100% rename from tests/status-1.htm rename to tests/index_wstatus1-connected-good.htm diff --git a/tests/parseStatus.phpt b/tests/parseStatus.phpt deleted file mode 100644 index 9bac5a2..0000000 --- a/tests/parseStatus.phpt +++ /dev/null @@ -1,13 +0,0 @@ ---TEST-- -test wrt3g_parseStatus() ---FILE-- -parseStatus( - file_get_contents('status-1.htm') - ) -); ---EXPECT-- -asd