From 210f6d6d29be3c93251a515616408c0872d6da26 Mon Sep 17 00:00:00 2001 From: mikl <> Date: Mon, 13 Oct 2008 19:54:32 +0000 Subject: Added Testcase for #900 --- .gitattributes | 3 ++ .../tickets/protected/pages/Ticket900.page | 45 +++++++++++++++++ .../tickets/protected/pages/Ticket900.php | 58 ++++++++++++++++++++++ .../tickets/tests/Ticket900TestCase.php | 19 +++++++ 4 files changed, 125 insertions(+) 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/tests/Ticket900TestCase.php diff --git a/.gitattributes b/.gitattributes index 8777ae33..59824a42 100644 --- a/.gitattributes +++ b/.gitattributes @@ -3101,6 +3101,8 @@ tests/FunctionalTests/tickets/protected/pages/Ticket886.page -text tests/FunctionalTests/tickets/protected/pages/Ticket886.php -text tests/FunctionalTests/tickets/protected/pages/Ticket897.page -text tests/FunctionalTests/tickets/protected/pages/Ticket897.php -text +tests/FunctionalTests/tickets/protected/pages/Ticket900.page -text +tests/FunctionalTests/tickets/protected/pages/Ticket900.php -text tests/FunctionalTests/tickets/protected/pages/Ticket93.page -text tests/FunctionalTests/tickets/protected/pages/Ticket93.php -text tests/FunctionalTests/tickets/protected/pages/ToggleTest.page -text @@ -3168,6 +3170,7 @@ tests/FunctionalTests/tickets/tests/Ticket823TestCase.php -text tests/FunctionalTests/tickets/tests/Ticket876TestCase.php -text tests/FunctionalTests/tickets/tests/Ticket886TestCase.php -text tests/FunctionalTests/tickets/tests/Ticket897TestCase.php -text +tests/FunctionalTests/tickets/tests/Ticket900TestCase.php -text tests/FunctionalTests/tickets/tests/Ticket93TestCase.php -text tests/FunctionalTests/validators.php -text tests/FunctionalTests/validators/index.php -text 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/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'); + } +} + +?> -- cgit v1.2.3