diff options
| author | wei <> | 2006-04-28 01:22:42 +0000 | 
|---|---|---|
| committer | wei <> | 2006-04-28 01:22:42 +0000 | 
| commit | eb2a6e9431445b3cb24be4b75f02f07aef70aebc (patch) | |
| tree | d634891aa58ed491398d8eef5d80fc7f467f1070 /tests | |
| parent | 639a6b1c052f8b3ef1d1063843cae1c88ef4f346 (diff) | |
New abstract TCompositeControl + FT tests
Diffstat (limited to 'tests')
5 files changed, 59 insertions, 0 deletions
diff --git a/tests/FunctionalTests/features/protected/application.xml b/tests/FunctionalTests/features/protected/application.xml index 642152cc..9153f3f7 100644 --- a/tests/FunctionalTests/features/protected/application.xml +++ b/tests/FunctionalTests/features/protected/application.xml @@ -1,6 +1,9 @@  <?xml version="1.0" encoding="utf-8"?>
  <application id="FeatureTests" Mode="Debug">
 +	<paths>
 +		<using namespace="Application.controls.*" />
 +	</paths>
  	<services>
  	  <service id="page" class="TPageService" DefaultPage="FeatureList">
  	    <pages MasterClass="Application.controls.Layout" />
 diff --git a/tests/FunctionalTests/features/protected/controls/LabeledTextBox.tpl b/tests/FunctionalTests/features/protected/controls/LabeledTextBox.tpl new file mode 100644 index 00000000..276d03b2 --- /dev/null +++ b/tests/FunctionalTests/features/protected/controls/LabeledTextBox.tpl @@ -0,0 +1,2 @@ +<com:TLabel ID="label" ForControl="textbox" Text="label:" />
 +<com:TTextBox ID="textbox" />
\ No newline at end of file diff --git a/tests/FunctionalTests/features/protected/controls/LabeledTextbox.php b/tests/FunctionalTests/features/protected/controls/LabeledTextbox.php new file mode 100644 index 00000000..33396734 --- /dev/null +++ b/tests/FunctionalTests/features/protected/controls/LabeledTextbox.php @@ -0,0 +1,19 @@ +<?php
 +/*
 + * Created on 28/04/2006
 + */
 +
 +class LabeledTextBox extends TCompositeControl
 +{
 +	public function getTextBox()
 +	{
 +		return $this->textbox;
 +	}
 +	
 +	public function getLabel()
 +	{
 +		return $this->label;
 +	}
 +} 
 +
 +?>
 diff --git a/tests/FunctionalTests/features/protected/pages/CompositeControl.page b/tests/FunctionalTests/features/protected/pages/CompositeControl.page new file mode 100644 index 00000000..b135445a --- /dev/null +++ b/tests/FunctionalTests/features/protected/pages/CompositeControl.page @@ -0,0 +1,12 @@ +<com:TContent ID="Content">
 +<h1>Composite Control Test</h1>
 +	<com:LabeledTextBox id="user" Label.Text="username:" /><br />
 +	<com:LabeledTextBox id="pass" Label.Text="password:" /><br />
 +	<com:TButton Text="Submit" />
 +
 +<com:TPanel Visible=<%= $this->user->TextBox->Text != "" %> >
 +<h2>Result</h2>
 +	User: <%= $this->user->TextBox->Text %> Pass: <%= $this->pass->TextBox->Text %>
 +</com:TPanel>
 +
 +</com:TContent>
\ No newline at end of file diff --git a/tests/FunctionalTests/features/tests/CompositeControlTestCase.php b/tests/FunctionalTests/features/tests/CompositeControlTestCase.php new file mode 100644 index 00000000..dda3f63b --- /dev/null +++ b/tests/FunctionalTests/features/tests/CompositeControlTestCase.php @@ -0,0 +1,23 @@ +<?php
 +/*
 + * Created on 28/04/2006
 + */
 +
 +class CompositeControlTestCase extends SeleniumTestCase
 +{
 +	
 +	function test()
 +	{
 +		$base = "ctl0_Content_";
 +		$this->open("features/index.php?page=CompositeControl", "");
 +		$this->verifyTextPresent("Composite Control Test", "");
 +		$this->type("{$base}user_textbox", "Hello");
 +		$this->type("{$base}pass_textbox", "world");
 +		$this->clickAndWait("//input[@type='submit' and @value='Submit']", "");
 +		$this->verifyTextPresent("Result", "");
 +		$this->verifyTextPresent("User: Hello Pass: world", "");		
 +	}
 +	 
 +}
 +
 +?>
  | 
