From 6be13b9757a42a56fee0ccb6f4fe032b7c18c715 Mon Sep 17 00:00:00 2001 From: Hector Cortez Date: Fri, 13 Jul 2012 11:43:29 -0400 Subject: [PATCH] BUG 0000 Adjustment in te class classNETTest - phpunit tested and phpcs.in the class classNETTest --- .../workflow/engine/classes/classNETTest.php | 247 +++++++++--------- 1 file changed, 125 insertions(+), 122 deletions(-) diff --git a/tests/automated/workflow/engine/classes/classNETTest.php b/tests/automated/workflow/engine/classes/classNETTest.php index 73d656b72..23ed8e340 100644 --- a/tests/automated/workflow/engine/classes/classNETTest.php +++ b/tests/automated/workflow/engine/classes/classNETTest.php @@ -1,4 +1,5 @@ object = new NET(); + $this->object = new NET('192.168.11.21'); } /** * Tears down the fixture, for example, closes a network connection. * This method is called after a test is executed. - */ + */ protected function tearDown() { + } /** - * This is the default method to test, if the class still having + * This is the default method to test, if the class still having * the same number of methods. - */ + */ public function testNumberOfMethodsInThisClass() { - $methods = get_class_methods('NET'); $this->assertTrue( count($methods) == 14); + $methods = get_class_methods('NET'); + $this->assertTrue(count($methods) == 14); } /** - * @covers NET::__construct - * @todo Implement test__construct(). - */ + * @covers NET::__construct + * @todo Implement test__construct(). + */ public function test__construct() { $methods = get_class_methods($this->object); - $this->assertTrue( in_array('__construct', $methods ), 'exists method __construct' ); + $this->assertTrue(in_array('__construct', $methods), 'exists method __construct'); $r = new ReflectionMethod('NET', '__construct'); $params = $r->getParameters(); - $this->assertTrue( $params[0]->getName() == 'pHost'); - $this->assertTrue( $params[0]->isArray() == false); - $this->assertTrue( $params[0]->isOptional () == false); - } + $this->assertTrue($params[0]->getName() == 'pHost'); + $this->assertTrue($params[0]->isArray() == false); + $this->assertTrue($params[0]->isOptional() == false); + } /** - * @covers NET::resolv - * @todo Implement testresolv(). - */ + * @covers NET::resolv + * @todo Implement testresolv(). + */ public function testresolv() { $methods = get_class_methods($this->object); - $this->assertTrue( in_array('resolv', $methods ), 'exists method resolv' ); + $this->assertTrue(in_array('resolv', $methods), 'exists method resolv'); $r = new ReflectionMethod('NET', 'resolv'); $params = $r->getParameters(); - $this->assertTrue( $params[0]->getName() == 'pHost'); - $this->assertTrue( $params[0]->isArray() == false); - $this->assertTrue( $params[0]->isOptional () == false); - } + $this->assertTrue($params[0]->getName() == 'pHost'); + $this->assertTrue($params[0]->isArray() == false); + $this->assertTrue($params[0]->isOptional() == false); + } /** - * @covers NET::scannPort - * @todo Implement testscannPort(). - */ + * @covers NET::scannPort + * @todo Implement testscannPort(). + */ public function testscannPort() { $methods = get_class_methods($this->object); - $this->assertTrue( in_array('scannPort', $methods ), 'exists method scannPort' ); + $this->assertTrue(in_array('scannPort', $methods), 'exists method scannPort'); $r = new ReflectionMethod('NET', 'scannPort'); $params = $r->getParameters(); - $this->assertTrue( $params[0]->getName() == 'pPort'); - $this->assertTrue( $params[0]->isArray() == false); - $this->assertTrue( $params[0]->isOptional () == false); - } + $this->assertTrue($params[0]->getName() == 'pPort'); + $this->assertTrue($params[0]->isArray() == false); + $this->assertTrue($params[0]->isOptional() == false); + } /** - * @covers NET::is_ipaddress - * @todo Implement testis_ipaddress(). - */ + * @covers NET::is_ipaddress + * @todo Implement testis_ipaddress(). + */ public function testis_ipaddress() { $methods = get_class_methods($this->object); - $this->assertTrue( in_array('is_ipaddress', $methods ), 'exists method is_ipaddress' ); + $this->assertTrue(in_array('is_ipaddress', $methods), 'exists method is_ipaddress'); $r = new ReflectionMethod('NET', 'is_ipaddress'); $params = $r->getParameters(); - $this->assertTrue( $params[0]->getName() == 'pHost'); - $this->assertTrue( $params[0]->isArray() == false); - $this->assertTrue( $params[0]->isOptional () == false); - } + $this->assertTrue($params[0]->getName() == 'pHost'); + $this->assertTrue($params[0]->isArray() == false); + $this->assertTrue($params[0]->isOptional() == false); + } /** - * @covers NET::ping - * @todo Implement testping(). - */ + * @covers NET::ping + * @todo Implement testping(). + */ public function testping() { $methods = get_class_methods($this->object); - $this->assertTrue( in_array('ping', $methods ), 'exists method ping' ); + $this->assertTrue(in_array('ping', $methods), 'exists method ping'); $r = new ReflectionMethod('NET', 'ping'); $params = $r->getParameters(); - $this->assertTrue( $params[0]->getName() == 'pTTL'); - $this->assertTrue( $params[0]->isArray() == false); - $this->assertTrue( $params[0]->isOptional () == true); - $this->assertTrue( $params[0]->getDefaultValue() == '3000'); - } + $this->assertTrue($params[0]->getName() == 'pTTL'); + $this->assertTrue($params[0]->isArray() == false); + $this->assertTrue($params[0]->isOptional() == true); + $this->assertTrue($params[0]->getDefaultValue() == '3000'); + } /** - * @covers NET::loginDbServer - * @todo Implement testloginDbServer(). - */ + * @covers NET::loginDbServer + * @todo Implement testloginDbServer(). + */ public function testloginDbServer() { $methods = get_class_methods($this->object); - $this->assertTrue( in_array('loginDbServer', $methods ), 'exists method loginDbServer' ); + $this->assertTrue(in_array('loginDbServer', $methods), 'exists method loginDbServer'); $r = new ReflectionMethod('NET', 'loginDbServer'); $params = $r->getParameters(); - $this->assertTrue( $params[0]->getName() == 'pUser'); - $this->assertTrue( $params[0]->isArray() == false); - $this->assertTrue( $params[0]->isOptional () == false); - $this->assertTrue( $params[1]->getName() == 'pPasswd'); - $this->assertTrue( $params[1]->isArray() == false); - $this->assertTrue( $params[1]->isOptional () == false); - } + $this->assertTrue($params[0]->getName() == 'pUser'); + $this->assertTrue($params[0]->isArray() == false); + $this->assertTrue($params[0]->isOptional() == false); + $this->assertTrue($params[1]->getName() == 'pPasswd'); + $this->assertTrue($params[1]->isArray() == false); + $this->assertTrue($params[1]->isOptional() == false); + } /** - * @covers NET::setDataBase - * @todo Implement testsetDataBase(). - */ + * @covers NET::setDataBase + * @todo Implement testsetDataBase(). + */ public function testsetDataBase() { $methods = get_class_methods($this->object); - $this->assertTrue( in_array('setDataBase', $methods ), 'exists method setDataBase' ); + $this->assertTrue(in_array('setDataBase', $methods), 'exists method setDataBase'); $r = new ReflectionMethod('NET', 'setDataBase'); $params = $r->getParameters(); - $this->assertTrue( $params[0]->getName() == 'pDb'); - $this->assertTrue( $params[0]->isArray() == false); - $this->assertTrue( $params[0]->isOptional () == false); - $this->assertTrue( $params[1]->getName() == 'pPort'); - $this->assertTrue( $params[1]->isArray() == false); - $this->assertTrue( $params[1]->isOptional () == true); - $this->assertTrue( $params[1]->getDefaultValue() == ''); - } + $this->assertTrue($params[0]->getName() == 'pDb'); + $this->assertTrue($params[0]->isArray() == false); + $this->assertTrue($params[0]->isOptional() == false); + $this->assertTrue($params[1]->getName() == 'pPort'); + $this->assertTrue($params[1]->isArray() == false); + $this->assertTrue($params[1]->isOptional() == true); + $this->assertTrue($params[1]->getDefaultValue() == ''); + } /** - * @covers NET::tryConnectServer - * @todo Implement testtryConnectServer(). - */ + * @covers NET::tryConnectServer + * @todo Implement testtryConnectServer(). + */ public function testtryConnectServer() { $methods = get_class_methods($this->object); - $this->assertTrue( in_array('tryConnectServer', $methods ), 'exists method tryConnectServer' ); + $this->assertTrue(in_array('tryConnectServer', $methods), 'exists method tryConnectServer'); $r = new ReflectionMethod('NET', 'tryConnectServer'); $params = $r->getParameters(); - $this->assertTrue( $params[0]->getName() == 'pDbDriver'); - $this->assertTrue( $params[0]->isArray() == false); - $this->assertTrue( $params[0]->isOptional () == false); - } + $this->assertTrue($params[0]->getName() == 'pDbDriver'); + $this->assertTrue($params[0]->isArray() == false); + $this->assertTrue($params[0]->isOptional() == false); + } /** - * @covers NET::tryOpenDataBase - * @todo Implement testtryOpenDataBase(). - */ + * @covers NET::tryOpenDataBase + * @todo Implement testtryOpenDataBase(). + */ public function testtryOpenDataBase() { $methods = get_class_methods($this->object); - $this->assertTrue( in_array('tryOpenDataBase', $methods ), 'exists method tryOpenDataBase' ); + $this->assertTrue(in_array('tryOpenDataBase', $methods), 'exists method tryOpenDataBase'); $r = new ReflectionMethod('NET', 'tryOpenDataBase'); $params = $r->getParameters(); - $this->assertTrue( $params[0]->getName() == 'pDbDriver'); - $this->assertTrue( $params[0]->isArray() == false); - $this->assertTrue( $params[0]->isOptional () == false); - } + $this->assertTrue($params[0]->getName() == 'pDbDriver'); + $this->assertTrue($params[0]->isArray() == false); + $this->assertTrue($params[0]->isOptional() == false); + } /** - * @covers NET::getDbServerVersion - * @todo Implement testgetDbServerVersion(). - */ + * @covers NET::getDbServerVersion + * @todo Implement testgetDbServerVersion(). + */ public function testgetDbServerVersion() { $methods = get_class_methods($this->object); - $this->assertTrue( in_array('getDbServerVersion', $methods ), 'exists method getDbServerVersion' ); + $this->assertTrue(in_array('getDbServerVersion', $methods), 'exists method getDbServerVersion'); $r = new ReflectionMethod('NET', 'getDbServerVersion'); $params = $r->getParameters(); - $this->assertTrue( $params[0]->getName() == 'driver'); - $this->assertTrue( $params[0]->isArray() == false); - $this->assertTrue( $params[0]->isOptional () == false); - } + $this->assertTrue($params[0]->getName() == 'driver'); + $this->assertTrue($params[0]->isArray() == false); + $this->assertTrue($params[0]->isOptional() == false); + } /** - * @covers NET::dbName - * @todo Implement testdbName(). - */ + * @covers NET::dbName + * @todo Implement testdbName(). + */ public function testdbName() { $methods = get_class_methods($this->object); - $this->assertTrue( in_array('dbName', $methods ), 'exists method dbName' ); + $this->assertTrue(in_array('dbName', $methods), 'exists method dbName'); $r = new ReflectionMethod('NET', 'dbName'); $params = $r->getParameters(); - $this->assertTrue( $params[0]->getName() == 'pAdapter'); - $this->assertTrue( $params[0]->isArray() == false); - $this->assertTrue( $params[0]->isOptional () == false); - } + $this->assertTrue($params[0]->getName() == 'pAdapter'); + $this->assertTrue($params[0]->isArray() == false); + $this->assertTrue($params[0]->isOptional() == false); + } /** - * @covers NET::showMsg - * @todo Implement testshowMsg(). - */ + * @covers NET::showMsg + * @todo Implement testshowMsg(). + */ public function testshowMsg() { $methods = get_class_methods($this->object); - $this->assertTrue( in_array('showMsg', $methods ), 'exists method showMsg' ); + $this->assertTrue(in_array('showMsg', $methods), 'exists method showMsg'); $r = new ReflectionMethod('NET', 'showMsg'); $params = $r->getParameters(); - } + } /** - * @covers NET::getErrno - * @todo Implement testgetErrno(). - */ + * @covers NET::getErrno + * @todo Implement testgetErrno(). + */ public function testgetErrno() { $methods = get_class_methods($this->object); - $this->assertTrue( in_array('getErrno', $methods ), 'exists method getErrno' ); + $this->assertTrue(in_array('getErrno', $methods), 'exists method getErrno'); $r = new ReflectionMethod('NET', 'getErrno'); $params = $r->getParameters(); - } + } /** - * @covers NET::getErrmsg - * @todo Implement testgetErrmsg(). - */ + * @covers NET::getErrmsg + * @todo Implement testgetErrmsg(). + */ public function testgetErrmsg() { $methods = get_class_methods($this->object); - $this->assertTrue( in_array('getErrmsg', $methods ), 'exists method getErrmsg' ); + $this->assertTrue(in_array('getErrmsg', $methods), 'exists method getErrmsg'); $r = new ReflectionMethod('NET', 'getErrmsg'); $params = $r->getParameters(); - } - - } + } +} + \ No newline at end of file