assertTrue(defined('COL_EMAIL'),"No definida constante 'COL_EMAIL'"); $ver = COL_EMAIL; $this->assertTrue(!empty($ver),"No tiene valor la constante 'COL_EMAIL'"); $this->assertInternalType('string', COL_EMAIL); } /** * pasar a test en custom */ public function xtestCorreoUsuario() { $res = IgepCorreo::correoUsuario(''); $this->assertInternalType('array', $res); $this->assertTrue(empty($res),'devuelve resultado cuando no hay usuario'); /* $res = IgepCorreo::correoUsuario('usuarioXXYY'); $this->assertInternalType('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');*/ } /** * pasar a test en custom */ public function xtestCorreoNREGPGV() { $res = IgepCorreo::correoNREGPGV(''); $this->assertInternalType('array', $res); $this->assertTrue(empty($res),'devuelve resultado cuando no hay usuario (cadena)'); $res = IgepCorreo::correoNREGPGV(array()); $this->assertInternalType('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'); } /** * pasar a test en custom */ public function xtestCorreoLista() { $res = IgepCorreo::correoLista(''); $this->assertInternalType('array', $res); $this->assertTrue(empty($res),'devuelve resultado cuando no hay select'); /* $res = IgepCorreo::correoLista('select \'aaa@gva.es\' as "xx" from dual'); $this->assertInternalType('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->assertInternalType('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->assertInternalType('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.' ); } } ?>