summaryrefslogtreecommitdiff
path: root/tests/FunctionalTests/tickets/protected
diff options
context:
space:
mode:
Diffstat (limited to 'tests/FunctionalTests/tickets/protected')
-rw-r--r--tests/FunctionalTests/tickets/protected/application.xml3
-rw-r--r--tests/FunctionalTests/tickets/protected/pages/Ticket284Component.php11
-rw-r--r--tests/FunctionalTests/tickets/protected/pages/Ticket900.page45
-rw-r--r--tests/FunctionalTests/tickets/protected/pages/Ticket900.php58
-rw-r--r--tests/FunctionalTests/tickets/protected/pages/Ticket922.page12
-rw-r--r--tests/FunctionalTests/tickets/protected/pages/Ticket922.php13
-rwxr-xr-xtests/FunctionalTests/tickets/protected/pages/Ticket925.page11
-rwxr-xr-xtests/FunctionalTests/tickets/protected/pages/Ticket925.php76
8 files changed, 227 insertions, 2 deletions
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 @@
<?xml version="1.0" encoding="UTF-8"?>
<application id="TicketTests" Mode="Debug">
<modules>
- <module id="friendly-url" class="System.Web.TUrlMapping">
+ <module id="friendly-url" class="System.Web.TUrlMapping" EnableCustomUrl="True">
<url ServiceID="testService" ServiceParameter="ticket653" pattern="/ticket653/?" />
+ <url ServiceParameter="Ticket922" pattern="/ticket922/{text}" parameters.text=".*" />
</module>
<module id="request" class="THttpRequest" UrlManager="friendly-url"/>
</modules>
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 @@
+<com:TContent ID="Content">
+
+Current Command:<com:TLabel ID="CommandName" Text="None." /><br />
+
+<com:TDataGrid
+ CellPadding="2"
+ ID="DataGrid"
+ DataKeyField="title"
+ AutoGenerateColumns="false"
+ OnEditCommand="editItem"
+ OnUpdateCommand="saveItem"
+ OnCancelCommand="cancelItem"
+ OnDeleteCommand="deleteItem"
+ >
+
+ <com:TTemplateColumn >
+ <prop:ItemTemplate>
+ <com:TLabel Text=<%# $this->Parent->Data['title']%>/>
+ </prop:ItemTemplate>
+ <prop:EditItemTemplate>
+ <com:TTextBox ID="TextBox" Text=<%# $this->Parent->Data['title']%>/>
+ <com:TRequiredFieldValidator
+ ControlToValidate="TextBox"
+ ErrorMessage="*"
+ Text="Field required."/>
+ </prop:EditItemTemplate>
+ </com:TTemplateColumn>
+ <com:TEditCommandColumn
+ ButtonType="ImageButton"
+ HeaderText="Edit"
+ EditText="Edit"
+ UpdateText="Save"
+ CancelText="Cancel"
+ />
+ <com:TButtonColumn
+ ID="DeleteColumn"
+ HeaderText="Delete"
+ HeaderStyle.Width="50px"
+ ItemStyle.HorizontalAlign="Center"
+ ItemStyle.Font.Italic="false"
+ Text="Delete"
+ CommandName="delete"
+ />
+</com:TDataGrid>
+</com:TContent>
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 @@
+<?php
+class Ticket900 extends TPage {
+
+ public function onLoad($param)
+ {
+ parent::onLoad($param);
+ if(!$this->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 @@
+<com:TContent ID="Content">
+
+<h1>Problem with TUrlMapping and urlencoding</h1>
+
+Enter a string with spaces that will be used as URL parameter
+<com:TTextBox ID="Text" />
+<com:TButton Text="Perform redirect" OnClick="processString" />
+
+<br />
+Decoded String:
+<com:TLabel ID="Result" />
+</com:TContent>
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 @@
+<?php
+class Ticket922 extends TPage {
+ public function processString($sender,$param) {
+ $text = $this->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 @@
+<com:TContent ID="Content">
+ <com:TTimeTriggeredCallback id="timer1" Interval="2" OnCallback="timer1callback"/>
+ <com:TTimeTriggeredCallback id="timer2" Interval="1" OnCallback="timer2callback" StartTimerOnLoad="true"/>
+ Timer 1 : <com:TActiveLabel id="timer1result"/><br/>
+ Timer 2 : <com:TActiveLabel id="timer2result"/><br/>
+ <com:TActiveButton OnClick="startTimer1" Text="Start Timer1"/>
+ <com:TActiveButton OnClick="stopTimer1" Text="Stop Timer1"/>
+ <com:TActiveButton OnClick="startTimer2" Text="Start Timer2"/>
+ <com:TActiveButton OnClick="stopTimer2" Text="Stop Timer2"/>
+ <com:TActiveButton OnClick="changeIntervalTimer1" Text="Change Interval of Timer1 to 1 sec"/>
+</com:TContent> \ 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 @@
+<?php
+
+prado::using('System.Web.UI.ActiveControls.*');
+
+class Ticket925 extends TPage
+{
+ public function getTimer1Value()
+ {
+ return $this->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