From fbfbdcb233e94b7fed6f8ae209eb90d79aa33f7e Mon Sep 17 00:00:00 2001 From: wei <> Date: Fri, 30 Mar 2007 12:06:27 +0000 Subject: Add test case for #528 --- .../protected/pages/DActiveDropDownList2.php | 34 +++++++++++++++++++++ .../tickets/protected/pages/Ticket500.page | 7 +++++ .../tickets/protected/pages/Ticket500.php | 13 ++++++++ .../tickets/protected/pages/Ticket528.page | 13 ++++++++ .../tickets/protected/pages/Ticket528.php | 35 ++++++++++++++++++++++ .../tickets/tests/Ticket528TestCase.php | 32 ++++++++++++++++++++ 6 files changed, 134 insertions(+) create mode 100644 tests/FunctionalTests/tickets/protected/pages/DActiveDropDownList2.php create mode 100644 tests/FunctionalTests/tickets/protected/pages/Ticket500.page create mode 100644 tests/FunctionalTests/tickets/protected/pages/Ticket500.php create mode 100644 tests/FunctionalTests/tickets/protected/pages/Ticket528.page create mode 100644 tests/FunctionalTests/tickets/protected/pages/Ticket528.php create mode 100644 tests/FunctionalTests/tickets/tests/Ticket528TestCase.php (limited to 'tests') diff --git a/tests/FunctionalTests/tickets/protected/pages/DActiveDropDownList2.php b/tests/FunctionalTests/tickets/protected/pages/DActiveDropDownList2.php new file mode 100644 index 00000000..81fdfea7 --- /dev/null +++ b/tests/FunctionalTests/tickets/protected/pages/DActiveDropDownList2.php @@ -0,0 +1,34 @@ +setViewState('Opcoes', $val); + } + + public function loadOptions() + { + $opcao = $this->getViewState('Opcoes'); + + switch ($opcao) { + case "turnos": + $this->DataTextField="descricao"; + $this->DataValueField="id_turno"; + $opts = array( + array('id_turno' => 'M', 'descricao' => 'Manhã'), + array('id_turno' => 'T', 'descricao' => 'Tarde'), + array('id_turno' => 'N', 'descricao' => 'Noite') + ); + break; + + default: + throw new TConfigurationException('Falta argumento OPCOES no DActiveDropDownList'); + break; + } + $this->setDataSource($opts); + $this->dataBind(); + } +} + +?> \ No newline at end of file diff --git a/tests/FunctionalTests/tickets/protected/pages/Ticket500.page b/tests/FunctionalTests/tickets/protected/pages/Ticket500.page new file mode 100644 index 00000000..a5ef32ca --- /dev/null +++ b/tests/FunctionalTests/tickets/protected/pages/Ticket500.page @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/tests/FunctionalTests/tickets/protected/pages/Ticket500.php b/tests/FunctionalTests/tickets/protected/pages/Ticket500.php new file mode 100644 index 00000000..fc7af222 --- /dev/null +++ b/tests/FunctionalTests/tickets/protected/pages/Ticket500.php @@ -0,0 +1,13 @@ +Service->constructUrl('Cats.Buy.Browse',array('filter' => 'basket')); + $this->link1->NavigateUrl = $url; + } +} + +?> \ No newline at end of file diff --git a/tests/FunctionalTests/tickets/protected/pages/Ticket528.page b/tests/FunctionalTests/tickets/protected/pages/Ticket528.page new file mode 100644 index 00000000..f3a85e2a --- /dev/null +++ b/tests/FunctionalTests/tickets/protected/pages/Ticket528.page @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/tests/FunctionalTests/tickets/protected/pages/Ticket528.php b/tests/FunctionalTests/tickets/protected/pages/Ticket528.php new file mode 100644 index 00000000..c2d1fcbe --- /dev/null +++ b/tests/FunctionalTests/tickets/protected/pages/Ticket528.php @@ -0,0 +1,35 @@ + array('id_turno' => 'M', 'descricao' => 'Manhã'), + 'T' => array('id_turno' => 'T', 'descricao' => 'Tarde'), + 'N' => array('id_turno' => 'N', 'descricao' => 'Noite') + ); + + + public function onLoad($param) + { + parent::onLoad($param); + if (!$this->IsPostBack) { + $this->DDropTurno->loadOptions(); + $this->loadDadosTurno($this->DDropTurno->getSelectedValue()); + } + } + + + protected function loadDadosTurno($id) + { + $this->Codigo->setText(self::$turnos[$id]['id_turno']); + $this->Descricao->setText(self::$turnos[$id]['descricao']); + } + + + public function trocaTurno($sender,$param) + { + $this->loadDadosTurno($sender->getSelectedValue()); + } +} + +?> \ No newline at end of file diff --git a/tests/FunctionalTests/tickets/tests/Ticket528TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket528TestCase.php new file mode 100644 index 00000000..86b28378 --- /dev/null +++ b/tests/FunctionalTests/tickets/tests/Ticket528TestCase.php @@ -0,0 +1,32 @@ +open('tickets/index.php?page=Ticket528'); + $this->assertTitle("Verifying Ticket 528"); + + $this->select("{$base}DDropTurno", "Tarde"); + $this->pause(800); + + $this->assertValue("{$base}Codigo", "T"); + $this->assertValue("{$base}Descricao", "Tarde"); + + $this->select("{$base}DDropTurno", "Manhã"); + $this->pause(800); + + $this->assertValue("{$base}Codigo", "M"); + $this->assertValue("{$base}Descricao", "Manhã"); + + $this->select("{$base}DDropTurno", "Noite"); + $this->pause(800); + + $this->assertValue("{$base}Codigo", "N"); + $this->assertValue("{$base}Descricao", "Noite"); + + } +} + +?> \ No newline at end of file -- cgit v1.2.3