From 6228873cf9d6471463d2413e7dfd7447f759baf2 Mon Sep 17 00:00:00 2001 From: "christophe.boulain" <> Date: Wed, 3 Dec 2008 14:22:03 +0000 Subject: Merge from trunk --- .../tickets/protected/application.xml | 3 +- .../tickets/protected/pages/Ticket284Component.php | 11 +++- .../tickets/protected/pages/Ticket900.page | 45 +++++++++++++ .../tickets/protected/pages/Ticket900.php | 58 +++++++++++++++++ .../tickets/protected/pages/Ticket922.page | 12 ++++ .../tickets/protected/pages/Ticket922.php | 13 ++++ .../tickets/protected/pages/Ticket925.page | 11 ++++ .../tickets/protected/pages/Ticket925.php | 76 ++++++++++++++++++++++ .../tickets/tests/Ticket595TestCase.php | 4 +- .../tickets/tests/Ticket900TestCase.php | 19 ++++++ .../tickets/tests/Ticket922TestCase.php | 18 +++++ 11 files changed, 266 insertions(+), 4 deletions(-) create mode 100644 tests/FunctionalTests/tickets/protected/pages/Ticket900.page create mode 100644 tests/FunctionalTests/tickets/protected/pages/Ticket900.php create mode 100644 tests/FunctionalTests/tickets/protected/pages/Ticket922.page create mode 100644 tests/FunctionalTests/tickets/protected/pages/Ticket922.php create mode 100755 tests/FunctionalTests/tickets/protected/pages/Ticket925.page create mode 100755 tests/FunctionalTests/tickets/protected/pages/Ticket925.php create mode 100644 tests/FunctionalTests/tickets/tests/Ticket900TestCase.php create mode 100644 tests/FunctionalTests/tickets/tests/Ticket922TestCase.php (limited to 'tests/FunctionalTests/tickets') diff --git a/tests/FunctionalTests/tickets/protected/application.xml b/tests/FunctionalTests/tickets/protected/application.xml index 29273a2f..113b8455 100644 --- a/tests/FunctionalTests/tickets/protected/application.xml +++ b/tests/FunctionalTests/tickets/protected/application.xml @@ -1,8 +1,9 @@ - + + diff --git a/tests/FunctionalTests/tickets/protected/pages/Ticket284Component.php b/tests/FunctionalTests/tickets/protected/pages/Ticket284Component.php index 892bdc87..da6ad153 100644 --- a/tests/FunctionalTests/tickets/protected/pages/Ticket284Component.php +++ b/tests/FunctionalTests/tickets/protected/pages/Ticket284Component.php @@ -2,6 +2,7 @@ class Ticket284Component extends TTemplateControl implements IValidatable { + private $_isValid; public function onPreRender($param) { if (!$this->ShowHours && $this->ShowMinutes) @@ -90,5 +91,13 @@ class Ticket284Component extends TTemplateControl implements IValidatable return $this->TimeStamp; } } + public function getIsValid() + { + return $this->_isValid; + } + public function setIsValid($value) + { + $this->_isValid=TPropertyValue::ensureBoolean($value); + } } -?> \ No newline at end of file +?> diff --git a/tests/FunctionalTests/tickets/protected/pages/Ticket900.page b/tests/FunctionalTests/tickets/protected/pages/Ticket900.page new file mode 100644 index 00000000..41c0fbc2 --- /dev/null +++ b/tests/FunctionalTests/tickets/protected/pages/Ticket900.page @@ -0,0 +1,45 @@ + + +Current Command:
+ + + + + + Parent->Data['title']%>/> + + + Parent->Data['title']%>/> + + + + + + +
diff --git a/tests/FunctionalTests/tickets/protected/pages/Ticket900.php b/tests/FunctionalTests/tickets/protected/pages/Ticket900.php new file mode 100644 index 00000000..21e87f67 --- /dev/null +++ b/tests/FunctionalTests/tickets/protected/pages/Ticket900.php @@ -0,0 +1,58 @@ +IsPostBack) + { + $this->DataGrid->DataSource=$this->Data; + $this->DataGrid->dataBind(); + } + } + + + protected function getData() + { + return array( + array( 'title' => 'Title A'), + array( 'title' => 'Title B'), + array( 'title' => 'Title C') + ); + } + + + public function editItem($sender,$param) + { + $this->CommandName->Text='edit'; + $this->DataGrid->EditItemIndex=$param->Item->ItemIndex; + $this->DataGrid->DataSource=$this->Data; + $this->DataGrid->dataBind(); + } + + public function saveItem($sender,$param) + { + $this->CommandName->Text='save'; + $this->DataGrid->EditItemIndex=-1; + $this->DataGrid->DataSource=$this->Data; + $this->DataGrid->dataBind(); + } + + public function cancelItem($sender,$param) + { + $this->CommandName->Text='cancel'; + $this->DataGrid->EditItemIndex=-1; + $this->DataGrid->DataSource=$this->Data; + $this->DataGrid->dataBind(); + } + + public function deleteItem($sender,$param) + { + $this->CommandName->Text='delete'; + $this->DataGrid->EditItemIndex=-1; + $this->DataGrid->DataSource=$this->Data; + $this->DataGrid->dataBind(); + } + +} +?> diff --git a/tests/FunctionalTests/tickets/protected/pages/Ticket922.page b/tests/FunctionalTests/tickets/protected/pages/Ticket922.page new file mode 100644 index 00000000..87932680 --- /dev/null +++ b/tests/FunctionalTests/tickets/protected/pages/Ticket922.page @@ -0,0 +1,12 @@ + + +

Problem with TUrlMapping and urlencoding

+ +Enter a string with spaces that will be used as URL parameter + + + +
+Decoded String: + +
diff --git a/tests/FunctionalTests/tickets/protected/pages/Ticket922.php b/tests/FunctionalTests/tickets/protected/pages/Ticket922.php new file mode 100644 index 00000000..52d4e411 --- /dev/null +++ b/tests/FunctionalTests/tickets/protected/pages/Ticket922.php @@ -0,0 +1,13 @@ +Text->Text; + $url= $this->getService()->constructUrl('Ticket922', array('text'=>$text)); + $this->getResponse()->redirect($url); + } + + public function onLoad($param) { + if ($this->Request->contains('text')) + $this->Result->setText($this->Request->itemAt('text')); + } +} diff --git a/tests/FunctionalTests/tickets/protected/pages/Ticket925.page b/tests/FunctionalTests/tickets/protected/pages/Ticket925.page new file mode 100755 index 00000000..cdb1e0fe --- /dev/null +++ b/tests/FunctionalTests/tickets/protected/pages/Ticket925.page @@ -0,0 +1,11 @@ + + + + Timer 1 :
+ Timer 2 :
+ + + + + +
\ No newline at end of file diff --git a/tests/FunctionalTests/tickets/protected/pages/Ticket925.php b/tests/FunctionalTests/tickets/protected/pages/Ticket925.php new file mode 100755 index 00000000..0284bd66 --- /dev/null +++ b/tests/FunctionalTests/tickets/protected/pages/Ticket925.php @@ -0,0 +1,76 @@ +getViewState('timer1', 0); + } + + public function getTimer2Value() + { + return $this->getViewState('timer2', 0); + } + + public function setTimer1Value($value) + { + $this->setViewState('timer1', $value, 0); + } + + public function setTimer2Value($value) + { + $this->setViewState('timer2', $value, 0); + } + + public function startTimer1($sender, $param) + { + $this->timer1->startTimer(); + } + + public function stopTimer1($sender, $param) + { + $this->timer1->stopTimer(); + } + + public function startTimer2($sender, $param) + { + $this->timer2->startTimer(); + } + + public function stopTimer2($sender, $param) + { + $this->timer2->stopTimer(); + } + + public function changeIntervalTimer1($sender, $param) + { + $this->timer1->setInterval(1); + } + + public function timer1callback ($sender, $param) + { + $this->timer1result->Text .= ($this->Timer1Value+=$this->timer1->Interval).'... '; + if ($this->Timer1Value > 20) + { + $this->timer1Value=0; + $this->timer1result->Text=''; + $this->timer1->stopTimer(); + } + + } + + public function timer2callback ($sender, $param) + { + $this->timer2result->Text .= ($this->Timer2Value+=$this->timer2->Interval).'... '; + if ($this->Timer2Value > 20) + { + $this->timer2Value=0; + $this->timer2result->Text=''; + $this->timer2->stopTimer(); + } + } + +} +?> \ No newline at end of file diff --git a/tests/FunctionalTests/tickets/tests/Ticket595TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket595TestCase.php index e2487f25..4321bd67 100644 --- a/tests/FunctionalTests/tickets/tests/Ticket595TestCase.php +++ b/tests/FunctionalTests/tickets/tests/Ticket595TestCase.php @@ -18,7 +18,7 @@ class Ticket595TestCase extends SeleniumTestCase $this->type($base.'A', 'test@pradosoft.com'); $this->click($base.'ctl2'); $this->pause(800); - $this->assertAttribute($base.'A@class',''); + $this->assertAttribute($base.'A@class','null'); $this->click($base.'ctl5'); @@ -33,7 +33,7 @@ class Ticket595TestCase extends SeleniumTestCase $this->type($base.'B', 'test@pradosoft.com'); $this->click($base.'ctl5'); $this->pause(800); - $this->assertAttribute($base.'B@class',''); + $this->assertAttribute($base.'B@class','null'); } } ?> diff --git a/tests/FunctionalTests/tickets/tests/Ticket900TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket900TestCase.php new file mode 100644 index 00000000..b80e1187 --- /dev/null +++ b/tests/FunctionalTests/tickets/tests/Ticket900TestCase.php @@ -0,0 +1,19 @@ +open('tickets/index.php?page=Ticket900'); + $this->assertTitle("Verifying Ticket 900"); + $base = 'ctl0_Content_'; + + $this->clickAndWait('ctl0$Content$DataGrid$ctl1$ctl3'); + $this->type($base.'DataGrid_ctl1_TextBox', ''); + $this->click($base.'DataGrid_ctl1_ctl3'); + $this->clickAndWait('ctl0$Content$DataGrid$ctl1$ctl4'); + $this->assertText($base.'CommandName', 'cancel'); + } +} + +?> diff --git a/tests/FunctionalTests/tickets/tests/Ticket922TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket922TestCase.php new file mode 100644 index 00000000..8420c10d --- /dev/null +++ b/tests/FunctionalTests/tickets/tests/Ticket922TestCase.php @@ -0,0 +1,18 @@ +open('tickets/index.php?page=Ticket922'); + $this->assertTitle("Verifying Ticket 922"); + $base = 'ctl0_Content_'; + + $this->type($base.'Text', 'two words'); + $this->clickAndWait('ctl0$Content$ctl0'); + $this->assertText($base.'Result','two words'); + + } +} + +?> -- cgit v1.2.3