Commit aabd9deaf3262792c54f633ec82d8742fac44c8a

Authored by Eriksen Costa Paixão
1 parent 6b9c8980
Exists in master

by Eriksen: Corrigido unit test que testava com valores padrão que não correspon…

…diam aos configurados em ieducar.ini


Showing 1 changed file with 20 additions and 21 deletions   Show diff stats
ieducar/tests/unit/ClsBancoTest.class.php
@@ -19,8 +19,19 @@ @@ -19,8 +19,19 @@
19 * Você deve ter recebido uma cópia da Licença Pública Geral do GNU junto 19 * Você deve ter recebido uma cópia da Licença Pública Geral do GNU junto
20 * com este programa; se não, escreva para a Free Software Foundation, Inc., no 20 * com este programa; se não, escreva para a Free Software Foundation, Inc., no
21 * endereço 59 Temple Street, Suite 330, Boston, MA 02111-1307 USA. 21 * endereço 59 Temple Street, Suite 330, Boston, MA 02111-1307 USA.
  22 + *
  23 + * @author Eriksen Costa Paixão <eriksen.paixao_bs@cobra.com.br>
  24 + * @license http://creativecommons.org/licenses/GPL/2.0/legalcode.pt CC GNU GPL
  25 + * @package Test
  26 + * @subpackage UnitTest
  27 + * @since Arquivo disponível desde a versão 1.0.1
  28 + * @version $Id$
22 */ 29 */
23 30
  31 +require_once realpath(dirname(__FILE__) . '/../') . '/UnitBaseTest.class.php';
  32 +require_once 'include/pmieducar/clsPmieducarClienteSuspensao.inc.php';
  33 +
  34 +
24 /** 35 /**
25 * clsBancoTest class. 36 * clsBancoTest class.
26 * 37 *
@@ -31,13 +42,11 @@ @@ -31,13 +42,11 @@
31 * @since Classe disponível desde a versão 1.0.1 42 * @since Classe disponível desde a versão 1.0.1
32 * @version $Id$ 43 * @version $Id$
33 */ 44 */
  45 +class ClsBancoTest extends UnitBaseTest
  46 +{
34 47
35 -require_once realpath(dirname(__FILE__) . '/../') . '/UnitBaseTest.class.php';  
36 -require_once 'include/pmieducar/clsPmieducarClienteSuspensao.inc.php';  
37 -  
38 -class ClsBancoTest extends UnitBaseTest {  
39 -  
40 - public function testDoCountFromObj() { 48 + public function testDoCountFromObj()
  49 + {
41 $db = new clsBanco(); 50 $db = new clsBanco();
42 $db->Conecta(); 51 $db->Conecta();
43 52
@@ -45,22 +54,12 @@ class ClsBancoTest extends UnitBaseTest { @@ -45,22 +54,12 @@ class ClsBancoTest extends UnitBaseTest {
45 $this->assertNotEquals(TRUE, is_null($db->doCountFromObj($obj))); 54 $this->assertNotEquals(TRUE, is_null($db->doCountFromObj($obj)));
46 } 55 }
47 56
48 - public function testConexao() {  
49 - $string = 'host=localhost dbname=ieducardb user=ieducaruser password=password port=5432';  
50 - 57 + public function testConexao()
  58 + {
51 $db = new clsBanco(); 59 $db = new clsBanco();
52 - $db->setHost('localhost');  
53 - $db->setDbname('ieducardb');  
54 - $db->setUser('ieducaruser');  
55 - $db->setPassword('password');  
56 - $db->setPort('5432');  
57 -  
58 - $db->FraseConexao();  
59 - $stringCompare = $db->getFraseConexao();  
60 - $this->assertEquals($string, $stringCompare);  
61 -  
62 $db->Conecta(); 60 $db->Conecta();
63 - $this->assertTrue((bool)$db->bLink_ID); 61 +
  62 + $this->assertTrue((bool) $db->bLink_ID);
64 } 63 }
65 64
66 -}  
67 \ No newline at end of file 65 \ No newline at end of file
  66 +}