From 8bebf49fbfb92f039f56cb22b759d8e84ef19799 Mon Sep 17 00:00:00 2001 From: tof <> Date: Thu, 18 Oct 2007 09:22:46 +0000 Subject: Fixed #722 - Add Read only capabilities to TInPlaceTextBox --- .../tickets/protected/pages/Ticket722.page | 6 +++++ .../tickets/protected/pages/Ticket722.php | 30 ++++++++++++++++++++++ .../tickets/tests/Ticket722TestCase.php | 29 +++++++++++++++++++++ 3 files changed, 65 insertions(+) create mode 100644 tests/FunctionalTests/tickets/protected/pages/Ticket722.page create mode 100644 tests/FunctionalTests/tickets/protected/pages/Ticket722.php create mode 100644 tests/FunctionalTests/tickets/tests/Ticket722TestCase.php (limited to 'tests/FunctionalTests') diff --git a/tests/FunctionalTests/tickets/protected/pages/Ticket722.page b/tests/FunctionalTests/tickets/protected/pages/Ticket722.page new file mode 100644 index 00000000..6acd9f24 --- /dev/null +++ b/tests/FunctionalTests/tickets/protected/pages/Ticket722.page @@ -0,0 +1,6 @@ + +Click to edit ==> + + + + \ No newline at end of file diff --git a/tests/FunctionalTests/tickets/protected/pages/Ticket722.php b/tests/FunctionalTests/tickets/protected/pages/Ticket722.php new file mode 100644 index 00000000..91759fb0 --- /dev/null +++ b/tests/FunctionalTests/tickets/protected/pages/Ticket722.php @@ -0,0 +1,30 @@ +InPlaceTextBox->getReadOnly(); + $this->InPlaceTextBox->setReadOnly(!$state); + $sender->setText($state?"Change to Read Only":"Change to Editable"); + $this->InPlaceTextBox->setText($state?$this->getText():$this->getText().' [Read Only]'); + } + + public function onTextChanged ($sender, $param) + { + $this->setText($sender->getText()); + } + + public function setText ($value) + { + $this->setViewState('text', $value, "Editable Text"); + } + + public function getText () + { + return $this->getViewState('text', "Editable Text"); + } +} +?> \ No newline at end of file diff --git a/tests/FunctionalTests/tickets/tests/Ticket722TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket722TestCase.php new file mode 100644 index 00000000..68a0282c --- /dev/null +++ b/tests/FunctionalTests/tickets/tests/Ticket722TestCase.php @@ -0,0 +1,29 @@ +open('tickets/index.php?page=Ticket722'); + $this->assertTitle("Verifying Ticket 722"); + + $this->assertText($base.'InPlaceTextBox__label', 'Editable Text'); + $this->click($base.'InPlaceTextBox__label'); + $this->pause(800); + $this->assertVisible($base.'InPlaceTextBox'); + $this->type($base.'InPlaceTextBox',"Prado"); + $this->fireEvent($base.'InPlaceTextBox', 'blur'); // Release textbox + $this->pause(800); + $this->assertNotVisible($base.'InPlaceTextBox'); + $this->assertText($base.'InPlaceTextBox__label', 'Prado'); + $this->click($base.'ctl0'); + $this->pause(800); + $this->assertText($base.'InPlaceTextBox__label', 'Prado [Read Only]'); + $this->click($base.'InPlaceTextBox__label'); + $this->pause(800); + $this->assertNotVisible($base.'InPlaceTextBox'); + + } + +} +?> \ No newline at end of file -- cgit v1.2.3