![]() |
Documentación GVHIDRA 3.1.5
|
Métodos públicos | |
testSetDependencia () | |
testSetQueryMode () | |
testGetNombreVentana () | |
testGetDescripcionVentana () | |
test_procesarDefinicion () | |
testAbrirVentanaSeleccion () | |
testBuscarVentanaSeleccion () | |
test_concatenarCamposSelect () | |
test_concatenarCamposSelect2 () | |
Métodos protegidos | |
setUp () | |
tearDown () |
Test class for IgepVentanaSeleccion. Generated by PHPUnit on 2008-03-04 at 13:03:45.
Definición en la línea 8 del archivo IgepVentanaSeleccionTest.php.
setUp | ( | ) | [protected] |
Sets up the fixture, for example, opens a network connection. This method is called before a test is executed.
protected
Definición en la línea 16 del archivo IgepVentanaSeleccionTest.php.
{ $conf = ConfigFramework::getConfig(); $conf->setDefVS('PROV_TEST','select cpro, dpro from tcom_provincias'); $this->v = new gvHidraSelectionWindow('campotpl','PROV_TEST',array()); }
tearDown | ( | ) | [protected] |
Tears down the fixture, for example, closes a network connection. This method is called after a test is executed.
protected
Definición en la línea 28 del archivo IgepVentanaSeleccionTest.php.
{ }
test_concatenarCamposSelect | ( | ) |
Definición en la línea 101 del archivo IgepVentanaSeleccionTest.php.
{ $v = $this->v; $d = array('phptype'=>'oci8'); $consulta = 'select a,b '; $this->assertEquals('', $v->_concatenarCamposSelect($d,$consulta),'select sin from'); $consulta = 'a,b from tabla where a=2'; $this->assertEquals('', $v->_concatenarCamposSelect($d,$consulta),'from sin select'); $consulta = 'select from ...'; $this->assertEquals('', $v->_concatenarCamposSelect($d,$consulta),'sin campos en select'); $consulta = 'select a from ...'; // columnas $this->assertEquals(' a ', $v->_concatenarCamposSelect($d,$consulta),'un campo'); $consulta = 'select a,b from ...'; $this->assertEquals(" concat(concat( a,' '),b ) ",$v->_concatenarCamposSelect($d,$consulta),'dos campos'); $consulta = 'select a from t1, (select subc from subtabla) t2...'; $this->assertEquals(' a ', $v->_concatenarCamposSelect($d,$consulta),'un campo con subconsulta'); // funciones $consulta = 'select funcion(),a from tabla'; $this->assertEquals(" concat(concat( funcion(),' '),a ) ", $v->_concatenarCamposSelect($d,$consulta),'funcion al principio'); $consulta = 'select a,funcion() from tabla'; $this->assertEquals(" concat(concat( a,' '),funcion() ) ", $v->_concatenarCamposSelect($d,$consulta),'funcion al final'); $consulta = 'select a,funcion(),c from tabla'; $this->assertEquals(" concat(concat( concat(concat( a,' '),funcion()) ,' '),c ) ", $v->_concatenarCamposSelect($d,$consulta),'funcion en medio'); $consulta = 'select funcion(p1,p2),a from tabla'; $this->assertEquals(" concat(concat( funcion(p1,p2),' '),a ) ", $v->_concatenarCamposSelect($d,$consulta),'funcion al principio con parametros'); $consulta = 'select funcion(p1,nvl(t,v)),a from tabla'; $this->assertEquals(" concat(concat( funcion(p1,nvl(t,v)),' '),a ) ", $v->_concatenarCamposSelect($d,$consulta),'funciones anidadas'); $consulta = 'select concat(a,concat(b,c)) as "calculado",a from tabla'; $this->assertSame(" concat(concat( concat(a,concat(b,c)) ,' '),a ) ", $v->_concatenarCamposSelect($d,$consulta),'funcion concat con alias'); $consulta = 'select concat(a,concat(b,c)),a from tabla'; $this->assertSame(" concat(concat( concat(a,concat(b,c)),' '),a ) ", $v->_concatenarCamposSelect($d,$consulta),'funcion concat sin alias'); $consulta = 'select funcion (a) from tabla'; $this->assertSame(" concat(concat( funcion ,' '),(a) ) ", $v->_concatenarCamposSelect($d,$consulta),'funcion con parentesis separado no funciona'); // constantes $consulta = 'select 1,a from tabla'; $this->assertEquals(" concat(concat( 1,' '),a ) ", $v->_concatenarCamposSelect($d,$consulta),'constante numerica'); $consulta = "select 'cte',a from tabla"; $this->assertEquals(" concat(concat( 'cte',' '),a ) ", $v->_concatenarCamposSelect($d,$consulta),'constante texto'); // columnas con prefijo de tabla $consulta = "select tabla.a, b from tabla"; $this->assertEquals(" concat(concat( tabla.a,' '),b ) ", $v->_concatenarCamposSelect($d,$consulta),'columna con prefijo'); // expresiones $consulta = "select (1+2), b from tabla"; $this->assertEquals(" concat(concat( (1+2),' '),b ) ", $v->_concatenarCamposSelect($d,$consulta),'expresion aritmetica'); // alias de campo $consulta = 'select a as "col1", b from tabla'; $this->assertEquals(" concat(concat( a ,' '),b ) ", $v->_concatenarCamposSelect($d,$consulta),'alias al principio'); $consulta = 'select a, b as "col1" from tabla'; $this->assertEquals(" concat(concat( a,' '),b ) ", $v->_concatenarCamposSelect($d,$consulta),'alias al final'); $consulta = 'select a, b as "col1",c from tabla'; $this->assertEquals(" concat(concat( concat(concat( a,' '),b ) ,' '),c ) ", $v->_concatenarCamposSelect($d,$consulta),'alias en medio'); $consulta = "SELECT col as \"P.1-P.2\" FROM tabla"; $this->assertEquals(" col ", $v->_concatenarCamposSelect($d,$consulta),'alias complejo'); $d = array('phptype'=>'pgsql'); $consulta = 'select 1,a from tabla'; $this->assertEquals(" coalesce(coalesce(text( 1),'')||' ','')||coalesce(text(a ),'') ", $v->_concatenarCamposSelect($d,$consulta),'constante numerica con postgresql'); }
test_concatenarCamposSelect2 | ( | ) |
comprobamos que ninguna select de VS devuelva '', que es un error
Definición en la línea 164 del archivo IgepVentanaSeleccionTest.php.
{ $conf = ConfigFramework::getConfig(); $lista = $conf->getVSKeys(); $d = array('phptype'=>'oci8'); foreach($lista as $clave => $valor) { $vs = $conf->getDefVS($valor); $consulta = $vs['consulta']; $this->assertNotEquals('', $this->v->_concatenarCamposSelect($d,$consulta),'ventana seleccion: '.$valor); } }
test_procesarDefinicion | ( | ) |
Definición en la línea 74 del archivo IgepVentanaSeleccionTest.php.
{ // Remove the following lines when you implement this test. $this->markTestIncomplete( 'This test has not been implemented yet.' ); }
testAbrirVentanaSeleccion | ( | ) |
Definición en la línea 84 del archivo IgepVentanaSeleccionTest.php.
{ // Remove the following lines when you implement this test. $this->markTestIncomplete( 'This test has not been implemented yet.' ); }
testBuscarVentanaSeleccion | ( | ) |
Definición en la línea 94 del archivo IgepVentanaSeleccionTest.php.
{ // Remove the following lines when you implement this test. $this->markTestIncomplete( 'This test has not been implemented yet.' ); }
testGetDescripcionVentana | ( | ) |
Definición en la línea 64 del archivo IgepVentanaSeleccionTest.php.
{ // Remove the following lines when you implement this test. $this->markTestIncomplete( 'This test has not been implemented yet.' ); }
testGetNombreVentana | ( | ) |
Definición en la línea 54 del archivo IgepVentanaSeleccionTest.php.
{ // Remove the following lines when you implement this test. $this->markTestIncomplete( 'This test has not been implemented yet.' ); }
testSetDependencia | ( | ) |
Definición en la línea 34 del archivo IgepVentanaSeleccionTest.php.
{ // Remove the following lines when you implement this test. $this->markTestIncomplete( 'This test has not been implemented yet.' ); }
testSetQueryMode | ( | ) |
Definición en la línea 44 del archivo IgepVentanaSeleccionTest.php.
{ // Remove the following lines when you implement this test. $this->markTestIncomplete( 'This test has not been implemented yet.' ); }