assertTrue(defined('COL_EMAIL'),"No definida constante 'COL_EMAIL'"); $ver = COL_EMAIL; $this->assertTrue(!empty($ver),"No tiene valor la constante 'COL_EMAIL'"); $this->assertType('string', COL_EMAIL); } /** * */ public function testCorreoUsuario() { $res = IgepCorreo::correoUsuario(''); $this->assertType('array', $res); $this->assertTrue(empty($res),'devuelve resultado cuando no hay usuario'); $res = IgepCorreo::correoUsuario('usuarioXXYY'); $this->assertType('array', $res); $this->assertEquals($res[0],'','devuelve correo de usuario inexistente'); $res = IgepCorreo::correoUsuario('GASPAR'); $this->assertEquals($res[0],'quiles_gas@gva.es','no devuelve correo de usuario'); } /** * */ public function testCorreoNREGPGV() { $res = IgepCorreo::correoNREGPGV(''); $this->assertType('array', $res); $this->assertTrue(empty($res),'devuelve resultado cuando no hay usuario (cadena)'); $res = IgepCorreo::correoNREGPGV(array()); $this->assertType('array', $res); $this->assertTrue(empty($res),'devuelve resultado cuando no hay usuario (array)'); //TODO: aislar funciones de bd, para eso IgepCorreo no debe ser estatica // $stub = $this->getMock('IgepCorreo', array('correoLista')); // $stub->expects($this->any()) // ->method('correoLista') // ->will($this->returnValue(array('abc@gva.es','ccc@gva.es'))); // $this->assertEquals($stub->correoNREGPGV('2222'),'aa'); } /** * @todo Implement testCorreoListaUsuariosModulo(). */ public function testCorreoListaUsuariosModulo() { // Remove the following lines when you implement this test. $this->markTestIncomplete( 'This test has not been implemented yet.' ); } /** * @todo Implement testCorreoListaUsuariosAplicacion(). */ public function testCorreoListaUsuariosAplicacion() { // Remove the following lines when you implement this test. $this->markTestIncomplete( 'This test has not been implemented yet.' ); } /** * */ public function testCorreoLista() { $res = IgepCorreo::correoLista(''); $this->assertType('array', $res); $this->assertTrue(empty($res),'devuelve resultado cuando no hay select'); $res = IgepCorreo::correoLista('select \'aaa@gva.es\' as "xx" from dual'); $this->assertType('array', $res); $this->assertTrue(empty($res[0]),'no devuelve resultado de una select constante sin columna '.COL_EMAIL); $res = IgepCorreo::correoLista('select \'aaa@gva.es\' as "'.COL_EMAIL.'" from dual'); $this->assertType('array', $res); $this->assertEquals($res[0],'aaa@gva.es','no devuelve resultado de una select constante'); $res = IgepCorreo::correoLista('select \'aaa@gva.es\' as "'.COL_EMAIL.'" from dual union select \'bbb@gva.es\' as "'.COL_EMAIL.'" from dual'); $this->assertType('array', $res); $this->assertEquals($res,array('aaa@gva.es','bbb@gva.es'),'no devuelve resultado de una select constante con 2 filas'); } /** * @todo Implement testSinAnexo(). */ public function testSinAnexo() { // Remove the following lines when you implement this test. $this->markTestIncomplete( 'This test has not been implemented yet.' ); } /** * @todo Implement testConAnexo(). */ public function testConAnexo() { // Remove the following lines when you implement this test. $this->markTestIncomplete( 'This test has not been implemented yet.' ); } } ?>