BUG 0000 Adjustment in te class classNETTest

- phpunit tested and phpcs.in the class classNETTest
This commit is contained in:
Hector Cortez
2012-07-13 11:43:29 -04:00
parent 388f94686d
commit 6be13b9757

View File

@@ -1,4 +1,5 @@
<?php
require_once PATH_TRUNK . 'gulliver/thirdparty/smarty/libs/Smarty.class.php';
require_once PATH_TRUNK . 'gulliver/system/class.xmlform.php';
require_once PATH_TRUNK . 'gulliver/system/class.xmlDocument.php';
@@ -11,10 +12,10 @@ require_once PATH_TRUNK . 'workflow/engine/classes/class.net.php';
/**
* Generated by ProcessMaker Test Unit Generator on 2012-07-12 at 22:32:32.
*/
*/
class classNETTest extends PHPUnit_Framework_TestCase
{
/**
* @var NET
*/
@@ -26,7 +27,7 @@ class classNETTest extends PHPUnit_Framework_TestCase
*/
protected function setUp()
{
$this->object = new NET();
$this->object = new NET('192.168.11.21');
}
/**
@@ -35,6 +36,7 @@ class classNETTest extends PHPUnit_Framework_TestCase
*/
protected function tearDown()
{
}
/**
@@ -43,7 +45,8 @@ class classNETTest extends PHPUnit_Framework_TestCase
*/
public function testNumberOfMethodsInThisClass()
{
$methods = get_class_methods('NET'); $this->assertTrue( count($methods) == 14);
$methods = get_class_methods('NET');
$this->assertTrue(count($methods) == 14);
}
/**
@@ -53,12 +56,12 @@ class classNETTest extends PHPUnit_Framework_TestCase
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);
}
/**
@@ -68,12 +71,12 @@ class classNETTest extends PHPUnit_Framework_TestCase
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);
}
/**
@@ -83,12 +86,12 @@ class classNETTest extends PHPUnit_Framework_TestCase
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);
}
/**
@@ -98,12 +101,12 @@ class classNETTest extends PHPUnit_Framework_TestCase
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);
}
/**
@@ -113,13 +116,13 @@ class classNETTest extends PHPUnit_Framework_TestCase
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');
}
/**
@@ -129,15 +132,15 @@ class classNETTest extends PHPUnit_Framework_TestCase
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);
}
/**
@@ -147,16 +150,16 @@ class classNETTest extends PHPUnit_Framework_TestCase
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() == '');
}
/**
@@ -166,12 +169,12 @@ class classNETTest extends PHPUnit_Framework_TestCase
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);
}
/**
@@ -181,12 +184,12 @@ class classNETTest extends PHPUnit_Framework_TestCase
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);
}
/**
@@ -196,12 +199,12 @@ class classNETTest extends PHPUnit_Framework_TestCase
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);
}
/**
@@ -211,12 +214,12 @@ class classNETTest extends PHPUnit_Framework_TestCase
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);
}
/**
@@ -226,7 +229,7 @@ class classNETTest extends PHPUnit_Framework_TestCase
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();
}
@@ -238,7 +241,7 @@ class classNETTest extends PHPUnit_Framework_TestCase
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();
}
@@ -250,9 +253,9 @@ class classNETTest extends PHPUnit_Framework_TestCase
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();
}
}
}