From d8d058b279bec651e4b07c570df502e3f6ec9753 Mon Sep 17 00:00:00 2001 From: Christian Weiske Date: Mon, 13 Dec 2010 08:14:40 +0100 Subject: [PATCH] make first test pass --- Wrt3g.php | 2 ++ ...atus-2.htm => index_wstatus1-aquiring.htm} | 0 tests/index_wstatus1-aquiring.phpt | 21 +++++++++++++++++++ ...=> index_wstatus1-connected-excellent.htm} | 0 ....htm => index_wstatus1-connected-good.htm} | 0 tests/parseStatus.phpt | 13 ------------ 6 files changed, 23 insertions(+), 13 deletions(-) rename tests/{status-2.htm => index_wstatus1-aquiring.htm} (100%) create mode 100644 tests/index_wstatus1-aquiring.phpt rename tests/{status-3.htm => index_wstatus1-connected-excellent.htm} (100%) rename tests/{status-1.htm => index_wstatus1-connected-good.htm} (100%) delete mode 100644 tests/parseStatus.phpt 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 -- 2.30.2