From 7777dc5eaf28a25575cf12b8e7e42ce8e251328d Mon Sep 17 00:00:00 2001 From: Eriksen Costa Paixão Date: Fri, 24 Apr 2009 22:58:19 +0000 Subject: [PATCH] r25@erik: eriksen | 2009-04-24 19:18:07 -0300 by Eriksen: Adicionado classes abstratas para a interface com o framework PHPUnit. --- ieducar/tests/FunctionalBaseTest.class.php | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ieducar/tests/UnitBaseTest.class.php | 19 +++++++++++++++++++ 2 files changed, 75 insertions(+), 0 deletions(-) create mode 100644 ieducar/tests/FunctionalBaseTest.class.php create mode 100644 ieducar/tests/UnitBaseTest.class.php diff --git a/ieducar/tests/FunctionalBaseTest.class.php b/ieducar/tests/FunctionalBaseTest.class.php new file mode 100644 index 0000000..46486c2 --- /dev/null +++ b/ieducar/tests/FunctionalBaseTest.class.php @@ -0,0 +1,56 @@ + + * @since 1.0.1 + * @version SVN: $Id$ + */ + +chdir(realpath(dirname(__FILE__) . '/../') . '/intranet'); +require_once 'PHPUnit/Extensions/SeleniumTestCase.php'; +require_once 'include/clsBanco.inc.php'; + +abstract class FunctionalBaseTest extends PHPUnit_Extensions_SeleniumTestCase { + + // Configurações do Selenium RC + static protected + $slBrowserUrl = 'http://ieducar.local', + $slBrowser = '*firefox', + $slPort = 4444, + $slHost = 'localhost'; + + // Conta de usuário para testes funcionais + protected + $slUsuarioLogin = 'ieducar', + $slUsuarioSenha = '12345678'; + + protected function setUp() { + $this->setBrowser(self::$slBrowser); + $this->setHost(self::$slHost); + $this->setPort(self::$slPort); + $this->setBrowserUrl(self::$slBrowserUrl); + } + + protected function doLogin() { + $this->open('/intranet'); + $this->type('login', $this->slUsuarioLogin); + $this->type('senha', $this->slUsuarioSenha); + $this->clickAndWait("//input[@value='Entrar']"); + } + + protected function doLogout() { + $this->click("//img[@alt='Logout']"); + } + +} \ No newline at end of file diff --git a/ieducar/tests/UnitBaseTest.class.php b/ieducar/tests/UnitBaseTest.class.php new file mode 100644 index 0000000..2f5cca1 --- /dev/null +++ b/ieducar/tests/UnitBaseTest.class.php @@ -0,0 +1,19 @@ + + * @since 1.0.1 + * @version SVN: $Id$ + */ + +chdir(realpath(dirname(__FILE__) . '/../') . '/intranet'); +require_once 'PHPUnit/Framework.php'; + +abstract class UnitBaseTest extends PHPUnit_Framework_TestCase {} \ No newline at end of file -- libgit2 0.21.2