diff options
Diffstat (limited to 'tests')
467 files changed, 5292 insertions, 5180 deletions
diff --git a/tests/FunctionalTests/active-controls/protected/pages/ActiveBricksTest.page b/tests/FunctionalTests/active-controls/protected/pages/ActiveBricksTest.page index 7cb8c6b3..f3df76a2 100755 --- a/tests/FunctionalTests/active-controls/protected/pages/ActiveBricksTest.page +++ b/tests/FunctionalTests/active-controls/protected/pages/ActiveBricksTest.page @@ -1,4 +1,4 @@ -<com:TForm> +<com:TContent ID="Content"> <h3 class="ContentAlternating">Some AJAX Tests</h3> <com:TPanel CssClass="Content"> @@ -37,6 +37,4 @@ AIP </com:TActivePanel> - <com:TJavascriptLogger /> - -</com:TForm>
\ No newline at end of file +</com:TContent>
\ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/protected/pages/ActiveButtonTest.page b/tests/FunctionalTests/active-controls/protected/pages/ActiveButtonTest.page index 2e192c19..9e293934 100755 --- a/tests/FunctionalTests/active-controls/protected/pages/ActiveButtonTest.page +++ b/tests/FunctionalTests/active-controls/protected/pages/ActiveButtonTest.page @@ -1,4 +1,4 @@ -<com:TForm ID="form1"> +<com:TContent ID="Content"> <h1>TActiveButton Functional Test</h1> <com:TActiveButton ID="button2" Text="Button 1" @@ -6,6 +6,4 @@ <com:TActiveLabel ID="label1" Text="Label 1" /> - <com:TJavascriptLogger /> - -</com:TForm>
\ No newline at end of file +</com:TContent>
\ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/protected/pages/ActiveCheckBoxTest.page b/tests/FunctionalTests/active-controls/protected/pages/ActiveCheckBoxTest.page index 431d42f2..297cde15 100755 --- a/tests/FunctionalTests/active-controls/protected/pages/ActiveCheckBoxTest.page +++ b/tests/FunctionalTests/active-controls/protected/pages/ActiveCheckBoxTest.page @@ -1,4 +1,4 @@ -<com:TForm ID="form1"> +<com:TContent ID="Content"> <h1>Active CheckBox Test</h1> <com:TActiveCheckBox ID="checkbox1" Text="CheckBox 1" OnCallback="checkbox_requested" /> <com:TActiveCheckBox ID="checkbox2" Text="CheckBox 2" OnCallback="checkbox_requested"> @@ -25,5 +25,4 @@ position: absolute; right: 0; top: 0"> Loading... </div> - <com:TJavascriptLogger /> -</com:TForm>
\ No newline at end of file +</com:TContent>
\ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/protected/pages/ActiveControlExpressionTag.page b/tests/FunctionalTests/active-controls/protected/pages/ActiveControlExpressionTag.page index 7b983cd7..5a1c5023 100755 --- a/tests/FunctionalTests/active-controls/protected/pages/ActiveControlExpressionTag.page +++ b/tests/FunctionalTests/active-controls/protected/pages/ActiveControlExpressionTag.page @@ -1,4 +1,4 @@ -<com:TForm>
+<com:TContent ID="Content">
<h1>Active Control With Expression Tag Test</h1>
@@ -22,6 +22,5 @@ <com:TActiveButton ID="button2" Text="Show More!" Enabled="false"
OnCallback="button2_callback" />
-<com:TJavascriptLogger />
-</com:TForm>
\ No newline at end of file +</com:TContent>
\ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/protected/pages/ActiveControlWithTinyMce.page b/tests/FunctionalTests/active-controls/protected/pages/ActiveControlWithTinyMce.page index aa3be754..9a561458 100755 --- a/tests/FunctionalTests/active-controls/protected/pages/ActiveControlWithTinyMce.page +++ b/tests/FunctionalTests/active-controls/protected/pages/ActiveControlWithTinyMce.page @@ -1,4 +1,4 @@ -<com:TForm>
+<com:TContent ID="Content">
<h1>Active Control with TinyMCE</h1>
<com:THtmlArea ID="text1" />
@@ -7,5 +7,4 @@ <com:TActiveLabel ID="label1" />
-<com:TJavascriptLogger />
-</com:TForm>
\ No newline at end of file +</com:TContent>
\ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/protected/pages/ActiveDatePicker.page b/tests/FunctionalTests/active-controls/protected/pages/ActiveDatePicker.page index 88117744..ce40e1cb 100755 --- a/tests/FunctionalTests/active-controls/protected/pages/ActiveDatePicker.page +++ b/tests/FunctionalTests/active-controls/protected/pages/ActiveDatePicker.page @@ -1,15 +1,12 @@ -<html> -<com:THead/> -<body> -<com:TForm> +<com:TContent ID="Content"> <h1>TActiveDatePicker test</h1> <p> -<com:TActiveDatePicker ID="datepicker" DateFormat="MM-dd-yyyy" OnCallback="testDatePicker"/> <com:TActiveLabel ID="status" /><br/> <com:TActiveButton ID="decreaseButton" OnClick="decrease" Text="-1" OnCallback="testDatePicker"/> <com:TActiveButton ID="todayButton" OnClick="today" Text="Today" OnCallback="testDatePicker"/> <com:TActiveButton ID="increaseButton" OnClick="increase" Text="+1" OnCallback="testDatePicker"/> <com:TButton ID="toggleButton" OnClick="toggleMode" Text="Toggle input mode (postback)"/> +<com:TActiveDatePicker ID="datepicker" DateFormat="MM-dd-yyyy" OnCallback="testDatePicker"/> </p> <p> ShowCalendar=false @@ -23,6 +20,4 @@ ShowCalendar=false <com:TActiveDatePicker ID="datepicker3" DateFormat="MMMM/yyyy" OnCallback="testDatePicker3" InputMode="DropDownList" ShowCalendar="true"/> <com:TActiveLabel ID="status3" /><br/> -</com:TForm> -</body> -</html>
\ No newline at end of file +</com:TContent>
\ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/protected/pages/ActiveDropDownList.page b/tests/FunctionalTests/active-controls/protected/pages/ActiveDropDownList.page index dc71a228..bf15ba0e 100755 --- a/tests/FunctionalTests/active-controls/protected/pages/ActiveDropDownList.page +++ b/tests/FunctionalTests/active-controls/protected/pages/ActiveDropDownList.page @@ -1,4 +1,4 @@ -<com:TForm ID="form1"> +<com:TContent ID="Content"> <h1>Active Drop Down List Test Case</h1> <com:TActiveDropDownList ID="list1" AutoPostBack="true" SelectedIndex="0" OnSelectedIndexChanged="list1_changed"> @@ -26,6 +26,4 @@ <com:TButton ID="button5" Text="Post Back" OnClick="do_postback"/> </div> - <com:TJavascriptLogger /> - -</com:TForm>
\ No newline at end of file +</com:TContent>
\ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/protected/pages/ActiveHiddenFieldTest.page b/tests/FunctionalTests/active-controls/protected/pages/ActiveHiddenFieldTest.page index f0fc4b92..317da643 100755 --- a/tests/FunctionalTests/active-controls/protected/pages/ActiveHiddenFieldTest.page +++ b/tests/FunctionalTests/active-controls/protected/pages/ActiveHiddenFieldTest.page @@ -1,9 +1,9 @@ -<com:TForm ID="form1"> +<com:TContent ID="Content"> <h1>Active HiddenField Test Case</h1> - + <com:TActiveHiddenField ID="HiddenFieldEmpty" /> <com:TActiveHiddenField ID="HiddenFieldUsed" Value="My value" /> - + <div> <com:TActiveButton ID="Button1" Text="Set value to HiddenFieldEmpty" OnClick="onSetValue" /> <com:TActiveButton ID="Button2" Text="Get value from HiddenFieldUsed" OnClick="onGetValue" /> @@ -12,5 +12,4 @@ <div> <com:TActiveLabel ID="ResponseLabel" Text="Value of current hidden field" /> </div> - <com:TJavascriptLogger /> -</com:TForm>
\ No newline at end of file +</com:TContent>
\ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/protected/pages/ActiveHyperLinkTest.page b/tests/FunctionalTests/active-controls/protected/pages/ActiveHyperLinkTest.page index 59098052..9b149b45 100755 --- a/tests/FunctionalTests/active-controls/protected/pages/ActiveHyperLinkTest.page +++ b/tests/FunctionalTests/active-controls/protected/pages/ActiveHyperLinkTest.page @@ -1,6 +1,6 @@ -<com:TForm ID="form1"> +<com:TContent ID="Content"> <h1>Active HyperLink Test Case</h1> - + <div style="margin:1em; padding:1em; border:1px solid #ccc; text-align:center;"> <com:TActiveHyperLink ID="link1" Text="Link 1" NavigateUrl="http://www.pradosoft.com" /> </div> @@ -8,6 +8,4 @@ <com:TActiveButton ID="button2" Text="Change Image" OnClick="change_image" /> <com:TActiveButton ID="button3" Text="Change Target" OnClick="change_target" /> <com:TActiveButton ID="button4" Text="Change URL" OnClick="change_url" /> - - <com:TJavascriptLogger /> -</com:TForm>
\ No newline at end of file +</com:TContent>
\ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/protected/pages/ActiveImageButtonTest.page b/tests/FunctionalTests/active-controls/protected/pages/ActiveImageButtonTest.page index 7696261a..15cf2380 100755 --- a/tests/FunctionalTests/active-controls/protected/pages/ActiveImageButtonTest.page +++ b/tests/FunctionalTests/active-controls/protected/pages/ActiveImageButtonTest.page @@ -1,4 +1,4 @@ -<com:TForm ID="form1">
+<com:TContent ID="Content">
<h1>TActiveImageButton Functional Test</h1>
@@ -19,6 +19,4 @@ <com:TActiveButton ID="button3" Text="Change Align" OnClick="change_align" />
<com:TActiveButton ID="button4" Text="Change Description" OnClick="change_description" />
- <com:TJavascriptLogger />
-
-</com:TForm>
\ No newline at end of file +</com:TContent>
\ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/protected/pages/ActiveLinkButtonTest.page b/tests/FunctionalTests/active-controls/protected/pages/ActiveLinkButtonTest.page index cb9f0322..16ea578d 100755 --- a/tests/FunctionalTests/active-controls/protected/pages/ActiveLinkButtonTest.page +++ b/tests/FunctionalTests/active-controls/protected/pages/ActiveLinkButtonTest.page @@ -1,4 +1,4 @@ -<com:TForm ID="form1">
+<com:TContent ID="Content">
<h1>TActiveLinkButton Functional Test</h1>
<com:TActiveLinkButton ID="button2" Text="Button 1"
@@ -6,6 +6,4 @@ <com:TActiveLabel ID="label1" Text="Label 1" />
- <com:TJavascriptLogger />
-
-</com:TForm>
\ No newline at end of file +</com:TContent>
\ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/protected/pages/ActiveListBoxMasterTest.page b/tests/FunctionalTests/active-controls/protected/pages/ActiveListBoxMasterTest.page index f7c6baaf..115b833a 100755 --- a/tests/FunctionalTests/active-controls/protected/pages/ActiveListBoxMasterTest.page +++ b/tests/FunctionalTests/active-controls/protected/pages/ActiveListBoxMasterTest.page @@ -23,6 +23,4 @@ <com:TActiveButton ID="button6" Text="Change to Multi-Select" OnClick="change_to_multiple" />
<com:TActiveButton ID="button7" Text="Change to Single-Select" OnClick="change_to_single" />
</div>
-
- <com:TJavascriptLogger />
</com:TContent>
\ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/protected/pages/ActiveListBoxTest.page b/tests/FunctionalTests/active-controls/protected/pages/ActiveListBoxTest.page index 318d53c3..2bf480b4 100755 --- a/tests/FunctionalTests/active-controls/protected/pages/ActiveListBoxTest.page +++ b/tests/FunctionalTests/active-controls/protected/pages/ActiveListBoxTest.page @@ -1,4 +1,4 @@ -<com:TForm ID="form1">
+<com:TContent ID="Content">
<h1>Active List Box Functional Test</h1>
@@ -22,6 +22,4 @@ <com:TActiveButton ID="button6" Text="Change to Multi-Select" OnClick="change_to_multiple" />
<com:TActiveButton ID="button7" Text="Change to Single-Select" OnClick="change_to_single" />
</div>
-
- <com:TJavascriptLogger />
-</com:TForm>
\ No newline at end of file +</com:TContent>
\ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/protected/pages/ActivePanelTest.page b/tests/FunctionalTests/active-controls/protected/pages/ActivePanelTest.page index 7ab4bab9..573c6e8b 100755 --- a/tests/FunctionalTests/active-controls/protected/pages/ActivePanelTest.page +++ b/tests/FunctionalTests/active-controls/protected/pages/ActivePanelTest.page @@ -1,4 +1,4 @@ -<com:TForm ID="form1"> +<com:TContent ID="Content"> <h1>Active Panel replacement tests </h1> <com:TCallback ID="callback1" OnCallback="callback1_requested" /> <com:TActivePanel ID="panel1"> @@ -9,14 +9,11 @@ <div id="div1" style="border:1px solid #666; background-color: #ffe; text-align: center; padding:3em"> Click Me! </div> - <script type="text/javascript"> - Event.OnLoad(function() - { - Event.observe($("div1"), "click", function() - { - Prado.Callback("<%= $this->callback1->UniqueID %>") - }) - }) - </script> - <com:TJavascriptLogger /> -</com:TForm>
\ No newline at end of file + <com:TClientScript> + jQuery( document ).ready(function() { + jQuery("#div1").click(function() { + Prado.Callback("<%= $this->callback1->UniqueID %>"); + }); + }); + </com:TClientScript> +</com:TContent>
\ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/protected/pages/ActivePanelVisibleTest.page b/tests/FunctionalTests/active-controls/protected/pages/ActivePanelVisibleTest.page index 0795e46b..93684bef 100755 --- a/tests/FunctionalTests/active-controls/protected/pages/ActivePanelVisibleTest.page +++ b/tests/FunctionalTests/active-controls/protected/pages/ActivePanelVisibleTest.page @@ -1,4 +1,4 @@ -<com:TForm>
+<com:TContent ID="Content">
<h1>ActivePanel Visible Test</h1>
@@ -12,6 +12,5 @@ <com:TActivePanel ID="pnlB">bar</com:TActivePanel>
-<com:TJavascriptLogger />
-</com:TForm>
\ No newline at end of file +</com:TContent>
\ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/protected/pages/ActiveRadioButtonListTest.page b/tests/FunctionalTests/active-controls/protected/pages/ActiveRadioButtonListTest.page index 26feb594..e222a70f 100755 --- a/tests/FunctionalTests/active-controls/protected/pages/ActiveRadioButtonListTest.page +++ b/tests/FunctionalTests/active-controls/protected/pages/ActiveRadioButtonListTest.page @@ -1,4 +1,4 @@ -<com:TForm ID="form1">
+<com:TContent ID="Content">
<h1>TActiveRadioButtonList Test Case</h1>
<com:TActiveRadioButtonList ID="list1" OnCallback="list1_callback">
@@ -17,6 +17,4 @@ <com:TActiveButton ID="button4" Text="Select Index 4" OnClick="select_index_4" />
</div>
- <com:TJavascriptLogger />
-
-</com:TForm>
\ No newline at end of file +</com:TContent>
\ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/protected/pages/ActiveRadioButtonTest.page b/tests/FunctionalTests/active-controls/protected/pages/ActiveRadioButtonTest.page index 2bb4c9de..66587943 100755 --- a/tests/FunctionalTests/active-controls/protected/pages/ActiveRadioButtonTest.page +++ b/tests/FunctionalTests/active-controls/protected/pages/ActiveRadioButtonTest.page @@ -1,4 +1,4 @@ -<com:TForm ID="form1">
+<com:TContent ID="Content">
<h1>Active Radio Button Test</h1>
<com:TActiveRadioButton ID="radio1"
GroupName="group1" Text="Radio Button 1"
@@ -34,5 +34,4 @@ position: absolute; right: 0; top: 0">
Loading...
</div>
- <com:TJavascriptLogger />
-</com:TForm>
\ No newline at end of file +</com:TContent>
\ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListAllowInputTest.page b/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListAllowInputTest.page index 35fcadc7..d3c551b4 100755 --- a/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListAllowInputTest.page +++ b/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListAllowInputTest.page @@ -1,5 +1,4 @@ -<com:THead />
-<com:TForm ID="form1">
+<com:TContent ID="Content">
<h1>TActiveRatingList AllowInput Test Case</h1>
<com:TActiveRatingList ID="RatingList" AllowInput="false"
OnSelectedIndexChanged="ratingChanged">
@@ -11,4 +10,4 @@ <com:TListItem Text="Super" />
</com:TActiveRatingList>
<com:TActiveLabel ID="Status" Text="AllowInput=false" />
-</com:TForm>
\ No newline at end of file +</com:TContent>
\ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListAutoPostBackTest.page b/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListAutoPostBackTest.page index 84ce4ef3..e0d3cbbe 100755 --- a/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListAutoPostBackTest.page +++ b/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListAutoPostBackTest.page @@ -1,5 +1,4 @@ -<com:THead />
-<com:TForm ID="form1">
+<com:TContent ID="Content">
<h1>TActiveRatingList AutoPostBack Test Case</h1>
<com:TActiveRatingList ID="RatingList" AutoPostback="false"
OnSelectedIndexChanged="ratingChanged">
@@ -13,4 +12,4 @@ <com:TActiveLabel ID="Status" Text="AutoPostback=false" />
<br />
<com:TActiveButton ID="Submit" Text="Submit" />
-</com:TForm>
\ No newline at end of file +</com:TContent>
\ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListCheckBoxesTest.page b/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListCheckBoxesTest.page index 36f4404d..cba50947 100755 --- a/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListCheckBoxesTest.page +++ b/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListCheckBoxesTest.page @@ -1,5 +1,4 @@ -<com:THead />
-<com:TForm ID="form1">
+<com:TContent ID="Content">
<h1>TActiveRatingList Check Boxes Test Case</h1>
<com:TActiveRatingList ID="RatingList">
<com:TListItem Text="Poor" />
@@ -9,4 +8,4 @@ <com:TListItem Text="Excellent" />
<com:TListItem Text="Super" />
</com:TActiveRatingList>
-</com:TForm>
\ No newline at end of file +</com:TContent>
\ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListEnabledTest.page b/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListEnabledTest.page index 5f732e0d..791176df 100755 --- a/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListEnabledTest.page +++ b/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListEnabledTest.page @@ -1,5 +1,4 @@ -<com:THead />
-<com:TForm ID="form1">
+<com:TContent ID="Content">
<h1>TActiveRatingList Enabled Test Case</h1>
<com:TActiveRatingList ID="RatingList" Enabled="false"
OnSelectedIndexChanged="ratingChanged">
@@ -14,4 +13,4 @@ <br />
<com:TActiveButton ID="Enable" Text="Enable" OnClick="enable" />
<com:TActiveButton ID="Disable" Text="Disable" OnClick="disable" />
-</com:TForm>
\ No newline at end of file +</com:TContent>
\ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListHoverCaptionTest.page b/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListHoverCaptionTest.page index 01e47a34..0a2a5f50 100755 --- a/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListHoverCaptionTest.page +++ b/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListHoverCaptionTest.page @@ -1,5 +1,4 @@ -<com:THead />
-<com:TForm ID="form1">
+<com:TContent ID="Content">
<h1>TActiveRatingList Hover Caption Test Case</h1>
<com:TActiveRatingList ID="RatingList" CaptionID="Status"
OnSelectedIndexChanged="ratingChanged" Rating="3.5">
@@ -11,4 +10,4 @@ <com:TListItem Text="Super" />
</com:TActiveRatingList>
<com:TActiveLabel ID="Status" Text="CaptionID='Status'" />
-</com:TForm>
\ No newline at end of file +</com:TContent>
\ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListRatingTest.page b/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListRatingTest.page index 942a5b45..c9aed5b4 100755 --- a/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListRatingTest.page +++ b/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListRatingTest.page @@ -1,5 +1,4 @@ -<com:THead />
-<com:TForm ID="form1">
+<com:TContent ID="Content">
<h1>TActiveRatingList Rating Test Case</h1>
<com:TActiveRatingList ID="RatingList" Rating="5"
OnSelectedIndexChanged="ratingChanged">
@@ -14,4 +13,4 @@ <br />
<com:TActiveButton ID="SetRating" Text="Set Rating=3"
OnClick="setRating" />
-</com:TForm>
\ No newline at end of file +</com:TContent>
\ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListReadOnlyTest.page b/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListReadOnlyTest.page index dad3fd6e..70220e58 100755 --- a/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListReadOnlyTest.page +++ b/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListReadOnlyTest.page @@ -1,5 +1,4 @@ -<com:THead />
-<com:TForm ID="form1">
+<com:TContent ID="Content">
<h1>TActiveRatingList ReadOnly Test Case</h1>
<com:TActiveRatingList ID="RatingList" ReadOnly="true"
OnSelectedIndexChanged="ratingChanged">
@@ -14,4 +13,4 @@ <br />
<com:TActiveButton ID="Writable" Text="Writable" OnClick="writable" />
<com:TActiveButton ID="ReadOnly" Text="ReadOnly" OnClick="readOnly" />
-</com:TForm>
\ No newline at end of file +</com:TContent>
\ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListSelectedIndexTest.page b/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListSelectedIndexTest.page index 6fb52822..ee26568d 100755 --- a/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListSelectedIndexTest.page +++ b/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListSelectedIndexTest.page @@ -1,5 +1,4 @@ -<com:THead />
-<com:TForm ID="form1">
+<com:TContent ID="Content">
<h1>TActiveRatingList SelectedIndex Test Case</h1>
<com:TActiveRatingList ID="RatingList" SelectedIndex="1"
OnSelectedIndexChanged="ratingChanged">
@@ -14,4 +13,4 @@ <br />
<com:TActiveButton ID="SetSelectedIndex" Text="Set SelectedIndex=5"
OnClick="setSelectedIndex" />
-</com:TForm>
\ No newline at end of file +</com:TContent>
\ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/protected/pages/ActiveRedirectionTest.page b/tests/FunctionalTests/active-controls/protected/pages/ActiveRedirectionTest.page index 5f7959c5..8f4e175d 100755 --- a/tests/FunctionalTests/active-controls/protected/pages/ActiveRedirectionTest.page +++ b/tests/FunctionalTests/active-controls/protected/pages/ActiveRedirectionTest.page @@ -1,8 +1,7 @@ -<com:TForm>
+<com:TContent ID="Content">
<h1>Redirection Test</h1>
<com:TActiveButton Text="Redirect to Default Page" OnClick="button_clicked" />
-<com:TJavascriptLogger />
-</com:TForm>
\ No newline at end of file +</com:TContent>
\ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/protected/pages/ActiveTextBoxCallback.page b/tests/FunctionalTests/active-controls/protected/pages/ActiveTextBoxCallback.page index b05ce62e..50b244b5 100755 --- a/tests/FunctionalTests/active-controls/protected/pages/ActiveTextBoxCallback.page +++ b/tests/FunctionalTests/active-controls/protected/pages/ActiveTextBoxCallback.page @@ -1,6 +1,5 @@ -<com:TForm ID="form1"> +<com:TContent ID="Content"> <h1>ActiveTextBox Callback Test</h1> <com:TActiveTextBox ID="textbox1" AutoPostBack="true" OnCallback="textbox1_callback" /> <com:TActiveLabel ID="label1" Text="Label 1" /> - <com:TJavascriptLogger /> -</com:TForm>
\ No newline at end of file +</com:TContent>
\ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/protected/pages/AutoCompleteTest.page b/tests/FunctionalTests/active-controls/protected/pages/AutoCompleteTest.page index 477764c3..98745b55 100755 --- a/tests/FunctionalTests/active-controls/protected/pages/AutoCompleteTest.page +++ b/tests/FunctionalTests/active-controls/protected/pages/AutoCompleteTest.page @@ -1,4 +1,4 @@ -<com:TForm ID="form1"> +<com:TContent ID="Content"> <style> .autocomplete @@ -58,7 +58,7 @@ <li> << <span class="select"><%# $this->Data %></span> - >> + >> </li> </prop:Suggestions.ItemTemplate> </com:TAutoComplete> @@ -79,7 +79,7 @@ OnSuggest="suggestCountries" OnCallback="callback_requested" OnSuggestionSelected="suggestion_selected" - ResultPanel.CssClass="autocomplete" + ResultPanel.CssClass="autocomplete" MinChars="4" Frequency="2" /> <p><br /></p> @@ -91,5 +91,4 @@ <p><br /></p> <p><br /></p> <p><br /></p> - <com:TJavascriptLogger /> -</com:TForm>
\ No newline at end of file +</com:TContent>
\ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/protected/pages/Calculator.page b/tests/FunctionalTests/active-controls/protected/pages/Calculator.page index 7a565658..e7b1f180 100755 --- a/tests/FunctionalTests/active-controls/protected/pages/Calculator.page +++ b/tests/FunctionalTests/active-controls/protected/pages/Calculator.page @@ -1,17 +1,17 @@ -<com:TForm ID="form1"> +<com:TContent ID="Content"> <h1>Callback Enabled Calculator</h1> - + <com:TActiveTextBox id="a" /> + <com:TActiveTextBox id="b" /> = <com:TActiveTextBox id="c" /> - - <com:TActiveButton id="sum" - onclick="do_sum" + + <com:TActiveButton id="sum" + onclick="do_sum" text="Calculate!" /> - - <com:TRequiredFieldValidator + + <com:TRequiredFieldValidator ControlToValidate="a" ErrorMessage="left summand is required." ControlCssClass="required" @@ -27,5 +27,5 @@ ID="summary" HeaderText="Unable to calculate because" /> </div> - -</com:TForm>
\ No newline at end of file + +</com:TContent>
\ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/protected/pages/Callback.page b/tests/FunctionalTests/active-controls/protected/pages/Callback.page index d8744760..f8489af3 100755 --- a/tests/FunctionalTests/active-controls/protected/pages/Callback.page +++ b/tests/FunctionalTests/active-controls/protected/pages/Callback.page @@ -1,15 +1,13 @@ -<com:TForm>
+<com:TContent ID="Content">
<com:TCallback ID="callback1" OnCallback="callback1_Requested" />
- <script type="text/javascript">
+ <script type="text/javascript">
function do_callback1()
- {
+ {
var callback = <%= $this->callback1->ActiveControl->Javascript %>;
callback.dispatch();
- }
- </script>
+ }
+ </script>
<div onclick="do_callback1()">Click Me!</div>
- <com:TJavascriptLogger />
-
-</com:TForm>
\ No newline at end of file +</com:TContent>
\ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/protected/pages/CallbackCustomValidatorTest.page b/tests/FunctionalTests/active-controls/protected/pages/CallbackCustomValidatorTest.page index a99fbf55..134e45cb 100755 --- a/tests/FunctionalTests/active-controls/protected/pages/CallbackCustomValidatorTest.page +++ b/tests/FunctionalTests/active-controls/protected/pages/CallbackCustomValidatorTest.page @@ -1,4 +1,4 @@ -<com:TForm ID="form1">
+<com:TContent ID="Content">
<style>
.loader
{
@@ -37,6 +37,4 @@ <span id="loader" style="display:none;" onfocus="alert('ok')" class="loader">Loading...</span>
- <com:TJavascriptLogger />
-
-</com:TForm>
\ No newline at end of file +</com:TContent>
\ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/protected/pages/CallbackOptionsTest.page b/tests/FunctionalTests/active-controls/protected/pages/CallbackOptionsTest.page index 3cecbade..5adc646f 100755 --- a/tests/FunctionalTests/active-controls/protected/pages/CallbackOptionsTest.page +++ b/tests/FunctionalTests/active-controls/protected/pages/CallbackOptionsTest.page @@ -1,27 +1,27 @@ -<com:TForm ID="form1"> +<com:TContent ID="Content"> <h1>TCallbackOptions Test</h1> <com:TCallbackOptions ID="options1"> <prop:ClientSide.OnLoading> - $("status").show(); + $("#status").show(); </prop:ClientSide.OnLoading> <prop:ClientSide.OnComplete> - $("status").hide(); + $("#status").hide(); </prop:ClientSide.OnComplete> <prop:ClientSide.OnSuccess> - Element.update("label1", "Button 1 has returned"); + $("#label1").html("Button 1 has returned"); </prop:ClientSide.OnSuccess> </com:TCallbackOptions> <com:TActiveButton id="button1" Text="Button 1" ActiveControl.CallbackOptions="options1" /> <com:TActiveButton id="button2" Text="Button 2" ActiveControl.CallbackOptions="options1"> <prop:ClientSide.OnSuccess> - Element.update("label2", "Button 2 has returned"); + $("#label2").html("Button 2 has returned"); </prop:ClientSide.OnSuccess> </com:TActiveButton> <com:TActiveButton id="button3" Text="Button 3"> <prop:ClientSide.OnSuccess> - Element.update("label3", "Button 3 has returned"); + $("#label3").html("Button 3 has returned"); </prop:ClientSide.OnSuccess> </com:TActiveButton> @@ -31,4 +31,4 @@ <div id="status" style="display:none; background-color: #c00; color:white; text-align:center; padding: 1em" > Loading... </div> -</com:TForm>
\ No newline at end of file +</com:TContent>
\ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/protected/pages/ClientSideDispatch.page b/tests/FunctionalTests/active-controls/protected/pages/ClientSideDispatch.page index acf56bfe..3b5ed15f 100755 --- a/tests/FunctionalTests/active-controls/protected/pages/ClientSideDispatch.page +++ b/tests/FunctionalTests/active-controls/protected/pages/ClientSideDispatch.page @@ -1,4 +1,4 @@ -<com:TForm>
+<com:TContent ID="Content">
<com:TCallback ID="callback1" OnCallback="method1" />
@@ -7,21 +7,20 @@ var link1 = Prado.CallbackRequest.getRequestById('<%= $this->link1->ClientID %>');
Prado.Callback('<%= $this->callback1->UniqueID %>', link1.getCallbackParameter());
</prop:ClientSide.OnSuccess>
-
+
</com:TCallbackOptions>
- <com:TActiveLinkButton
+ <com:TActiveLinkButton
ID="link1"
- Text="Tab 1"
- OnCallback="method2"
- ActiveControl.CallbackParameter="test"
+ Text="Tab 1"
+ OnCallback="method2"
+ ActiveControl.CallbackParameter="test"
ActiveControl.CallbackOptions="options1"/>
<com:TActiveLabel ID="status1" />
<com:TActiveLabel ID="status2" />
-<com:TJavascriptLogger />
-</com:TForm>
\ No newline at end of file +</com:TContent>
\ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/protected/pages/ControlAdapterTest.page b/tests/FunctionalTests/active-controls/protected/pages/ControlAdapterTest.page index f0f3044d..2dc07852 100755 --- a/tests/FunctionalTests/active-controls/protected/pages/ControlAdapterTest.page +++ b/tests/FunctionalTests/active-controls/protected/pages/ControlAdapterTest.page @@ -1,10 +1,10 @@ -<com:TForm ID="form1"> +<com:TContent ID="Content"> <h1>Control Adapter - State Tracking Tests</h1> <com:TActiveButton ID="button1" Text="Test Button 1" /> - <com:TActiveButton ID="button2" Text="Test Button 2" + <com:TActiveButton ID="button2" Text="Test Button 2" Attributes.onclick="alert('ok')" Style.Font.Size="12" Style.BackColor="blue" Style.Height="2em" /> - + <div style="margin:1em; padding: 0.5em; border:1px solid #ccc; text-align:center"> <com:TActiveButton ID="test1" Text="Enable/Disable Button 1" OnClick="change_enabled"/> <com:TActiveButton ID="test2" Text="Hide/Show Button 1" OnClick="change_visible"/> @@ -19,5 +19,4 @@ <com:TActiveButton ID="test8" Text="Change Button 1 Attributes" OnClick="change_attributes1"/> <com:TActiveButton ID="test9" Text="Change Button 2 Attributes" OnClick="change_attributes2"/> </div> - <com:TJavascriptLogger /> -</com:TForm>
\ No newline at end of file +</com:TContent>
\ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/protected/pages/CustomTemplateControlTest.page b/tests/FunctionalTests/active-controls/protected/pages/CustomTemplateControlTest.page index 3bed7d5b..cd34ff98 100755 --- a/tests/FunctionalTests/active-controls/protected/pages/CustomTemplateControlTest.page +++ b/tests/FunctionalTests/active-controls/protected/pages/CustomTemplateControlTest.page @@ -1,4 +1,4 @@ -<com:TForm ID="form1">
+<com:TContent ID="Content">
<h1>Add Dynamic Custom TTemplateControl Test</h1>
<com:TActivePanel ID="Foo">
@@ -10,7 +10,4 @@ <com:TActivePanel ID="placeholder" />
<com:TActiveLabel ID="label1" Text="Label 1" />
-
-
- <com:TJavascriptLogger />
-</com:TForm>
\ No newline at end of file +</com:TContent>
\ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/protected/pages/CustomValidatorByPass.page b/tests/FunctionalTests/active-controls/protected/pages/CustomValidatorByPass.page index 08b7bb3e..0bebcd59 100755 --- a/tests/FunctionalTests/active-controls/protected/pages/CustomValidatorByPass.page +++ b/tests/FunctionalTests/active-controls/protected/pages/CustomValidatorByPass.page @@ -1,8 +1,8 @@ -<com:TForm>
+<com:TContent ID="Content">
<h1>Custom Login</h1>
-<a id="showLogin" href="#" onclick="new Effect.Appear('loginBox')">Login</a>
+<a id="showLogin" href="#" onclick="$('#loginBox').fadeIn()">Login</a>
<div id="loginBox" style="display: none;">
<div style="height:1em">
@@ -10,29 +10,28 @@ </div>
<span>Username:</span><br />
<com:TActiveTextBox ID="Username" />
- <com:TRequiredFieldValidator
+ <com:TRequiredFieldValidator
ID="validator1"
- ControlToValidate="Username"
- ValidationGroup="login"
+ ControlToValidate="Username"
+ ValidationGroup="login"
Text="...is required" Display="Dynamic"/>
<br />
<span>Password:</span><br />
<com:TActiveTextBox TextMode="Password" ID="Password" />
- <com:TActiveCustomValidator
- ID="validator2"
- ControlToValidate="Password"
+ <com:TActiveCustomValidator
+ ID="validator2"
+ ControlToValidate="Password"
Text="*"
OnServerValidate="validateUser" ValidationGroup="login" />
<br />
<com:TActiveLinkButton ID="checkLogin" OnCallback="doLogin" Text="Login" ValidationGroup="login" />
- <a href="#" onclick="new Effect.Fade('loginBox')">Close</a>
+ <a href="#" onclick="$('#loginBox').fadeOut()">Close</a>
</div>
-<com:TJavascriptLogger />
-</com:TForm>
\ No newline at end of file +</com:TContent>
\ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/protected/pages/DatePickerInCallback.page b/tests/FunctionalTests/active-controls/protected/pages/DatePickerInCallback.page index 8b39dc55..2f51eff2 100755 --- a/tests/FunctionalTests/active-controls/protected/pages/DatePickerInCallback.page +++ b/tests/FunctionalTests/active-controls/protected/pages/DatePickerInCallback.page @@ -1,7 +1,7 @@ -<com:TForm>
+<com:TContent ID="Content">
<h1>DatePicker in Callback</h1>
<com:TDatePicker ID="datepicker" />
<com:TActiveLinkButton OnCallback="testDatePicker" Text="testDatePicker" />
<com:TActiveLabel ID="status" />
-</com:TForm>
\ No newline at end of file +</com:TContent>
\ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/protected/pages/DelayedCallback.page b/tests/FunctionalTests/active-controls/protected/pages/DelayedCallback.page index b8fba648..f858e8eb 100755 --- a/tests/FunctionalTests/active-controls/protected/pages/DelayedCallback.page +++ b/tests/FunctionalTests/active-controls/protected/pages/DelayedCallback.page @@ -1,7 +1,6 @@ -<com:TForm>
+<com:TContent ID="Content">
<h1>Delayed Callback Test</h1>
<com:TActiveButton ID="button1" Text="Delayed 4000" OnCallback="callback1" />
<com:TActiveButton ID="button2" Text="Delayed 2000" OnCallback="callback2" />
<com:TActiveLabel ID="status" />
-<com:TJavascriptLogger />
-</com:TForm>
\ No newline at end of file +</com:TContent>
\ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/protected/pages/DisplayStyleTest.page b/tests/FunctionalTests/active-controls/protected/pages/DisplayStyleTest.page index df1db27a..c27ea397 100755 --- a/tests/FunctionalTests/active-controls/protected/pages/DisplayStyleTest.page +++ b/tests/FunctionalTests/active-controls/protected/pages/DisplayStyleTest.page @@ -1,4 +1,4 @@ -<com:TForm>
+<com:TContent ID="Content">
<h1>Display Style Test</h1>
<div>
@@ -17,6 +17,5 @@ here. <com:TActiveLabel ID="status" />
-<com:TJavascriptLogger />
-</com:TForm>
\ No newline at end of file +</com:TContent>
\ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/protected/pages/DynamicRepeaterDataTest.page b/tests/FunctionalTests/active-controls/protected/pages/DynamicRepeaterDataTest.page index 913f6a17..26407827 100755 --- a/tests/FunctionalTests/active-controls/protected/pages/DynamicRepeaterDataTest.page +++ b/tests/FunctionalTests/active-controls/protected/pages/DynamicRepeaterDataTest.page @@ -1,4 +1,4 @@ -<com:TForm>
+<com:TContent ID="Content">
<h1>Dynamic Repeater Data Test</h1>
<com:TActiveButton Text="Click Me!" OnClick="button_clicked" OnCallback="button_callback"/>
@@ -11,6 +11,5 @@ </com:TRepeater>
</com:TActivePanel>
-<com:TJavascriptLogger />
-</com:TForm>
\ No newline at end of file +</com:TContent>
\ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/protected/pages/EventTriggeredCallback.page b/tests/FunctionalTests/active-controls/protected/pages/EventTriggeredCallback.page index 889636f3..1adbaac1 100755 --- a/tests/FunctionalTests/active-controls/protected/pages/EventTriggeredCallback.page +++ b/tests/FunctionalTests/active-controls/protected/pages/EventTriggeredCallback.page @@ -1,4 +1,4 @@ -<com:TForm ID="form1">
+<com:TContent ID="Content">
<h1>Event Triggered Callback Test</h1>
@@ -27,5 +27,4 @@ <div style="padding: 2em; border:1px solid #ccc; margin-top:2em">
<com:TActiveLabel ID="label1" Text="Label 1" />
</div>
- <com:TJavascriptLogger />
-</com:TForm>
\ No newline at end of file +</com:TContent>
\ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/protected/pages/FeatureList.page b/tests/FunctionalTests/active-controls/protected/pages/FeatureList.page index eab14a87..a01e6b5e 100755 --- a/tests/FunctionalTests/active-controls/protected/pages/FeatureList.page +++ b/tests/FunctionalTests/active-controls/protected/pages/FeatureList.page @@ -1,3 +1,3 @@ -<com:TForm ID="form1"> - <com:TBulletedList ID="List" DisplayMode="HyperLink"/> -</com:TForm> +<com:TContent ID="Content"> + <com:TBulletedList ID="List" DisplayMode="HyperLink"/> +</com:TContent> diff --git a/tests/FunctionalTests/active-controls/protected/pages/GerTurno2.page b/tests/FunctionalTests/active-controls/protected/pages/GerTurno2.page index f4bf644c..bf2b48b7 100755 --- a/tests/FunctionalTests/active-controls/protected/pages/GerTurno2.page +++ b/tests/FunctionalTests/active-controls/protected/pages/GerTurno2.page @@ -1,7 +1,7 @@ -<com:TForm>
+<com:TContent ID="Content">
<com:TLabel ForControl="DDropTurno" Text="Turno:"/>
-<com:TActiveDropDownList ID="DDropTurno"
+<com:TActiveDropDownList ID="DDropTurno"
onSelectedIndexChanged="trocaTurno" AutoPostBack="true"/>
<com:TLabel Text="Código:" ForControl="Codigo"/>
@@ -11,6 +11,5 @@ <com:TActiveTextBox ID="Descricao" MaxLength="25" Columns="25"/>
-<com:TJavascriptLogger />
-</com:TForm>
\ No newline at end of file +</com:TContent>
\ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/protected/pages/InPlaceWithValidator.page b/tests/FunctionalTests/active-controls/protected/pages/InPlaceWithValidator.page index ba3a35db..e4fd93e9 100755 --- a/tests/FunctionalTests/active-controls/protected/pages/InPlaceWithValidator.page +++ b/tests/FunctionalTests/active-controls/protected/pages/InPlaceWithValidator.page @@ -1,4 +1,4 @@ -
+<com:TContent ID="Content">
<style>
.textbox
{
@@ -35,7 +35,6 @@ }
</style>
-<com:TForm>
<com:TInPlaceTextBox
ID="Firstname"
Text="firstname"
@@ -60,19 +59,18 @@ ValidationGroup="Group"
/>
<br />
- <com:TActiveButton ID="active_button"
- Text="Active Submit"
+ <com:TActiveButton ID="active_button"
+ Text="Active Submit"
ValidationGroup="Group"
CausesValidation="true"
OnCallback="button_valid"
- />
- <com:TButton ID="passive_button"
- Text="Passive Submit"
+ />
+ <com:TButton ID="passive_button"
+ Text="Passive Submit"
ValidationGroup="Group"
CausesValidation="true"
OnClick="button_valid"
- />
+ />
<br />
<com:TActiveLabel ID="status" Text="Status:" />
- <com:TJavascriptLogger />
-</com:TForm>
\ No newline at end of file +</com:TContent>
\ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/protected/pages/LargePageStateTest.page b/tests/FunctionalTests/active-controls/protected/pages/LargePageStateTest.page index 701bd74c..b4798fe1 100755 --- a/tests/FunctionalTests/active-controls/protected/pages/LargePageStateTest.page +++ b/tests/FunctionalTests/active-controls/protected/pages/LargePageStateTest.page @@ -1,12 +1,11 @@ -<com:TForm>
+<com:TContent ID="Content">
<h1>Large Page State Test</h1>
<com:TActiveButton Text="Show Changes" OnClick="button_clicked"/>
<com:TActiveLabel ID="status" />
-<com:TJavascriptLogger />
<com:TPanel ID="Panel1">
</com:TPanel>
-</com:TForm>
\ No newline at end of file +</com:TContent>
\ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/protected/pages/LargePageStateTest2.page b/tests/FunctionalTests/active-controls/protected/pages/LargePageStateTest2.page index 0b662617..56ad075e 100755 --- a/tests/FunctionalTests/active-controls/protected/pages/LargePageStateTest2.page +++ b/tests/FunctionalTests/active-controls/protected/pages/LargePageStateTest2.page @@ -1,13 +1,12 @@ <%@ StatePersisterClass="System.Web.UI.TSessionPageStatePersister" %>
-<com:TForm>
+<com:TContent ID="Content">
<h1>Large Page State Test (using Session page state)</h1>
<com:TActiveButton Text="Show Changes" OnClick="button_clicked"/>
<com:TActiveLabel ID="status" />
-<com:TJavascriptLogger />
<com:TPanel ID="Panel1">
</com:TPanel>
-</com:TForm>
\ No newline at end of file +</com:TContent>
\ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/protected/pages/Layout.php b/tests/FunctionalTests/active-controls/protected/pages/Layout.php new file mode 100755 index 00000000..723f200c --- /dev/null +++ b/tests/FunctionalTests/active-controls/protected/pages/Layout.php @@ -0,0 +1,5 @@ +<?php + +class Layout extends TTemplateControl +{ +} diff --git a/tests/FunctionalTests/active-controls/protected/pages/Layout.tpl b/tests/FunctionalTests/active-controls/protected/pages/Layout.tpl new file mode 100755 index 00000000..ead6c66f --- /dev/null +++ b/tests/FunctionalTests/active-controls/protected/pages/Layout.tpl @@ -0,0 +1,38 @@ +<!DOCTYPE html PUBLIC + "-//W3C//DTD XHTML 1.0 Strict//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<com:THead Title="PRADO Functional Tests"> + <meta http-equiv="Content-type" content="text/html; charset=UTF-8" /> + <style type="text/css"> + /*<![CDATA[*/ + .defect + { + color: #c00; + font-size: 1.15em; + } + body + { + font-family: Georgia, "Times New Roman", Times, serif; + } + .w3c + { + margin-top: 2em; + display: block; + } + .required + { + border: 1px solid red; + background-color: pink; + } + /*]]>*/ + </style> +</com:THead> +<body> +<com:TForm> +<com:TContentPlaceHolder ID="Content" /> +<hr style="margin-top: 2em" /> +</com:TForm> +</body> +</html>
\ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/protected/pages/MessagesPanelTest.page b/tests/FunctionalTests/active-controls/protected/pages/MessagesPanelTest.page index ab4798a8..33868332 100755 --- a/tests/FunctionalTests/active-controls/protected/pages/MessagesPanelTest.page +++ b/tests/FunctionalTests/active-controls/protected/pages/MessagesPanelTest.page @@ -1,7 +1,6 @@ -<com:TForm>
+<com:TContent ID="Content">
<com:Application.pages.DMessagesPanel ID="panel1" PanelCssClass="one1" />
<com:TActiveButton Text="Show" OnClick="show_clicked" />
<com:TActiveButton Text="Hide" OnClick="hide_clicked" />
-<com:TJavascriptLogger />
-</com:TForm>
\ No newline at end of file +</com:TContent>
\ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/protected/pages/MyTabPanelTest.page b/tests/FunctionalTests/active-controls/protected/pages/MyTabPanelTest.page index 7371086a..c877c083 100755 --- a/tests/FunctionalTests/active-controls/protected/pages/MyTabPanelTest.page +++ b/tests/FunctionalTests/active-controls/protected/pages/MyTabPanelTest.page @@ -1,4 +1,4 @@ -<com:TForm ID="form1">
+<com:TContent ID="Content">
<h1>My Tab Panel Test</h1>
@@ -36,6 +36,5 @@ This is the contents of panel C
</com:TActivePanel>
-<com:TJavascriptLogger />
-</com:TForm>
+</com:TContent>
diff --git a/tests/FunctionalTests/active-controls/protected/pages/NestedActiveControls.page b/tests/FunctionalTests/active-controls/protected/pages/NestedActiveControls.page index 9d3a3d61..a79c5afa 100755 --- a/tests/FunctionalTests/active-controls/protected/pages/NestedActiveControls.page +++ b/tests/FunctionalTests/active-controls/protected/pages/NestedActiveControls.page @@ -1,12 +1,12 @@ -<com:TForm ID="form1"> +<com:TContent ID="Content"> <h1>Nested Active Controls Test</h1> <com:TCallback ID="callback1" OnCallback="callback1_requested" /> <com:TActivePanel ID="panel1"> <com:TPlaceHolder ID="content1" Visible="false"> - Something lalala + Something lalala <com:TActiveButton ID="button1" Text="Button 1" OnClick="button1_clicked" /> <com:TActiveLabel ID="label3" Text="Label 3" /> - + </com:TPlaceHolder> <com:TActiveLabel ID="label1" Text="Label 1" /> </com:TActivePanel> @@ -14,15 +14,12 @@ Click Me! </div> <com:TActiveLabel ID="label2" Text="Label 2" /> - <script type="text/javascript"> - Event.OnLoad(function() - { - Event.observe($("div1"), "click", function() - { - Prado.Callback("<%= $this->callback1->UniqueID %>") - }) - }) - </script> - <com:TJavascriptLogger /> - -</com:TForm> + <com:TClientScript> + jQuery( document ).ready(function() { + jQuery("#div1").click(function() { + Prado.Callback("<%= $this->callback1->UniqueID %>"); + }); + }); + </com:TClientScript> + +</com:TContent> diff --git a/tests/FunctionalTests/active-controls/protected/pages/NullStateTest.page b/tests/FunctionalTests/active-controls/protected/pages/NullStateTest.page index 2ce98f5b..6b5ed334 100755 --- a/tests/FunctionalTests/active-controls/protected/pages/NullStateTest.page +++ b/tests/FunctionalTests/active-controls/protected/pages/NullStateTest.page @@ -1,10 +1,9 @@ -<com:TForm>
+<com:TContent ID="Content">
<h1>Null State Test</h1>
<com:TActiveLabel ID="lblTest"/>
<com:TActiveButton OnCallback="btnTest_OnCallback" Text="Clickme"/>
-<com:TJavascriptLogger />
-</com:TForm>
\ No newline at end of file +</com:TContent>
\ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/protected/pages/PopulateActiveList.page b/tests/FunctionalTests/active-controls/protected/pages/PopulateActiveList.page index c7bf0952..3ab9d8fb 100755 --- a/tests/FunctionalTests/active-controls/protected/pages/PopulateActiveList.page +++ b/tests/FunctionalTests/active-controls/protected/pages/PopulateActiveList.page @@ -1,4 +1,4 @@ -<com:TForm>
+<com:TContent ID="Content">
<h1>Populate active list controls</h1>
<com:TActiveListBox ID="list1" OnCallback="list_changed" />
@@ -12,6 +12,5 @@ <com:TActiveButton ID="button2" Text="populate list 2" OnClick="populate_list2" />
-<com:TJavascriptLogger />
-</com:TForm>
\ No newline at end of file +</com:TContent>
\ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/protected/pages/PostLoadingTest.page b/tests/FunctionalTests/active-controls/protected/pages/PostLoadingTest.page index 09ab2fbc..0a07c515 100755 --- a/tests/FunctionalTests/active-controls/protected/pages/PostLoadingTest.page +++ b/tests/FunctionalTests/active-controls/protected/pages/PostLoadingTest.page @@ -1,4 +1,4 @@ -<com:TForm>
+<com:TContent ID="Content">
<h1 id="heading">PostLoading Test</h1>
<com:TCallback ID="callback1" OnCallback="Page.callback1_requested" />
@@ -8,17 +8,11 @@ <div id="div1" style="border:1px solid #666; background-color: #ffe; text-align: center; padding:3em">
Click Me!
</div>
-
- <script type="text/javascript">
- Event.OnLoad(function()
- {
- Event.observe($("div1"), "click", function()
- {
- Prado.Callback("<%= $this->callback1->UniqueID %>")
- })
- })
- </script>
-
- <com:TJavascriptLogger />
-
-</com:TForm>
\ No newline at end of file + <com:TClientScript>
+ jQuery( document ).ready(function() {
+ jQuery("#div1").click(function() {
+ Prado.Callback("<%= $this->callback1->UniqueID %>");
+ });
+ });
+ </com:TClientScript>
+</com:TContent>
\ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/protected/pages/RadioButtonListTest.page b/tests/FunctionalTests/active-controls/protected/pages/RadioButtonListTest.page index 7de9c6ab..e1a2cb93 100755 --- a/tests/FunctionalTests/active-controls/protected/pages/RadioButtonListTest.page +++ b/tests/FunctionalTests/active-controls/protected/pages/RadioButtonListTest.page @@ -1,4 +1,4 @@ -<com:TForm>
+<com:TContent ID="Content">
<com:TRequiredFieldValidator
ControlToValidate="rad_button_list"
@@ -6,8 +6,8 @@ Display="Dynamic"
ValidationGroup="Group"
/>
- <br />
- <com:TActiveRadioButtonList
+ <br />
+ <com:TActiveRadioButtonList
ID="rad_button_list"
OnCallback="radChange">
<com:TListItem Value="yes" Text="Yes" />
@@ -16,15 +16,14 @@ </com:TActiveRadioButtonList>
<br />
<com:TActiveLabel
- ID="label"
+ ID="label"
Text="Choice : " />
<br /><br /><br />
<com:TActiveButton
ID="action_button"
Text="action"
OnCallback="action"
- ValidationGroup="Group" />
+ ValidationGroup="Group" />
-<com:TJavascriptLogger />
-</com:TForm>
\ No newline at end of file +</com:TContent>
\ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/protected/pages/RatingList.page b/tests/FunctionalTests/active-controls/protected/pages/RatingList.page index ba9c2e5d..6cb9d34a 100755 --- a/tests/FunctionalTests/active-controls/protected/pages/RatingList.page +++ b/tests/FunctionalTests/active-controls/protected/pages/RatingList.page @@ -1,5 +1,4 @@ -<com:THead/>
-<com:TForm>
+<com:TContent ID="Content">
<style>
.more td
{
@@ -93,6 +92,5 @@ Loading...
</div>
-<com:TJavascriptLogger />
-</com:TForm>
\ No newline at end of file +</com:TContent>
\ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/protected/pages/RepeaterWithActiveControls.page b/tests/FunctionalTests/active-controls/protected/pages/RepeaterWithActiveControls.page index b94fdbfb..52fdea2d 100755 --- a/tests/FunctionalTests/active-controls/protected/pages/RepeaterWithActiveControls.page +++ b/tests/FunctionalTests/active-controls/protected/pages/RepeaterWithActiveControls.page @@ -1,4 +1,4 @@ -<com:TForm>
+<com:TContent ID="Content">
<style>
.textbox
{
@@ -56,6 +56,5 @@ <com:TActiveLabel ID="label1" />
-<com:TJavascriptLogger />
-</com:TForm>
\ No newline at end of file +</com:TContent>
\ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/protected/pages/ReplaceContentTest.page b/tests/FunctionalTests/active-controls/protected/pages/ReplaceContentTest.page index 7842cde9..c946d5fd 100755 --- a/tests/FunctionalTests/active-controls/protected/pages/ReplaceContentTest.page +++ b/tests/FunctionalTests/active-controls/protected/pages/ReplaceContentTest.page @@ -1,4 +1,4 @@ -<com:TForm>
+<com:TContent ID="Content">
<h1>Callback Replace Content Test</h1>
@@ -26,6 +26,5 @@ Main Panel <com:TActiveButton id="btn_replace" Text="Replace" OnCallback="replaceContent"/>
-<com:TJavascriptLogger />
-</com:TForm>
\ No newline at end of file +</com:TContent>
\ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/protected/pages/Sessioned/PageStateTest.page b/tests/FunctionalTests/active-controls/protected/pages/Sessioned/PageStateTest.page index fdd4a604..48d1207f 100755 --- a/tests/FunctionalTests/active-controls/protected/pages/Sessioned/PageStateTest.page +++ b/tests/FunctionalTests/active-controls/protected/pages/Sessioned/PageStateTest.page @@ -1,5 +1,4 @@ -<com:THead />
-<com:TForm>
+<com:TContent ID="Content">
<com:TActiveButton ID="button1"
CustomData="0"
@@ -41,7 +40,4 @@ Loading...
</div>
-
-<com:TJavascriptLogger />
-
-</com:TForm>
\ No newline at end of file +</com:TContent>
\ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/protected/pages/TActiveCheckBoxListTest.page b/tests/FunctionalTests/active-controls/protected/pages/TActiveCheckBoxListTest.page index f3332bad..915092d2 100755 --- a/tests/FunctionalTests/active-controls/protected/pages/TActiveCheckBoxListTest.page +++ b/tests/FunctionalTests/active-controls/protected/pages/TActiveCheckBoxListTest.page @@ -1,4 +1,4 @@ -<com:TForm ID="form1"> +<com:TContent ID="Content"> <h1>TActiveCheckBoxList Test Case</h1> <com:TActiveCheckBoxList ID="list1" OnCallback="list1_callback"> @@ -19,6 +19,4 @@ <com:TActiveButton ID="button5" Text="Select Values 'value 2', 'value 5'" OnClick="select_values_25" /> </div> - <com:TJavascriptLogger /> - -</com:TForm>
\ No newline at end of file +</com:TContent>
\ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/protected/pages/TActiveFileUploadAutoPostBackTest.page b/tests/FunctionalTests/active-controls/protected/pages/TActiveFileUploadAutoPostBackTest.page index 41390e52..e126f34a 100755 --- a/tests/FunctionalTests/active-controls/protected/pages/TActiveFileUploadAutoPostBackTest.page +++ b/tests/FunctionalTests/active-controls/protected/pages/TActiveFileUploadAutoPostBackTest.page @@ -1,14 +1,12 @@ -<com:TForm ID="form1"> +<com:TContent ID="Content"> <h1 id="heading">TActiveFileUpload AutoPostBack Functional Test</h1> <com:TActiveFileUpload ID='uploader' OnFileUpload="uploadComplete" AutoPostBack="false"/> - + <com:TActiveButton ID="button1" Text="Submit File"/> - + <com:TActiveButton ID="button2" Text="This won't submit the file"/> - - <com:TActiveLabel ID="label1" Text="Label 1" /> - <com:TJavascriptLogger /> + <com:TActiveLabel ID="label1" Text="Label 1" /> -</com:TForm>
\ No newline at end of file +</com:TContent>
\ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/protected/pages/TInPlaceTextBoxTest.page b/tests/FunctionalTests/active-controls/protected/pages/TInPlaceTextBoxTest.page index 8c0a0d71..6b0c5109 100755 --- a/tests/FunctionalTests/active-controls/protected/pages/TInPlaceTextBoxTest.page +++ b/tests/FunctionalTests/active-controls/protected/pages/TInPlaceTextBoxTest.page @@ -1,6 +1,5 @@ <%@ Application.Globalization.Charset="UTF-8" %>
-<com:TForm ID="form1">
-
+<com:TContent ID="Content">
<style>
.textbox
{
@@ -61,7 +60,7 @@ <com:TActiveLabel ID="status" Text="Status:" />
- <com:TInPlaceTextBox
+ <com:TInPlaceTextBox
id="lblNewPackageTitle"
OnTextChanged="NewPackageSubject"
CssClass="textbox"
@@ -72,6 +71,4 @@ <com:TActiveButton Text="ad" OnCallback="button_clicked" />
- <com:TJavascriptLogger />
-
-</com:TForm>
\ No newline at end of file +</com:TContent>
\ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/protected/pages/TextBoxValidationCallback.page b/tests/FunctionalTests/active-controls/protected/pages/TextBoxValidationCallback.page index 79fc17e0..b9d2c6f3 100755 --- a/tests/FunctionalTests/active-controls/protected/pages/TextBoxValidationCallback.page +++ b/tests/FunctionalTests/active-controls/protected/pages/TextBoxValidationCallback.page @@ -1,4 +1,4 @@ -<com:TForm>
+<com:TContent ID="Content">
<h1>TextBox AutoPostBack With Group Validation</h1>
<com:TTextBox ID="Address" Columns="60" Maxlength="128" />
<com:TRequiredFieldValidator
@@ -14,8 +14,7 @@ Maxlength="12"
ValidationGroup="post"
OnCallback="lookupZipCode"/>
-<com:TJavascriptLogger />
<com:TActiveTextBox ID="City" Columns="60" Maxlength="128" />
-</com:TForm>
+</com:TContent>
diff --git a/tests/FunctionalTests/active-controls/protected/pages/TimeTriggeredCallbackTest.page b/tests/FunctionalTests/active-controls/protected/pages/TimeTriggeredCallbackTest.page index a285f03d..050f6681 100755 --- a/tests/FunctionalTests/active-controls/protected/pages/TimeTriggeredCallbackTest.page +++ b/tests/FunctionalTests/active-controls/protected/pages/TimeTriggeredCallbackTest.page @@ -1,4 +1,4 @@ -<com:TForm ID="form1"> +<com:TContent ID="Content"> <h1>TTimeTriggeredCallback + ViewState Tests</h1> <com:TActiveButton id="button1" Text="Start Timer" OnCallback="start_timer" /> <com:TActiveButton Text="Stop Timer" OnCallback="stop_timer" /> @@ -17,5 +17,4 @@ position: absolute; right: 0; top: 0"> Loading... </div> - <com:TJavascriptLogger /> -</com:TForm>
\ No newline at end of file +</com:TContent>
\ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/protected/pages/ValueTriggerCallbackTest.page b/tests/FunctionalTests/active-controls/protected/pages/ValueTriggerCallbackTest.page index 1281cc5c..a164afc9 100755 --- a/tests/FunctionalTests/active-controls/protected/pages/ValueTriggerCallbackTest.page +++ b/tests/FunctionalTests/active-controls/protected/pages/ValueTriggerCallbackTest.page @@ -1,4 +1,4 @@ -<com:TForm>
+<com:TContent ID="Content">
<h1>Value Trigger Callback Test</h1>
<com:TTextBox ID="text1" />
@@ -9,6 +9,4 @@ <com:TActiveLabel ID="label1" Text="Label 1" />
-<com:TJavascriptLogger />
-
-</com:TForm>
\ No newline at end of file +</com:TContent>
\ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/protected/pages/config.xml b/tests/FunctionalTests/active-controls/protected/pages/config.xml new file mode 100755 index 00000000..05909075 --- /dev/null +++ b/tests/FunctionalTests/active-controls/protected/pages/config.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> + +<configuration> + <pages MasterClass="Application.pages.Layout" /> +</configuration>
\ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/tests/ActiveButtonTestCase.php b/tests/FunctionalTests/active-controls/tests/ActiveButtonTestCase.php index c8fcfa57..acbdbb2a 100755 --- a/tests/FunctionalTests/active-controls/tests/ActiveButtonTestCase.php +++ b/tests/FunctionalTests/active-controls/tests/ActiveButtonTestCase.php @@ -1,14 +1,15 @@ <?php -class ActiveButtonTestCase extends PradoGenericSeleniumTest +class ActiveButtonTestCase extends PradoGenericSelenium2Test { function test() { - $this->open("active-controls/index.php?page=ActiveButtonTest"); - $this->verifyTextPresent("TActiveButton Functional Test"); - $this->assertText("label1", "Label 1"); - $this->click("button2"); + $base='ctl0_Content_'; + $this->url("active-controls/index.php?page=ActiveButtonTest"); + $this->assertContains("TActiveButton Functional Test", $this->source()); + $this->assertText("{$base}label1", "Label 1"); + $this->clickOnElement("{$base}button2"); $this->pause(800); - $this->assertText("label1", "Button 1 was clicked using callback!"); + $this->assertText("{$base}label1", "Button 1 was clicked using callback!"); } } diff --git a/tests/FunctionalTests/active-controls/tests/ActiveCheckBoxListTestCase.php b/tests/FunctionalTests/active-controls/tests/ActiveCheckBoxListTestCase.php index 312b8443..c032c084 100755 --- a/tests/FunctionalTests/active-controls/tests/ActiveCheckBoxListTestCase.php +++ b/tests/FunctionalTests/active-controls/tests/ActiveCheckBoxListTestCase.php @@ -1,55 +1,57 @@ <?php -class ActiveCheckBoxListTestCase extends PradoGenericSeleniumTest +class ActiveCheckBoxListTestCase extends PradoGenericSelenium2Test { function test() { - $this->open("active-controls/index.php?page=TActiveCheckBoxListTest"); - $this->verifyTextPresent("TActiveCheckBoxList Test Case"); + $base='ctl0_Content_'; + $this->url("active-controls/index.php?page=TActiveCheckBoxListTest"); + $this->assertContains("TActiveCheckBoxList Test Case", $this->source()); - $this->assertText("label1", "Label 1"); + $this->assertText("{$base}label1", "Label 1"); - $this->click("button1"); + $this->byId("{$base}button1")->click(); $this->pause(800); $this->assertCheckBoxes(array(1,2,3)); - $this->click("button2"); + $this->byId("{$base}button2")->click(); $this->pause(800); $this->assertCheckBoxes(array()); - $this->click("button3"); + $this->byId("{$base}button3")->click(); $this->pause(800); $this->assertCheckBoxes(array(0)); - $this->click("button4"); + $this->byId("{$base}button4")->click(); $this->pause(800); $this->assertCheckBoxes(array(4)); - $this->click("button5"); + $this->byId("{$base}button5")->click(); $this->pause(800); $this->assertCheckBoxes(array(1,4)); - $this->click("list1_c2"); + $this->byId("{$base}list1_c2")->click(); $this->pause(800); - $this->assertText("label1", "Selection: value 2, value 3, value 5"); + $this->assertText("{$base}label1", "Selection: value 2, value 3, value 5"); - $this->click("list1_c2"); + $this->byId("{$base}list1_c2")->click(); $this->pause(800); - $this->assertText("label1", "Selection: value 2, value 5"); + $this->assertText("{$base}label1", "Selection: value 2, value 5"); } function assertCheckBoxes($checks, $total = 5) { + $base='ctl0_Content_'; for($i = 0; $i < $total; $i++) { if(in_array($i, $checks)) - $this->assertChecked("list1_c{$i}"); + $this->assertTrue($this->byId("{$base}list1_c{$i}")->selected()); else - $this->assertNotChecked("list1_c{$i}"); + $this->assertFalse($this->byId("{$base}list1_c{$i}")->selected()); } } } diff --git a/tests/FunctionalTests/active-controls/tests/ActiveCheckBoxTestCase.php b/tests/FunctionalTests/active-controls/tests/ActiveCheckBoxTestCase.php index 6f235273..782b35be 100755 --- a/tests/FunctionalTests/active-controls/tests/ActiveCheckBoxTestCase.php +++ b/tests/FunctionalTests/active-controls/tests/ActiveCheckBoxTestCase.php @@ -1,59 +1,60 @@ <?php -class ActiveCheckBoxTestCase extends PradoGenericSeleniumTest +class ActiveCheckBoxTestCase extends PradoGenericSelenium2Test { function test() { - $this->open("active-controls/index.php?page=ActiveCheckBoxTest"); - $this->verifyTextPresent("Active CheckBox Test"); + $base='ctl0_Content_'; + $this->url("active-controls/index.php?page=ActiveCheckBoxTest"); + $this->assertContains("Active CheckBox Test", $this->source()); - $this->assertText("checkbox1_label", "CheckBox 1"); - $this->assertText("checkbox2_label", "CheckBox 2"); - $this->assertText('label1', 'Label 1'); + $this->assertText("{$base}checkbox1_label", "CheckBox 1"); + $this->assertText("{$base}checkbox2_label", "CheckBox 2"); + $this->assertText("{$base}label1", 'Label 1'); - $this->click("change_text1"); + $this->byId("{$base}change_text1")->click(); $this->pause(800); - $this->assertText('checkbox1_label', 'Hello CheckBox 1'); + $this->assertText("{$base}checkbox1_label", 'Hello CheckBox 1'); - $this->click("change_text2"); + $this->byId("{$base}change_text2")->click(); $this->pause(800); - $this->assertText('checkbox2_label', 'CheckBox 2 World'); + $this->assertText("{$base}checkbox2_label", 'CheckBox 2 World'); //check box 1 - $this->click('change_checked1'); + $this->byId("{$base}change_checked1")->click(); $this->pause(800); - $this->assertChecked('checkbox1'); + $this->assertTrue($this->byId("{$base}checkbox1")->selected()); - $this->click('change_checked1'); + $this->byId("{$base}change_checked1")->click(); $this->pause(800); - $this->assertNotChecked('checkbox1'); + $this->assertFalse($this->byId("{$base}checkbox1")->selected()); //check box 2 - $this->click('change_checked2'); + $this->byId("{$base}change_checked2")->click(); $this->pause(800); - $this->assertChecked('checkbox2'); + $this->assertTrue($this->byId("{$base}checkbox2")->selected()); - $this->click('change_checked2'); + $this->byId("{$base}change_checked2")->click(); $this->pause(800); - $this->assertNotChecked('checkbox2'); + $this->assertFalse($this->byId("{$base}checkbox2")->selected()); //click checkbox 1 - $this->click("checkbox1"); + $this->byId("{$base}checkbox1")->click(); $this->pause(800); - $this->assertText("label1", "Label 1:Hello CheckBox 1 Checked"); + $this->assertText("{$base}label1", "Label 1:Hello CheckBox 1 Checked"); - $this->click("checkbox1"); + $this->byId("{$base}checkbox1")->click(); $this->pause(800); - $this->assertText("label1", "Label 1:Hello CheckBox 1 Not Checked"); + $this->assertText("{$base}label1", "Label 1:Hello CheckBox 1 Not Checked"); //click checkbox 2 - $this->click("checkbox2"); + $this->byId("{$base}checkbox2")->click(); $this->pause(800); - $this->assertText("label1", "Label 1:CheckBox 2 World Checked"); + $this->assertText("{$base}label1", "Label 1:CheckBox 2 World Checked"); - $this->click("checkbox2"); + $this->byId("{$base}checkbox2")->click(); $this->pause(800); - $this->assertText("label1", "Label 1:CheckBox 2 World Not Checked"); + $this->assertText("{$base}label1", "Label 1:CheckBox 2 World Not Checked"); } } diff --git a/tests/FunctionalTests/active-controls/tests/ActiveControlExpressTagTestCase.php b/tests/FunctionalTests/active-controls/tests/ActiveControlExpressTagTestCase.php index 75b86e19..c41988cc 100755 --- a/tests/FunctionalTests/active-controls/tests/ActiveControlExpressTagTestCase.php +++ b/tests/FunctionalTests/active-controls/tests/ActiveControlExpressTagTestCase.php @@ -1,18 +1,19 @@ <?php -class ActiveControlExpressionTagTestCase extends PradoGenericSeleniumTest +class ActiveControlExpressionTagTestCase extends PradoGenericSelenium2Test { function test() { - $this->open('active-controls/index.php?page=ActiveControlExpressionTag'); - $this->assertTextPresent('Active Control With Expression Tag Test'); - $this->assertTextNotPresent('Text box content:'); + $base='ctl0_Content_'; + $this->url('active-controls/index.php?page=ActiveControlExpressionTag'); + $this->assertContains('Active Control With Expression Tag Test', $this->source()); + $this->assertNotContains('Text box content:', $this->source()); - $this->type('textbox1', 'Hello world'); - $this->click('button1'); + $this->type("{$base}textbox1", 'Hello world'); + $this->byId("{$base}button1")->click(); $this->pause(800); - $this->assertText('repeats', 'result - 1 result - two'); - $this->assertText('contents', 'Text box content: Hello world'); + $this->assertText("repeats", 'result - 1 result - two'); + $this->assertText("contents", 'Text box content: Hello world'); } } diff --git a/tests/FunctionalTests/active-controls/tests/ActiveDatePickerTestCase.php b/tests/FunctionalTests/active-controls/tests/ActiveDatePickerTestCase.php index be0a6fb4..570a6717 100755 --- a/tests/FunctionalTests/active-controls/tests/ActiveDatePickerTestCase.php +++ b/tests/FunctionalTests/active-controls/tests/ActiveDatePickerTestCase.php @@ -1,118 +1,119 @@ <?php -class ActiveDatePickerTestCase extends PradoGenericSeleniumTest +class ActiveDatePickerTestCase extends PradoGenericSelenium2Test { function test() { - $this->open("active-controls/index.php?page=ActiveDatePicker"); - $this->verifyTextPresent("TActiveDatePicker test"); - $this->verifyText("status", ""); - $this->verifyValue("datepicker", date('m-d-Y')); - $this->click("increaseButton"); - $this->pause(800); - $this->verifyValue("datepicker", date('m-d-Y', strtotime('+ 1 day'))); - $this->verifyText("status", date('m-d-Y', strtotime('+ 1 day'))); - $this->click("increaseButton"); - $this->pause(800); - $this->verifyValue("datepicker", date('m-d-Y', strtotime('+ 2 day'))); - $this->verifyText("status", date('m-d-Y', strtotime('+ 2 day'))); - $this->click("todayButton"); - $this->pause(800); - $this->verifyValue("datepicker", date('m-d-Y')); - $this->verifyText("status", date('m-d-Y')); - $this->click("decreaseButton"); - $this->pause(800); - $this->verifyValue("datepicker", date('m-d-Y', strtotime('- 1 day'))); - $this->verifyText("status", date('m-d-Y', strtotime('- 1 day'))); - $this->click("datepicker"); - $this->pause(800); - $this->click("css=input.todayButton"); - $this->pause(800); - $this->verifyValue("datepicker", date('m-d-Y')); - $this->verifyText("status", date('m-d-Y')); - $this->click("css=input.nextMonthButton"); - $this->pause(800); - $this->verifyValue("datepicker", date('m-d-Y', strtotime('+ 1 month'))); - $this->verifyText("status", date('m-d-Y', strtotime('+1 month'))); - - $this->click('toggleButton'); + $base='ctl0_Content_'; + $this->url("active-controls/index.php?page=ActiveDatePicker"); + $this->assertContains("TActiveDatePicker test", $this->source()); + $this->assertText("{$base}status", ""); + $this->assertValue("{$base}datepicker", date('m-d-Y')); + $this->byId("{$base}increaseButton")->click(); + $this->pause(800); + $this->assertValue("{$base}datepicker", date('m-d-Y', strtotime('+ 1 day'))); + $this->assertText("{$base}status", date('m-d-Y', strtotime('+ 1 day'))); + $this->byId("{$base}increaseButton")->click(); + $this->pause(800); + $this->assertValue("{$base}datepicker", date('m-d-Y', strtotime('+ 2 day'))); + $this->assertText("{$base}status", date('m-d-Y', strtotime('+ 2 day'))); + $this->byId("{$base}todayButton")->click(); + $this->pause(800); + $this->assertValue("{$base}datepicker", date('m-d-Y')); + $this->assertText("{$base}status", date('m-d-Y')); + $this->byId("{$base}decreaseButton")->click(); + $this->pause(800); + $this->assertValue("{$base}datepicker", date('m-d-Y', strtotime('- 1 day'))); + $this->assertText("{$base}status", date('m-d-Y', strtotime('- 1 day'))); + $this->byId("{$base}datepicker")->click(); + $this->pause(800); + $this->byCssSelector("input.todayButton")->click(); + $this->pause(800); + $this->assertValue("{$base}datepicker", date('m-d-Y')); + $this->assertText("{$base}status", date('m-d-Y')); + $this->byCssSelector("input.nextMonthButton")->click(); + $this->pause(800); + $this->assertValue("{$base}datepicker", date('m-d-Y', strtotime('+ 1 month'))); + $this->assertText("{$base}status", date('m-d-Y', strtotime('+1 month'))); + + $this->byId("{$base}toggleButton")->click(); $this->pause(2000); - - $this->click("todayButton"); + + $this->byId("{$base}todayButton")->click(); $this->pause(800); - $this->assertSelected("datepicker_month", date('m')); - $this->verifyText("status", date('m-d-Y')); - - $this->click("increaseButton"); + $this->assertSelected("{$base}datepicker_month", date('m')); + $this->assertText("{$base}status", date('m-d-Y')); + + $this->byId("{$base}increaseButton")->click(); $this->pause(800); $dateToCheck=strtotime('+ 1 day'); - $this->assertSelected("datepicker_month", date('m', $dateToCheck)); - $this->assertSelected("datepicker_day", date('d', $dateToCheck)); - $this->assertSelected("datepicker_year", date('Y', $dateToCheck)); - $this->verifyText("status", date('m-d-Y', $dateToCheck)); - - $this->click("increaseButton"); + $this->assertSelected("{$base}datepicker_month", date('m', $dateToCheck)); + $this->assertSelected("{$base}datepicker_day", date('d', $dateToCheck)); + $this->assertSelected("{$base}datepicker_year", date('Y', $dateToCheck)); + $this->assertText("{$base}status", date('m-d-Y', $dateToCheck)); + + $this->byId("{$base}increaseButton")->click(); $this->pause(800); $dateToCheck=strtotime('+ 2 day'); - $this->assertSelected("datepicker_month", date('m', $dateToCheck)); - $this->assertSelected("datepicker_day", date('d', $dateToCheck)); - $this->assertSelected("datepicker_year", date('Y', $dateToCheck)); - $this->verifyText("status", date('m-d-Y', $dateToCheck)); - - $this->click("todayButton"); + $this->assertSelected("{$base}datepicker_month", date('m', $dateToCheck)); + $this->assertSelected("{$base}datepicker_day", date('d', $dateToCheck)); + $this->assertSelected("{$base}datepicker_year", date('Y', $dateToCheck)); + $this->assertText("{$base}status", date('m-d-Y', $dateToCheck)); + + $this->byId("{$base}todayButton")->click(); $this->pause(800); $dateToCheck=time(); - $this->assertSelected("datepicker_month", date('m', $dateToCheck)); - $this->assertSelected("datepicker_day", date('d', $dateToCheck)); - $this->assertSelected("datepicker_year", date('Y', $dateToCheck)); - $this->verifyText("status", date('m-d-Y', $dateToCheck)); - - $this->click("decreaseButton"); + $this->assertSelected("{$base}datepicker_month", date('m', $dateToCheck)); + $this->assertSelected("{$base}datepicker_day", date('d', $dateToCheck)); + $this->assertSelected("{$base}datepicker_year", date('Y', $dateToCheck)); + $this->assertText("{$base}status", date('m-d-Y', $dateToCheck)); + + $this->byId("{$base}decreaseButton")->click(); $this->pause(800); $dateToCheck=strtotime('- 1 day'); - $this->assertSelected("datepicker_month", date('m', $dateToCheck)); - $this->assertSelected("datepicker_day", date('d', $dateToCheck)); - $this->assertSelected("datepicker_year", date('Y', $dateToCheck)); - $this->verifyText("status", date('m-d-Y', $dateToCheck)); - - $this->click("datepickerbutton"); + $this->assertSelected("{$base}datepicker_month", date('m', $dateToCheck)); + $this->assertSelected("{$base}datepicker_day", date('d', $dateToCheck)); + $this->assertSelected("{$base}datepicker_year", date('Y', $dateToCheck)); + $this->assertText("{$base}status", date('m-d-Y', $dateToCheck)); + + $this->byId("{$base}datepickerbutton")->click(); $this->pause(800); - $this->click("css=input.todayButton"); + $this->byCssSelector("input.todayButton")->click(); $this->pause(800); $dateToCheck=time(); - $this->assertSelected("datepicker_month", date('m', $dateToCheck)); - $this->assertSelected("datepicker_day", date('d', $dateToCheck)); - $this->assertSelected("datepicker_year", date('Y', $dateToCheck)); - $this->verifyText("status", date('m-d-Y', $dateToCheck)); - - $this->click("css=input.nextMonthButton"); + $this->assertSelected("{$base}datepicker_month", date('m', $dateToCheck)); + $this->assertSelected("{$base}datepicker_day", date('d', $dateToCheck)); + $this->assertSelected("{$base}datepicker_year", date('Y', $dateToCheck)); + $this->assertText("{$base}status", date('m-d-Y', $dateToCheck)); + + $this->byCssSelector("input.nextMonthButton")->click(); $this->pause(800); $dateToCheck=strtotime('+ 1 month'); - $this->assertSelected("datepicker_month", date('m', $dateToCheck)); - $this->assertSelected("datepicker_day", date('d', $dateToCheck)); - $this->assertSelected("datepicker_year", date('Y', $dateToCheck)); - $this->verifyText("status", date('m-d-Y', $dateToCheck)); - - $this->click('ctl1'); - $this->pause(800); - - $this->verifyText("status2", ""); + $this->assertSelected("{$base}datepicker_month", date('m', $dateToCheck)); + $this->assertSelected("{$base}datepicker_day", date('d', $dateToCheck)); + $this->assertSelected("{$base}datepicker_year", date('Y', $dateToCheck)); + $this->assertText("{$base}status", date('m-d-Y', $dateToCheck)); + + $this->byId('ctl0_ctl1')->click(); + $this->pause(800); + + $this->assertText("{$base}status2", ""); $dateToCheck=time(); - $this->assertSelected("datepicker2_month", date('m', $dateToCheck)); - $this->assertSelected("datepicker2_day", date('d', $dateToCheck)); - $this->assertSelected("datepicker2_year", date('Y', $dateToCheck)); - $this->select("datepicker2_year", date('Y')+1); + $this->assertSelected("{$base}datepicker2_month", date('m', $dateToCheck)); + $this->assertSelected("{$base}datepicker2_day", date('d', $dateToCheck)); + $this->assertSelected("{$base}datepicker2_year", date('Y', $dateToCheck)); + $this->select("{$base}datepicker2_year", date('Y')+1); $this->pause(800); $dateToCheck=mktime(0,0,0,(int)date('m'),(int)date('d'), date('Y')+1); - $this->verifyText("status2", date('m-d-Y', $dateToCheck)); + $this->assertText("{$base}status2", date('m-d-Y', $dateToCheck)); - $this->verifyText("status3", ""); + $this->assertText("{$base}status3", ""); $dateToCheck=time(); - $this->assertSelected("datepicker3_month", date('F', $dateToCheck)); - $this->assertSelected("datepicker3_year", date('Y', $dateToCheck)); - $this->select("datepicker3_year", date('Y')+1); + $this->assertSelected("{$base}datepicker3_month", date('F', $dateToCheck)); + $this->assertSelected("{$base}datepicker3_year", date('Y', $dateToCheck)); + $this->select("{$base}datepicker3_year", date('Y')+1); $this->pause(800); $dateToCheck=mktime(0,0,0,(int)date('m'),(int)date('d'), date('Y')+1); - $this->verifyText("status3", date('m/Y', $dateToCheck)); + $this->assertText("{$base}status3", date('m/Y', $dateToCheck)); } } diff --git a/tests/FunctionalTests/active-controls/tests/ActiveDropDownListTestCase.php b/tests/FunctionalTests/active-controls/tests/ActiveDropDownListTestCase.php index a54cbd75..cb8c953f 100755 --- a/tests/FunctionalTests/active-controls/tests/ActiveDropDownListTestCase.php +++ b/tests/FunctionalTests/active-controls/tests/ActiveDropDownListTestCase.php @@ -1,45 +1,46 @@ <?php -class ActiveDropDownListTestCase extends PradoGenericSeleniumTest +class ActiveDropDownListTestCase extends PradoGenericSelenium2Test { function test() { - $this->open("active-controls/index.php?page=ActiveDropDownList"); - $this->assertTextPresent('Active Drop Down List Test Case'); + $base='ctl0_Content_'; + $this->url("active-controls/index.php?page=ActiveDropDownList"); + $this->assertContains('Active Drop Down List Test Case', $this->source()); - $this->assertText("label1", "Label 1"); + $this->assertText("{$base}label1", "Label 1"); - $this->click("button1"); + $this->byId("{$base}button1")->click(); $this->pause(800); - $this->assertSelected("list1", "item 4"); + $this->assertSelected("{$base}list1", "item 4"); - $this->click("button2"); + $this->byId("{$base}button2")->click(); $this->pause(800); - $this->assertSelectedIndex("list1", 0); + $this->assertSelectedValue("{$base}list1", 'value 1'); - $this->click("button3"); + $this->byId("{$base}button3")->click(); $this->pause(800); - $this->assertSelected("list1", "item 2"); + $this->assertSelected("{$base}list1", "item 2"); - $this->assertText("label1", "Selection 1: value 1"); + $this->assertText("{$base}label1", "Selection 1: value 1"); - $this->select("list1", "item 1"); + $this->select("{$base}list1", "item 1"); $this->pause(800); - $this->select("list2", "value 1 - item 4"); + $this->select("{$base}list2", "value 1 - item 4"); $this->pause(800); - $this->assertText("label2", "Selection 2: value 1 - item 4"); + $this->assertText("{$base}label2", "Selection 2: value 1 - item 4"); - $this->select("list1", "item 3"); + $this->select("{$base}list1", "item 3"); $this->pause(800); - $this->select("list2", "value 3 - item 5"); + $this->select("{$base}list2", "value 3 - item 5"); $this->pause(800); - $this->assertText("label2", "Selection 2: value 3 - item 5"); + $this->assertText("{$base}label2", "Selection 2: value 3 - item 5"); - $this->click('button4'); + $this->byId("{$base}button4")->click(); $this->pause(800); - $this->assertSelected('list1', 'item 3'); + $this->assertSelected("{$base}list1", 'item 3'); $this->pause(300); - $this->assertSelected('list2', 'value 3 - item 3'); + $this->assertSelected("{$base}list2", 'value 3 - item 3'); } } diff --git a/tests/FunctionalTests/active-controls/tests/ActiveHiddenFieldTestCase.php b/tests/FunctionalTests/active-controls/tests/ActiveHiddenFieldTestCase.php index b8c02868..d4b82068 100755 --- a/tests/FunctionalTests/active-controls/tests/ActiveHiddenFieldTestCase.php +++ b/tests/FunctionalTests/active-controls/tests/ActiveHiddenFieldTestCase.php @@ -1,22 +1,23 @@ <?php -class ActiveHiddenFieldTestCase extends PradoGenericSeleniumTest +class ActiveHiddenFieldTestCase extends PradoGenericSelenium2Test { function test() { - $this->open("active-controls/index.php?page=ActiveHiddenFieldTest"); + $base='ctl0_Content_'; + $this->url("active-controls/index.php?page=ActiveHiddenFieldTest"); $fieldEmpty = 'No longer empty'; $fieldUsed = 'My value'; - - $this->verifyTextPresent('Value of current hidden field'); - $this->click('Button1'); + + $this->assertContains('Value of current hidden field', $this->source()); + $this->byId("{$base}Button1")->click(); $this->pause(800); - $this->assertText('ResponseLabel', $fieldEmpty); - $this->click('Button2'); + $this->assertText("{$base}ResponseLabel", $fieldEmpty); + $this->byId("{$base}Button2")->click(); $this->pause(800); - $this->assertText('ResponseLabel', $fieldUsed); - $this->click('Button3'); + $this->assertText("{$base}ResponseLabel", $fieldUsed); + $this->byId("{$base}Button3")->click(); $this->pause(800); - $this->assertText('ResponseLabel', $fieldEmpty.'|'.$fieldUsed); + $this->assertText("{$base}ResponseLabel", $fieldEmpty.'|'.$fieldUsed); } } diff --git a/tests/FunctionalTests/active-controls/tests/ActiveHyperLinkTestCase.php b/tests/FunctionalTests/active-controls/tests/ActiveHyperLinkTestCase.php index bfcdd206..6329d826 100755 --- a/tests/FunctionalTests/active-controls/tests/ActiveHyperLinkTestCase.php +++ b/tests/FunctionalTests/active-controls/tests/ActiveHyperLinkTestCase.php @@ -1,16 +1,17 @@ <?php -class ActiveHyperLinkTestCase extends PradoGenericSeleniumTest +class ActiveHyperLinkTestCase extends PradoGenericSelenium2Test { function test() { - $this->open("active-controls/index.php?page=ActiveHyperLinkTest"); - $this->assertTextPresent("Active HyperLink Test Case"); + $base='ctl0_Content_'; + $this->url("active-controls/index.php?page=ActiveHyperLinkTest"); + $this->assertContains("Active HyperLink Test Case", $this->source()); - $this->assertText("link1", "Link 1"); + $this->assertText("{$base}link1", "Link 1"); - $this->click("button1"); + $this->byId("{$base}button1")->click(); $this->pause(800); - $this->assertText("link1", "Pradosoft.com"); + $this->assertText("{$base}link1", "Pradosoft.com"); } } diff --git a/tests/FunctionalTests/active-controls/tests/ActiveImageButtonTestCase.php b/tests/FunctionalTests/active-controls/tests/ActiveImageButtonTestCase.php index 2989ab27..0ef2e082 100755 --- a/tests/FunctionalTests/active-controls/tests/ActiveImageButtonTestCase.php +++ b/tests/FunctionalTests/active-controls/tests/ActiveImageButtonTestCase.php @@ -1,15 +1,16 @@ <?php -class ActiveImageButtonTestCase extends PradoGenericSeleniumTest +class ActiveImageButtonTestCase extends PradoGenericSelenium2Test { function test() { - $this->open("active-controls/index.php?page=ActiveImageButtonTest"); - $this->assertTextPresent("TActiveImageButton Functional Test"); - $this->assertText("label1", "Label 1"); - $this->click("image1"); + $base='ctl0_Content_'; + $this->url("active-controls/index.php?page=ActiveImageButtonTest"); + $this->assertContains("TActiveImageButton Functional Test", $this->source()); + $this->assertText("{$base}label1", "Label 1"); + $this->byId("{$base}image1")->click(); $this->pause(800); //unable to determine mouse position - $this->assertTextPresent("regexp:Image clicked at x=\d+, y=\d+"); + $this->assertRegExp('/Image clicked at x=\d+, y=\d+/', $this->source()); } } diff --git a/tests/FunctionalTests/active-controls/tests/ActiveLinkButtonTestCase.php b/tests/FunctionalTests/active-controls/tests/ActiveLinkButtonTestCase.php index 88cdf15e..1f7c40ea 100755 --- a/tests/FunctionalTests/active-controls/tests/ActiveLinkButtonTestCase.php +++ b/tests/FunctionalTests/active-controls/tests/ActiveLinkButtonTestCase.php @@ -1,14 +1,15 @@ <?php -class ActiveLinkButtonTestCase extends PradoGenericSeleniumTest +class ActiveLinkButtonTestCase extends PradoGenericSelenium2Test { function test() { - $this->open("active-controls/index.php?page=ActiveLinkButtonTest"); - $this->verifyTextPresent("TActiveLinkButton Functional Test"); - $this->assertText("label1", "Label 1"); - $this->click("button2"); + $base='ctl0_Content_'; + $this->url("active-controls/index.php?page=ActiveLinkButtonTest"); + $this->assertContains("TActiveLinkButton Functional Test", $this->source()); + $this->assertText("{$base}label1", "Label 1"); + $this->byId("{$base}button2")->click(); $this->pause(800); - $this->assertText("label1", "Button 1 was clicked using callback!"); + $this->assertText("{$base}label1", "Button 1 was clicked using callback!"); } } diff --git a/tests/FunctionalTests/active-controls/tests/ActiveListBoxMasterTestCase.php b/tests/FunctionalTests/active-controls/tests/ActiveListBoxMasterTestCase.php index 911e3cc7..be2bf174 100755 --- a/tests/FunctionalTests/active-controls/tests/ActiveListBoxMasterTestCase.php +++ b/tests/FunctionalTests/active-controls/tests/ActiveListBoxMasterTestCase.php @@ -1,48 +1,48 @@ <?php -class ActiveListBoxMasterTestCase extends PradoGenericSeleniumTest +class ActiveListBoxMasterTestCase extends PradoGenericSelenium2Test { function test() { - $this->open("active-controls/index.php?page=ActiveListBoxMasterTest"); - $this->assertTextPresent('Active List Box Functional Test'); + $this->url("active-controls/index.php?page=ActiveListBoxMasterTest"); + $this->assertContains('Active List Box Functional Test', $this->source()); $base = 'ctl0_body_'; - $this->assertText($base."label1", "Label 1"); + $this->assertText("{$base}label1", "Label 1"); - $this->click($base."button1"); + $this->byId("{$base}button1")->click(); $this->pause(800); - $this->assertEquals($this->getSelectedLabels($base.'list1'), array('item 2', 'item 3', 'item 4')); + $this->assertEquals($this->getSelectedLabels("{$base}list1"), array('item 2', 'item 3', 'item 4')); - $this->click($base.'button3'); + $this->byId("{$base}button3")->click(); $this->pause(800); - $this->assertEquals($this->getSelectedLabels($base.'list1'), array('item 1')); + $this->assertEquals($this->getSelectedLabels("{$base}list1"), array('item 1')); - $this->click($base.'button4'); + $this->byId("{$base}button4")->click(); $this->pause(800); - $this->assertEquals($this->getSelectedLabels($base.'list1'), array('item 5')); + $this->assertEquals($this->getSelectedLabels("{$base}list1"), array('item 5')); - $this->click($base.'button5'); + $this->byId("{$base}button5")->click(); $this->pause(800); - $this->assertEquals($this->getSelectedLabels($base.'list1'), array('item 2', 'item 5')); + $this->assertEquals($this->getSelectedLabels("{$base}list1"), array('item 2', 'item 5')); - $this->click($base.'button2'); + $this->byId("{$base}button2")->click(); $this->pause(800); - $this->assertNotSomethingSelected($base."list1"); + $this->assertNotSomethingSelected("{$base}list1"); - $this->click($base.'button6'); + $this->byId("{$base}button6")->click(); $this->pause(800); - $this->click($base."button1"); + $this->byId("{$base}button1")->click(); $this->pause(800); - $this->assertEquals($this->getSelectedLabels($base.'list1'), array('item 2', 'item 3', 'item 4')); + $this->assertEquals($this->getSelectedLabels("{$base}list1"), array('item 2', 'item 3', 'item 4')); - $this->select($base."list1", "item 1"); + $this->select("{$base}list1", "item 1"); $this->pause(800); - $this->assertText($base.'label1', 'Selection: value 1'); + $this->assertText("{$base}label1", 'Selection: value 1'); - $this->addSelection($base."list1", "item 4"); + $this->addSelection("{$base}list1", "item 4"); $this->pause(800); - $this->assertText($base.'label1', 'Selection: value 1, value 4'); + $this->assertText("{$base}label1", 'Selection: value 1, value 4'); } }
\ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/tests/ActiveListBoxTestCase.php b/tests/FunctionalTests/active-controls/tests/ActiveListBoxTestCase.php index d45cb42c..1830f5ab 100755 --- a/tests/FunctionalTests/active-controls/tests/ActiveListBoxTestCase.php +++ b/tests/FunctionalTests/active-controls/tests/ActiveListBoxTestCase.php @@ -1,46 +1,47 @@ <?php -class ActiveListBoxTestCase extends PradoGenericSeleniumTest +class ActiveListBoxTestCase extends PradoGenericSelenium2Test { function test() { - $this->open("active-controls/index.php?page=ActiveListBoxTest"); - $this->assertTextPresent('Active List Box Functional Test'); + $base='ctl0_Content_'; + $this->url("active-controls/index.php?page=ActiveListBoxTest"); + $this->assertContains('Active List Box Functional Test', $this->source()); - $this->assertText("label1", "Label 1"); + $this->assertText("{$base}label1", "Label 1"); - $this->click("button1"); + $this->byId("{$base}button1")->click(); $this->pause(800); - $this->assertEquals($this->getSelectedLabels('list1'), array('item 2', 'item 3', 'item 4')); + $this->assertEquals($this->getSelectedLabels("{$base}list1"), array('item 2', 'item 3', 'item 4')); - $this->click('button3'); + $this->byId("{$base}button3")->click(); $this->pause(800); - $this->assertEquals($this->getSelectedLabels('list1'), array('item 1')); + $this->assertEquals($this->getSelectedLabels("{$base}list1"), array('item 1')); - $this->click('button4'); + $this->byId("{$base}button4")->click(); $this->pause(800); - $this->assertEquals($this->getSelectedLabels('list1'), array('item 5')); + $this->assertEquals($this->getSelectedLabels("{$base}list1"), array('item 5')); - $this->click('button5'); + $this->byId("{$base}button5")->click(); $this->pause(800); - $this->assertEquals($this->getSelectedLabels('list1'), array('item 2', 'item 5')); + $this->assertEquals($this->getSelectedLabels("{$base}list1"), array('item 2', 'item 5')); - $this->click('button2'); + $this->byId("{$base}button2")->click(); $this->pause(800); - $this->assertNotSomethingSelected("list1"); + $this->assertNotSomethingSelected("{$base}list1"); - $this->click('button6'); + $this->byId("{$base}button6")->click(); $this->pause(800); - $this->click("button1"); + $this->byId("{$base}button1")->click(); $this->pause(800); - $this->assertEquals($this->getSelectedLabels('list1'), array('item 2', 'item 3', 'item 4')); + $this->assertEquals($this->getSelectedLabels("{$base}list1"), array('item 2', 'item 3', 'item 4')); - $this->select("list1", "item 1"); + $this->select("{$base}list1", "item 1"); $this->pause(800); - $this->assertText('label1', 'Selection: value 1'); + $this->assertText("{$base}label1", 'Selection: value 1'); - $this->addSelection("list1", "item 4"); + $this->addSelection("{$base}list1", "item 4"); $this->pause(800); - $this->assertText('label1', 'Selection: value 1, value 4'); + $this->assertText("{$base}label1", 'Selection: value 1, value 4'); } }
\ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/tests/ActivePanelTestCase.php b/tests/FunctionalTests/active-controls/tests/ActivePanelTestCase.php index 9b069a14..73ab3ad0 100755 --- a/tests/FunctionalTests/active-controls/tests/ActivePanelTestCase.php +++ b/tests/FunctionalTests/active-controls/tests/ActivePanelTestCase.php @@ -1,14 +1,15 @@ <?php -class ActivePanelTestCase extends PradoGenericSeleniumTest +class ActivePanelTestCase extends PradoGenericSelenium2Test { function test() { - $this->open("active-controls/index.php?page=ActivePanelTest"); - $this->verifyTextPresent("Active Panel replacement tests"); - $this->assertTextNotPresent('Something lalala'); - $this->click("div1"); + $base='ctl0_Content_'; + $this->url("active-controls/index.php?page=ActivePanelTest"); + $this->assertContains("Active Panel replacement tests", $this->source()); + $this->assertNotContains('Something lalala', $this->source()); + $this->byId("div1")->click(); $this->pause(800); - $this->assertTextPresent("Something lalala"); + $this->assertContains("Something lalala", $this->source()); } } diff --git a/tests/FunctionalTests/active-controls/tests/ActiveRadioButtonListTestCase.php b/tests/FunctionalTests/active-controls/tests/ActiveRadioButtonListTestCase.php index b0942ffa..82408732 100755 --- a/tests/FunctionalTests/active-controls/tests/ActiveRadioButtonListTestCase.php +++ b/tests/FunctionalTests/active-controls/tests/ActiveRadioButtonListTestCase.php @@ -1,45 +1,47 @@ <?php -class ActiveRadioButtonListTestCase extends PradoGenericSeleniumTest +class ActiveRadioButtonListTestCase extends PradoGenericSelenium2Test { function test() { - $this->open("active-controls/index.php?page=ActiveRadioButtonListTest"); - $this->verifyTextPresent("TActiveRadioButtonList Test Case"); + $base='ctl0_Content_'; + $this->url("active-controls/index.php?page=ActiveRadioButtonListTest"); + $this->assertContains("TActiveRadioButtonList Test Case", $this->source()); - $this->assertText("label1", "Label 1"); + $this->assertText("{$base}label1", "Label 1"); - $this->click("button3"); + $this->byId("{$base}button3")->click(); $this->pause(800); $this->assertCheckBoxes(array(0)); - $this->click("button2"); + $this->byId("{$base}button2")->click(); $this->pause(800); $this->assertCheckBoxes(array()); - $this->click("button4"); + $this->byId("{$base}button4")->click(); $this->pause(800); $this->assertCheckBoxes(array(4)); - $this->click("list1_c2"); + $this->byId("{$base}list1_c2")->click(); $this->pause(800); - $this->assertText("label1", "Selection: value 3"); + $this->assertText("{$base}label1", "Selection: value 3"); - $this->click("list1_c3"); + $this->byId("{$base}list1_c3")->click(); $this->pause(800); - $this->assertText("label1", "Selection: value 4"); + $this->assertText("{$base}label1", "Selection: value 4"); } function assertCheckBoxes($checks, $total = 5) { + $base='ctl0_Content_'; for($i = 0; $i < $total; $i++) { if(in_array($i, $checks)) - $this->assertChecked("list1_c{$i}"); + $this->assertTrue($this->byId("{$base}list1_c{$i}")->selected()); else - $this->assertNotChecked("list1_c{$i}"); + $this->assertFalse($this->byId("{$base}list1_c{$i}")->selected()); } } } diff --git a/tests/FunctionalTests/active-controls/tests/ActiveRadioButtonTestCase.php b/tests/FunctionalTests/active-controls/tests/ActiveRadioButtonTestCase.php index fceb2e21..7606e46b 100755 --- a/tests/FunctionalTests/active-controls/tests/ActiveRadioButtonTestCase.php +++ b/tests/FunctionalTests/active-controls/tests/ActiveRadioButtonTestCase.php @@ -1,52 +1,53 @@ <?php -class ActiveRadioButtonTestCase extends PradoGenericSeleniumTest +class ActiveRadioButtonTestCase extends PradoGenericSelenium2Test { function test() { - $this->open("active-controls/index.php?page=ActiveRadioButtonTest"); - $this->verifyTextPresent("Active Radio Button Test"); - $this->assertText('label1', 'Label 1'); + $base='ctl0_Content_'; + $this->url("active-controls/index.php?page=ActiveRadioButtonTest"); + $this->assertContains("Active Radio Button Test", $this->source()); + $this->assertText("{$base}label1", 'Label 1'); - $this->assertNotChecked('radio1'); - $this->assertNotChecked('radio2'); - $this->assertNotChecked('radio3'); + $this->assertFalse($this->byId("{$base}radio1")->selected()); + $this->assertFalse($this->byId("{$base}radio2")->selected()); + $this->assertFalse($this->byId("{$base}radio3")->selected()); - $this->assertText('radio1_label', 'Radio Button 1'); - $this->assertText('radio2_label', 'Radio Button 2'); - $this->assertText('radio3_label', 'Radio Button 3'); + $this->assertText("{$base}radio1_label", 'Radio Button 1'); + $this->assertText("{$base}radio2_label", 'Radio Button 2'); + $this->assertText("{$base}radio3_label", 'Radio Button 3'); - $this->click('change_text1'); + $this->byId("{$base}change_text1")->click(); $this->pause(800); - $this->assertText('radio1_label', 'Hello Radio Button 1'); - $this->assertText('radio2_label', 'Radio Button 2'); - $this->assertText('radio3_label', 'Radio Button 3'); + $this->assertText("{$base}radio1_label", 'Hello Radio Button 1'); + $this->assertText("{$base}radio2_label", 'Radio Button 2'); + $this->assertText("{$base}radio3_label", 'Radio Button 3'); - $this->click('change_text2'); + $this->byId("{$base}change_text2")->click(); $this->pause(800); - $this->assertText('radio1_label', 'Hello Radio Button 1'); - $this->assertText('radio2_label', 'Radio Button 2 World'); - $this->assertText('radio3_label', 'Radio Button 3'); + $this->assertText("{$base}radio1_label", 'Hello Radio Button 1'); + $this->assertText("{$base}radio2_label", 'Radio Button 2 World'); + $this->assertText("{$base}radio3_label", 'Radio Button 3'); - $this->click('change_radio1'); + $this->byId("{$base}change_radio1")->click(); $this->pause(800); - $this->assertChecked('radio1'); - $this->assertNotChecked('radio2'); - $this->assertNotChecked('radio3'); + $this->assertTrue($this->byId("{$base}radio1")->selected()); + $this->assertFalse($this->byId("{$base}radio2")->selected()); + $this->assertFalse($this->byId("{$base}radio3")->selected()); - $this->click('change_radio2'); + $this->byId("{$base}change_radio2")->click(); $this->pause(800); - $this->assertNotChecked('radio1'); - $this->assertChecked('radio2'); - $this->assertNotChecked('radio3'); + $this->assertFalse($this->byId("{$base}radio1")->selected()); + $this->assertTrue($this->byId("{$base}radio2")->selected()); + $this->assertFalse($this->byId("{$base}radio3")->selected()); - $this->click('radio3'); + $this->byId("{$base}radio3")->click(); $this->pause(800); - $this->assertNotChecked('radio1'); - $this->assertChecked('radio2'); - $this->assertChecked('radio3'); - $this->assertText('label1', 'Label 1:Radio Button 3 Checked'); + $this->assertFalse($this->byId("{$base}radio1")->selected()); + $this->assertTrue($this->byId("{$base}radio2")->selected()); + $this->assertTrue($this->byId("{$base}radio3")->selected()); + $this->assertText("{$base}label1", 'Label 1:Radio Button 3 Checked'); } diff --git a/tests/FunctionalTests/active-controls/tests/AutoCompleteTestCase.php b/tests/FunctionalTests/active-controls/tests/AutoCompleteTestCase.php index 2033d6ff..058aae01 100755 --- a/tests/FunctionalTests/active-controls/tests/AutoCompleteTestCase.php +++ b/tests/FunctionalTests/active-controls/tests/AutoCompleteTestCase.php @@ -1,42 +1,43 @@ <?php -class AutoCompleteTestCase extends PradoGenericSeleniumTest +class AutoCompleteTestCase extends PradoGenericSelenium2Test { function test() { - $this->open("active-controls/index.php?page=AutoCompleteTest"); - $this->verifyTextPresent("TAutoComplete Test"); + $base='ctl0_Content_'; + $this->url("active-controls/index.php?page=AutoCompleteTest"); + $this->assertContains("TAutoComplete Test", $this->source()); - $this->assertText("label1", "Label 1"); + $this->assertText("{$base}label1", "Label 1"); - $this->type("textbox3", 'a'); - $this->runScript('Prado.Registry.get(\'textbox3\').onKeyPress({})'); + $this->byId("{$base}textbox3")->click(); + $this->keys('a'); $this->pause(500); - $this->verifyTextPresent('Andorra'); - $this->assertText("label1", "suggestion for a"); + $this->assertContains('Andorra', $this->source()); + $this->assertText("{$base}label1", "suggestion for a"); - $this->type("textbox3", 'au'); - $this->runScript('Prado.Registry.get(\'textbox3\').onKeyPress({})'); + $this->keys('u'); $this->pause(500); - $this->verifyTextPresent('Australia'); - $this->assertText("label1", "suggestion for au"); + $this->assertContains('Australia', $this->source()); + $this->assertText("{$base}label1", "suggestion for au"); - $this->click("css=#textbox3_result ul li"); + $this->byCssSelector("#{$base}textbox3_result ul li")->click(); $this->pause(500); - $this->assertText("label1", "Label 1: Austria"); + $this->assertText("{$base}label1", "Label 1: Austria"); - $this->type("textbox2", "cu"); - $this->runScript('Prado.Registry.get(\'textbox2\').onKeyPress({})'); + + $this->byId("{$base}textbox2")->click(); + $this->keys('cu'); $this->pause(500); - $this->click('css=#textbox2_result ul li'); + $this->byCssSelector("#{$base}textbox2_result ul li")->click(); $this->pause(500); - $this->assertText("label1", "Label 1: Cuba"); + $this->assertText("{$base}label1", "Label 1: Cuba"); - $this->type("textbox2", "Cuba,me"); - $this->runScript('Prado.Registry.get(\'textbox2\').onKeyPress({})'); + $this->keys(PHPUnit_Extensions_Selenium2TestCase_Keys::END); + $this->keys(',me'); $this->pause(500); - $this->click('css=#textbox2_result ul li'); + $this->byCssSelector("#{$base}textbox2_result ul li")->click(); $this->pause(500); - $this->assertText("label1", "Label 1: Cuba,Mexico"); + $this->assertText("{$base}label1", "Label 1: Cuba,Mexico"); } } diff --git a/tests/FunctionalTests/active-controls/tests/CalculatorTestCase.php b/tests/FunctionalTests/active-controls/tests/CalculatorTestCase.php index 48960d39..9bef7d00 100755 --- a/tests/FunctionalTests/active-controls/tests/CalculatorTestCase.php +++ b/tests/FunctionalTests/active-controls/tests/CalculatorTestCase.php @@ -1,23 +1,24 @@ <?php -class CalculatorTestCase extends PradoGenericSeleniumTest +class CalculatorTestCase extends PradoGenericSelenium2Test { function test() { - $this->open("active-controls/index.php?page=Calculator"); - $this->assertTextPresent("Callback Enabled Calculator"); - $this->assertNotVisible("summary"); - - $this->click("sum"); - $this->assertVisible("summary"); - - $this->type("a", "2"); - $this->type("b", "5"); - - $this->click("sum"); + $base='ctl0_Content_'; + $this->url("active-controls/index.php?page=Calculator"); + $this->assertContains("Callback Enabled Calculator", $this->source()); + $this->assertNotVisible("{$base}summary"); + + $this->byId("{$base}sum")->click(); + $this->assertVisible("{$base}summary"); + + $this->type("{$base}a", "2"); + $this->type("{$base}b", "5"); + + $this->byId("{$base}sum")->click(); $this->pause(500); - $this->assertNotVisible("summary"); - $this->assertValue("c", "7"); + $this->assertNotVisible("{$base}summary"); + $this->assertValue("{$base}c", "7"); } } diff --git a/tests/FunctionalTests/active-controls/tests/CallbackAdapterTestCase.php b/tests/FunctionalTests/active-controls/tests/CallbackAdapterTestCase.php index c495935a..25dabe24 100755 --- a/tests/FunctionalTests/active-controls/tests/CallbackAdapterTestCase.php +++ b/tests/FunctionalTests/active-controls/tests/CallbackAdapterTestCase.php @@ -1,58 +1,65 @@ <?php -class CallbackAdapterTestCase extends PradoGenericSeleniumTest +class CallbackAdapterTestCase extends PradoGenericSelenium2Test { function test() { + $base='ctl0_Content_'; + $this->url("active-controls/index.php?page=ControlAdapterTest"); + $this->assertContains('Control Adapter - State Tracking Tests', $this->source()); - $this->open("active-controls/index.php?page=ControlAdapterTest"); - $this->assertTextPresent('Control Adapter - State Tracking Tests'); + $this->byId("{$base}button2")->click(); + $this->assertEquals('ok', $this->alertText()); + $this->acceptAlert(); - $this->click('button2'); - $this->assertAlert('ok'); - - $this->click('test6'); + $this->byId("{$base}test6")->click(); $this->pause(800); - $this->click('test7'); + $this->byId("{$base}test7")->click(); $this->pause(800); - $this->click('test8'); + $this->byId("{$base}test8")->click(); $this->pause(800); - $this->click('test9'); + $this->byId("{$base}test9")->click(); $this->pause(800); - $this->click('button1'); - $this->assertAlert('haha!'); - - $this->click('button2'); - $this->assertAlert('ok'); - $this->assertAlert('baz!'); + $this->byId("{$base}button1")->click(); + $this->assertEquals('haha!', $this->alertText()); + $this->acceptAlert(); + $this->byId("{$base}button2")->click(); + $this->assertEquals('ok', $this->alertText()); + $this->acceptAlert(); + $this->assertEquals('baz!', $this->alertText()); + $this->acceptAlert(); } /* function testIE() { - $this->open("active-controls/index.php?page=ControlAdapterTest"); - $this->assertTextPresent('Control Adapter - State Tracking Tests'); + $this->url("active-controls/index.php?page=ControlAdapterTest"); + $this->assertContains('Control Adapter - State Tracking Tests', $this->source()); - $this->click('button2'); - $this->assertAlert('ok'); + $this->byId("{$base}button2")->click(); + $this->assertEquals('ok', $this->alertText()); + $this->acceptAlert(); - $this->click('test6'); + $this->byId('test6')->click(); $this->pause(800); - $this->click('test7'); + $this->byId('test7')->click(); $this->pause(800); - $this->click('test8'); + $this->byId('test8')->click(); $this->pause(800); - $this->click('test9'); + $this->byId('test9')->click(); $this->pause(800); - $this->click('button1'); - $this->assertAlert('haha!'); + $this->byId("{$base}button1")->click(); + $this->assertEquals('haha!', $this->alertText()); + $this->acceptAlert(); //IE alerts in diffrent order - $this->click('button2'); - $this->assertAlert('baz!'); - $this->assertAlert('ok'); + $this->byId("{$base}button2")->click(); + $this->assertEquals('baz!', $this->alertText()); + $this->acceptAlert(); + $this->assertEquals('ok', $this->alertText()); + $this->acceptAlert(); } */ } diff --git a/tests/FunctionalTests/active-controls/tests/CallbackOptionsTestCase.php b/tests/FunctionalTests/active-controls/tests/CallbackOptionsTestCase.php index d1f48cf3..4c2c7070 100755 --- a/tests/FunctionalTests/active-controls/tests/CallbackOptionsTestCase.php +++ b/tests/FunctionalTests/active-controls/tests/CallbackOptionsTestCase.php @@ -1,29 +1,30 @@ <?php -class CallbackOptionsTestCase extends PradoGenericSeleniumTest +class CallbackOptionsTestCase extends PradoGenericSelenium2Test { function test() { - $this->open("active-controls/index.php?page=CallbackOptionsTest"); - $this->verifyTextPresent("TCallbackOptions Test"); + $base='ctl0_Content_'; + $this->url("active-controls/index.php?page=CallbackOptionsTest"); + $this->assertContains("TCallbackOptions Test", $this->source()); $this->assertText("label1", "Label 1"); $this->assertText("label2", "Label 2"); $this->assertText("label3", "Label 3"); - $this->click("button1"); + $this->byId("{$base}button1")->click(); $this->pause(800); $this->assertText("label1", "Button 1 has returned"); $this->assertText("label2", "Label 2"); $this->assertText("label3", "Label 3"); - $this->click("button2"); + $this->byId("{$base}button2")->click(); $this->pause(800); $this->assertText("label1", "Button 1 has returned"); $this->assertText("label2", "Button 2 has returned"); $this->assertText("label3", "Label 3"); - $this->click("button3"); + $this->byId("{$base}button3")->click(); $this->pause(800); $this->assertText("label1", "Button 1 has returned"); $this->assertText("label2", "Button 2 has returned"); diff --git a/tests/FunctionalTests/active-controls/tests/CustomTemplateTestCase.php b/tests/FunctionalTests/active-controls/tests/CustomTemplateTestCase.php index 7e38423e..3b594b39 100755 --- a/tests/FunctionalTests/active-controls/tests/CustomTemplateTestCase.php +++ b/tests/FunctionalTests/active-controls/tests/CustomTemplateTestCase.php @@ -1,20 +1,21 @@ <?php -class CustomTemplateTestCase extends PradoGenericSeleniumTest +class CustomTemplateTestCase extends PradoGenericSelenium2Test { function test() { - $this->open('active-controls/index.php?page=CustomTemplateControlTest'); - $this->assertTextPresent('Add Dynamic Custom TTemplateControl Test'); - $this->assertText('label1', 'Label 1'); + $base='ctl0_Content_'; + $this->url('active-controls/index.php?page=CustomTemplateControlTest'); + $this->assertContains('Add Dynamic Custom TTemplateControl Test', $this->source()); + $this->assertText("{$base}label1", 'Label 1'); - $this->type('foo', 'Foo Bar!'); - $this->click('button2'); + $this->type("{$base}foo", 'Foo Bar!'); + $this->byId("{$base}button2")->click(); $this->pause(800); - $this->assertVisible('ctl1_ThePanel'); - $this->assertTextPresent('Client ID: ctl1_ThePanel'); + $this->assertVisible("{$base}ctl0_ThePanel"); + $this->assertContains("Client ID: {$base}ctl0_ThePanel", $this->source()); - $this->assertText('label1', 'Button 1 was clicked Foo Bar! using callback!... and this is the textbox text: Foo Bar!'); + $this->assertText("{$base}label1", 'Button 1 was clicked Foo Bar! using callback!... and this is the textbox text: Foo Bar!'); } } diff --git a/tests/FunctionalTests/active-controls/tests/DelayedCallbackTestCase.php b/tests/FunctionalTests/active-controls/tests/DelayedCallbackTestCase.php index 841de5aa..49c268ad 100755 --- a/tests/FunctionalTests/active-controls/tests/DelayedCallbackTestCase.php +++ b/tests/FunctionalTests/active-controls/tests/DelayedCallbackTestCase.php @@ -1,20 +1,21 @@ <?php -class DelayedCallbackTestCase extends PradoGenericSeleniumTest +class DelayedCallbackTestCase extends PradoGenericSelenium2Test { function test() { - $this->open("active-controls/index.php?page=DelayedCallback"); - $this->verifyTextPresent("Delayed Callback Test"); + $base='ctl0_Content_'; + $this->url("active-controls/index.php?page=DelayedCallback"); + $this->assertContains("Delayed Callback Test", $this->source()); - $this->assertText("status", ""); - $this->click("button1"); - $this->click("button2"); + $this->assertText("{$base}status", ""); + $this->byId("{$base}button1")->click(); + $this->byId("{$base}button2")->click(); $this->pause("5000"); - $this->assertText("status", "Callback 1 returned after 4s"); + $this->assertText("{$base}status", "Callback 1 returned after 4s"); $this->pause("3000"); - $this->assertText("status", "Callback 2 delayed 2s"); + $this->assertText("{$base}status", "Callback 2 delayed 2s"); } } diff --git a/tests/FunctionalTests/active-controls/tests/EventTriggerTestCase.php b/tests/FunctionalTests/active-controls/tests/EventTriggerTestCase.php index 30678786..7cc9a3bd 100755 --- a/tests/FunctionalTests/active-controls/tests/EventTriggerTestCase.php +++ b/tests/FunctionalTests/active-controls/tests/EventTriggerTestCase.php @@ -1,20 +1,21 @@ <?php -class EventTriggerTestCase extends PradoGenericSeleniumTest +class EventTriggerTestCase extends PradoGenericSelenium2Test { function test() { - $this->open("active-controls/index.php?page=EventTriggeredCallback"); - $this->verifyTextPresent("Event Triggered Callback Test"); + $base = "ctl0_Content_"; + $this->url("active-controls/index.php?page=EventTriggeredCallback"); + $this->assertContains("Event Triggered Callback Test", $this->source()); - $this->assertText('label1', 'Label 1'); + $this->assertText("{$base}label1", 'Label 1'); - $this->click('button1'); + $this->byId("button1")->click(); $this->pause(800); - $this->assertText('label1', 'button 1 clicked'); + $this->assertText("{$base}label1", 'button 1 clicked'); - $this->type('text1', 'test'); + $this->byId("{$base}text1")->value('test'); $this->pause(800); - $this->assertText('label1', 'text 1 focused'); + $this->assertText("{$base}label1", 'text 1 focused'); } } diff --git a/tests/FunctionalTests/active-controls/tests/NestedActiveControlsTestCase.php b/tests/FunctionalTests/active-controls/tests/NestedActiveControlsTestCase.php index e2ceb33e..f08a6f78 100755 --- a/tests/FunctionalTests/active-controls/tests/NestedActiveControlsTestCase.php +++ b/tests/FunctionalTests/active-controls/tests/NestedActiveControlsTestCase.php @@ -1,24 +1,25 @@ <?php -class NestedActiveControlsTestCase extends PradoGenericSeleniumTest +class NestedActiveControlsTestCase extends PradoGenericSelenium2Test { function test() { - $this->open("active-controls/index.php?page=NestedActiveControls"); - $this->verifyTextPresent("Nested Active Controls Test"); - $this->assertText("label1", "Label 1"); - $this->assertText("label2", "Label 2"); - $this->assertTextNotPresent("Label 3"); + $base='ctl0_Content_'; + $this->url("active-controls/index.php?page=NestedActiveControls"); + $this->assertContains("Nested Active Controls Test", $this->source()); + $this->assertText("{$base}label1", "Label 1"); + $this->assertText("{$base}label2", "Label 2"); + $this->assertNotContains("Label 3", $this->source()); - $this->click("div1"); + $this->byId("div1")->click(); $this->pause(800); - $this->assertTextPresent("Something lalala"); - $this->assertText("label3", "Label 3"); + $this->assertContains("Something lalala", $this->source()); + $this->assertText("{$base}label3", "Label 3"); - $this->click("button1"); + $this->byId("{$base}button1")->click(); $this->pause(800); - $this->assertText("label1", "Label 1: Button 1 Clicked"); - $this->assertText("label2", "Label 2: Button 1 Clicked"); - $this->assertText("label3", "Label 3: Button 1 Clicked"); + $this->assertText("{$base}label1", "Label 1: Button 1 Clicked"); + $this->assertText("{$base}label2", "Label 2: Button 1 Clicked"); + $this->assertText("{$base}label3", "Label 3: Button 1 Clicked"); } } diff --git a/tests/FunctionalTests/active-controls/tests/PopulateListTestCase.php b/tests/FunctionalTests/active-controls/tests/PopulateListTestCase.php index adb5a3a5..e7f7f287 100755 --- a/tests/FunctionalTests/active-controls/tests/PopulateListTestCase.php +++ b/tests/FunctionalTests/active-controls/tests/PopulateListTestCase.php @@ -1,23 +1,24 @@ <?php -class PopulateListTestCase extends PradoGenericSeleniumTest +class PopulateListTestCase extends PradoGenericSelenium2Test { function test() { - $this->open("active-controls/index.php?page=PopulateActiveList"); - $this->verifyTextPresent("Populate active list controls"); - $this->assertText("label1", ""); + $base='ctl0_Content_'; + $this->url("active-controls/index.php?page=PopulateActiveList"); + $this->assertContains("Populate active list controls", $this->source()); + $this->assertText("{$base}label1", ""); - $this->click("button1"); + $this->byId("{$base}button1")->click(); $this->pause(800); - $this->select("list1", "World"); + $this->select("{$base}list1", "World"); $this->pause(800); - $this->assertText("label1", "list1: World"); + $this->assertText("{$base}label1", "list1: World"); - $this->click("button2"); + $this->byId("{$base}button2")->click(); $this->pause(800); - $this->select("list2", "Prado"); + $this->select("{$base}list2", "Prado"); $this->pause(800); - $this->assertText("label1", "list2: Prado"); + $this->assertText("{$base}label1", "list2: Prado"); } } diff --git a/tests/FunctionalTests/active-controls/tests/PostLoadingTestCase.php b/tests/FunctionalTests/active-controls/tests/PostLoadingTestCase.php index 21a5128d..271a2ffb 100755 --- a/tests/FunctionalTests/active-controls/tests/PostLoadingTestCase.php +++ b/tests/FunctionalTests/active-controls/tests/PostLoadingTestCase.php @@ -1,20 +1,21 @@ <?php -class PostLoadingTestCase extends PradoGenericSeleniumTest +class PostLoadingTestCase extends PradoGenericSelenium2Test { function test() { - $this->open('active-controls/index.php?page=PostLoadingTest'); - $this->assertTextPresent('PostLoading Test'); + $base="ctl0_Content_"; + $this->url('active-controls/index.php?page=PostLoadingTest'); + $this->assertContains('PostLoading Test', $this->source()); - $this->assertTextNotPresent('Hello World'); + $this->assertNotContains('Hello World', $this->source()); - $this->click('div1'); + $this->byId('div1')->click(); $this->pause(800); - $this->type('MyTextBox', 'Hello World'); - $this->click('MyButton'); + $this->type("{$base}MyTextBox", 'Hello World'); + $this->byId("{$base}MyButton")->click(); $this->pause(800); - $this->assertTextPresent('Result is Hello World'); + $this->assertContains('Result is Hello World', $this->source()); } } diff --git a/tests/FunctionalTests/active-controls/tests/ReplaceContentTestCase.php b/tests/FunctionalTests/active-controls/tests/ReplaceContentTestCase.php index fd273ae7..c3345d6a 100755 --- a/tests/FunctionalTests/active-controls/tests/ReplaceContentTestCase.php +++ b/tests/FunctionalTests/active-controls/tests/ReplaceContentTestCase.php @@ -1,90 +1,90 @@ <?php -class ReplaceContentTestCase extends PradoGenericSeleniumTest +class ReplaceContentTestCase extends PradoGenericSelenium2Test { function test() { + $base='ctl0_Content_'; + $this->url('active-controls/index.php?page=ReplaceContentTest'); + $this->assertContains('Callback Replace Content Test', $this->source()); - $this->open('active-controls/index.php?page=ReplaceContentTest'); - $this->assertTextPresent('Callback Replace Content Test'); + $this->assertText("{$base}subpanel", 'Sub Panel'); + $this->assertText("{$base}panel1", "Main Panel\nSub Panel"); - $this->assertText('subpanel', 'Sub Panel'); - $this->assertText('panel1', 'Main Panel Sub Panel'); + $this->type("{$base}content", 'something'); - $this->type('content', 'something'); - - $this->click('btn_append'); + $this->byId("{$base}btn_append")->click(); $this->pause(800); - $this->assertText('subpanel', 'Sub Panel something'); - $this->assertText('panel1', 'Main Panel Sub Panel something'); + $this->assertText("{$base}subpanel", 'Sub Panel something'); + $this->assertText("{$base}panel1", "Main Panel\nSub Panel something"); - $this->type('content', 'more'); - $this->click('btn_prepend'); + $this->type("{$base}content", 'more'); + $this->byId("{$base}btn_prepend")->click(); $this->pause(800); - $this->assertText('subpanel', 'more Sub Panel something'); - $this->assertText('panel1', 'Main Panel more Sub Panel something'); + $this->assertText("{$base}subpanel", 'more Sub Panel something'); + $this->assertText("{$base}panel1", "Main Panel\nmore Sub Panel something"); - $this->type('content', 'prado'); - $this->click('btn_before'); + $this->type("{$base}content", 'prado'); + $this->byId("{$base}btn_before")->click(); $this->pause(800); - $this->assertText('subpanel', 'more Sub Panel something'); - $this->assertText('panel1', 'Main Panel pradomore Sub Panel something'); + $this->assertText("{$base}subpanel", 'more Sub Panel something'); + $this->assertText("{$base}panel1", "Main Panel prado\nmore Sub Panel something"); - $this->type('content', ' php '); - $this->click('btn_after'); + $this->type("{$base}content", ' php '); + $this->byId("{$base}btn_after")->click(); $this->pause(800); - $this->type('content', 'mauahahaha'); - $this->click('btn_replace'); + $this->type("{$base}content", 'mauahahaha'); + $this->byId("{$base}btn_replace")->click(); $this->pause(1000); - $this->assertText('panel1', 'Main Panel pradomauahahahaphp'); + $this->assertText("{$base}panel1", 'Main Panel pradomauahahaha php'); } /* function testIE() { - $this->open('active-controls/index.php?page=ReplaceContentTest'); - $this->assertTextPresent('Callback Replace Content Test'); + $this->url('active-controls/index.php?page=ReplaceContentTest'); + $this->assertContains('Callback Replace Content Test', $this->source()); - $this->assertText('subpanel', 'Sub Panel'); - $this->assertText('panel1', 'regexp:Main Panel\s*Sub Panel'); + $this->assertText("{$base}subpanel", 'Sub Panel'); + $this->assertText("{$base}panel1", 'regexp:Main Panel\s*Sub Panel'); - $this->type('content', 'something'); + $this->type("{$base}content", 'something'); - $this->click('btn_append'); + $this->byId('btn_append')->click(); $this->pause(800); - $this->assertText('subpanel', 'Sub Panel something'); - $this->assertText('panel1', 'regexp:Main Panel\s*Sub Panel\s*something'); + $this->assertText("{$base}subpanel", 'Sub Panel something'); + $this->assertText("{$base}panel1", 'regexp:Main Panel\s*Sub Panel\s*something'); - $this->type('content', 'more'); - $this->click('btn_prepend'); + $this->type("{$base}content", 'more'); + $this->byId('btn_prepend')->click(); $this->pause(800); - $this->assertText('subpanel', 'regexp:more\s*Sub Panel\s*something'); - $this->assertText('panel1', 'regexp:Main Panel\s*moreSub Panel\s*something'); + $this->assertText("{$base}subpanel", 'regexp:more\s*Sub Panel\s*something'); + $this->assertText("{$base}panel1", 'regexp:Main Panel\s*moreSub Panel\s*something'); - $this->type('content', 'prado'); - $this->click('btn_before'); + $this->type("{$base}content", 'prado'); + $this->byId('btn_before')->click(); $this->pause(800); - $this->assertText('subpanel', 'regexp:more\s*Sub Panel\s*something'); - $this->assertText('panel1', 'regexp:Main Panel\s*prado\s*more\s*Sub Panel\s*something'); + $this->assertText("{$base}subpanel", 'regexp:more\s*Sub Panel\s*something'); + $this->assertText("{$base}panel1", 'regexp:Main Panel\s*prado\s*more\s*Sub Panel\s*something'); - $this->type('content', ' php '); - $this->click('btn_after'); + $this->type("{$base}content", ' php '); + $this->byId('btn_after')->click(); $this->pause(800); - $this->type('content', 'mauahahaha'); - $this->click('btn_replace'); + $this->type("{$base}content", 'mauahahaha'); + $this->byId('btn_replace')->click(); $this->pause(1000); - $this->assertText('panel1', 'Main Panel pradomauahahahaphp'); + $this->assertText("{$base}panel1", 'Main Panel pradomauahahahaphp'); } */ } diff --git a/tests/FunctionalTests/active-controls/tests/TextBoxCallbackTestCase.php b/tests/FunctionalTests/active-controls/tests/TextBoxCallbackTestCase.php index 14d575fe..559c80a6 100755 --- a/tests/FunctionalTests/active-controls/tests/TextBoxCallbackTestCase.php +++ b/tests/FunctionalTests/active-controls/tests/TextBoxCallbackTestCase.php @@ -1,15 +1,16 @@ <?php -class TextBoxCallbackTestCase extends PradoGenericSeleniumTest +class TextBoxCallbackTestCase extends PradoGenericSelenium2Test { function test() { - $this->open("active-controls/index.php?page=ActiveTextBoxCallback"); - $this->verifyTextPresent("ActiveTextBox Callback Test"); - $this->assertText("label1", "Label 1"); + $base='ctl0_Content_'; + $this->url("active-controls/index.php?page=ActiveTextBoxCallback"); + $this->assertContains("ActiveTextBox Callback Test", $this->source()); + $this->assertText("{$base}label1", "Label 1"); - $this->type("textbox1", "hello!"); + $this->type("{$base}textbox1", "hello!"); $this->pause(800); - $this->assertText("label1", "Label 1: hello!"); + $this->assertText("{$base}label1", "Label 1: hello!"); } } diff --git a/tests/FunctionalTests/active-controls/tests/TextBoxGroupValidationTestCase.php b/tests/FunctionalTests/active-controls/tests/TextBoxGroupValidationTestCase.php index ffc1ac72..2562a18b 100755 --- a/tests/FunctionalTests/active-controls/tests/TextBoxGroupValidationTestCase.php +++ b/tests/FunctionalTests/active-controls/tests/TextBoxGroupValidationTestCase.php @@ -1,22 +1,23 @@ <?php -class TextBoxGroupValidationTestCase extends PradoGenericSeleniumTest +class TextBoxGroupValidationTestCase extends PradoGenericSelenium2Test { function test() { - $this->open("active-controls/index.php?page=TextBoxValidationCallback"); - $this->assertTextPresent('TextBox AutoPostBack With Group Validation'); - $this->assertNotVisible('validator1'); + $base="ctl0_Content_"; + $this->url("active-controls/index.php?page=TextBoxValidationCallback"); + $this->assertContains('TextBox AutoPostBack With Group Validation', $this->source()); + $this->assertNotVisible("{$base}validator1"); - $this->type('ZipCode', 'test'); - $this->assertVisible('validator1'); + $this->type("{$base}ZipCode", 'test'); + $this->assertVisible("{$base}validator1"); - $this->type('Address', 'Sydney'); - $this->type('ZipCode', '2000'); + $this->type("{$base}Address", 'Sydney'); + $this->type("{$base}ZipCode", '2000'); - $this->assertNotVisible('validator1'); + $this->assertNotVisible("{$base}validator1"); $this->pause(800); - $this->assertValue('City', 'City: Sydney Zip: 2000'); + $this->assertValue("{$base}City", 'City: Sydney Zip: 2000'); } } diff --git a/tests/FunctionalTests/active-controls/tests/TimeTriggeredCallbackTestCase.php b/tests/FunctionalTests/active-controls/tests/TimeTriggeredCallbackTestCase.php index de0ecad8..741c7a2d 100755 --- a/tests/FunctionalTests/active-controls/tests/TimeTriggeredCallbackTestCase.php +++ b/tests/FunctionalTests/active-controls/tests/TimeTriggeredCallbackTestCase.php @@ -1,19 +1,20 @@ <?php -class TimeTriggeredCallbackTestCase extends PradoGenericSeleniumTest +class TimeTriggeredCallbackTestCase extends PradoGenericSelenium2Test { function test() { - $this->open("active-controls/index.php?page=TimeTriggeredCallbackTest"); - $this->verifyTextPresent("TimeTriggeredCallback + ViewState Tests"); + $base='ctl0_Content_'; + $this->url("active-controls/index.php?page=TimeTriggeredCallbackTest"); + $this->assertContains("TimeTriggeredCallback + ViewState Tests", $this->source()); - $this->assertText("label1", "ViewState Counter :"); + $this->assertText("{$base}label1", "ViewState Counter :"); - $this->click("button1"); + $this->byId("{$base}button1")->click(); $this->pause(8000); - $this->assertText("label1", "ViewState Counter : 1 2 3 4 5 6 7 8 9 10"); + $this->assertText("{$base}label1", "ViewState Counter : 1 2 3 4 5 6 7 8 9 10"); } } diff --git a/tests/FunctionalTests/active-controls/tests/ValueTriggerCallbackTestCase.php b/tests/FunctionalTests/active-controls/tests/ValueTriggerCallbackTestCase.php index 5113cc92..8b0428a9 100755 --- a/tests/FunctionalTests/active-controls/tests/ValueTriggerCallbackTestCase.php +++ b/tests/FunctionalTests/active-controls/tests/ValueTriggerCallbackTestCase.php @@ -1,20 +1,21 @@ <?php -class ValueTriggerTestCase extends PradoGenericSeleniumTest +class ValueTriggerTestCase extends PradoGenericSelenium2Test { function test() { - $this->open("active-controls/index.php?page=ValueTriggerCallbackTest"); - $this->verifyTextPresent("Value Trigger Callback Test"); + $base='ctl0_Content_'; + $this->url("active-controls/index.php?page=ValueTriggerCallbackTest"); + $this->assertContains("Value Trigger Callback Test", $this->source()); - $this->assertText('label1', 'Label 1'); + $this->assertText("{$base}label1", 'Label 1'); - $this->type('text1', 'test'); + $this->type("{$base}text1", 'test'); $this->pause(2000); - $this->assertText('label1', 'Old = : New Value = test'); + $this->assertText("{$base}label1", 'Old = : New Value = test'); - $this->type('text1', 'more'); + $this->type("{$base}text1", 'more'); $this->pause(3000); - $this->assertText('label1', 'Old = test : New Value = more'); + $this->assertText("{$base}label1", 'Old = test : New Value = more'); } } diff --git a/tests/FunctionalTests/active-controlstests/ActiveRatingListTestCase.php b/tests/FunctionalTests/active-controlstests/ActiveRatingListTestCase.php index ef82eaa3..2b9a0166 100755 --- a/tests/FunctionalTests/active-controlstests/ActiveRatingListTestCase.php +++ b/tests/FunctionalTests/active-controlstests/ActiveRatingListTestCase.php @@ -1,242 +1,250 @@ <?php /** * ActiveRatingListTestCase.php - * + * * @author Bradley Booms <Bradley.Booms@nsighttel.com> * @version Creation Date: Oct 22, 2008 */ /** * ActiveRatingListTestCase.php class - * - * - * + * + * + * * Properties * - - * + * * @author Bradley Booms <Bradley.Booms@nsighttel.com> * @version Modified Date: Oct 22, 2008 - * + * * Modifications: */ -class ActiveRatingListTestCase extends PradoGenericSeleniumTest +class ActiveRatingListTestCase extends PradoGenericSelenium2Test { function testCheckBoxes() { + $base='ctl0_Content_'; // Verify we're on the right page. - $this->open("active-controls/index.php?page=ActiveRatingListCheckBoxesTest"); - $this->verifyTextPresent("TActiveRatingList Check Boxes Test Case"); - $this->assertCheckBoxes("RatingList", array(2), 6); - + $this->url("active-controls/index.php?page=ActiveRatingListCheckBoxesTest"); + $this->assertContains("TActiveRatingList Check Boxes Test Case", $this->source()); + $this->assertCheckBoxes("{$base}RatingList", array(2), 6); + // Change the list and make sure the radio buttons get updated properly. - $this->clickTD("RatingList_c4"); + $this->clickTD("{$base}RatingList_c4"); $this->pause(800); - $this->assertCheckBoxes("RatingList", array(4), 6); - - $this->clickTD("RatingList_c2"); + $this->assertCheckBoxes("{$base}RatingList", array(4), 6); + + $this->clickTD("{$base}RatingList_c2"); $this->pause(800); - $this->assertCheckBoxes("RatingList", array(2), 6); + $this->assertCheckBoxes("{$base}RatingList", array(2), 6); } function testRating() { + $base='ctl0_Content_'; // Verify we're on the right page. - $this->open("active-controls/index.php?page=ActiveRatingListRatingTest"); - $this->verifyTextPresent("TActiveRatingList Rating Test Case"); - + $this->url("active-controls/index.php?page=ActiveRatingListRatingTest"); + $this->assertContains("TActiveRatingList Rating Test Case", $this->source()); + // Check the list, make sure it starts out with 5 stars. - $this->assertText("Status", "Rating: 5"); - + $this->assertText("{$base}Status", "Rating: 5"); + // Click on 1 star and make sure the Rating property updates. - $this->clickTD("RatingList_c0"); + $this->clickTD("{$base}RatingList_c0"); $this->pause(800); - $this->assertText("Status", "Rating: 1"); - + $this->assertText("{$base}Status", "Rating: 1"); + // Then set Rating to three on the server side and make sure it's correct. - $this->click("SetRating"); + $this->byId("{$base}SetRating")->click(); $this->pause(800); - $this->assertText("Status", "Rating: 3"); + $this->assertText("{$base}Status", "Rating: 3"); } function testSelectedIndex() { + $base='ctl0_Content_'; // Verify we're on the right page. - $this->open("active-controls/index.php?page=ActiveRatingListSelectedIndexTest"); - $this->verifyTextPresent("TActiveRatingList SelectedIndex Test Case"); - $this->assertText("Status", " SelectedIndex: 1"); - + $this->url("active-controls/index.php?page=ActiveRatingListSelectedIndexTest"); + $this->assertContains("TActiveRatingList SelectedIndex Test Case", $this->source()); + $this->assertText("{$base}Status", "SelectedIndex: 1"); + // Click on 5 stars and make sure the SelectedIndex property updates. - $this->clickTD("RatingList_c4"); + $this->clickTD("{$base}RatingList_c4"); $this->pause(800); - $this->assertText("Status", " SelectedIndex: 4"); - + $this->assertText("{$base}Status", "SelectedIndex: 4"); + // Then set SelectedIndex to 5 on the server side and make sure it's correct. - $this->click("SetSelectedIndex"); + $this->byId("{$base}SetSelectedIndex")->click(); $this->pause(800); - $this->assertText("Status", " SelectedIndex: 5"); + $this->assertText("{$base}Status", "SelectedIndex: 5"); } function testAutoPostBack() { + $base='ctl0_Content_'; // Verify we're on the right page. - $this->open("active-controls/index.php?page=ActiveRatingListAutoPostBackTest"); - $this->verifyTextPresent("TActiveRatingList AutoPostBack Test Case"); - $this->assertText("Status", "AutoPostback=false"); - + $this->url("active-controls/index.php?page=ActiveRatingListAutoPostBackTest"); + $this->assertContains("TActiveRatingList AutoPostBack Test Case", $this->source()); + $this->assertText("{$base}Status", "AutoPostback=false"); + // Make sure that it doesn't auto post when clicked. - $this->clickTD("RatingList_c3"); + $this->clickTD("{$base}RatingList_c3"); $this->pause(800); - $this->assertText("Status", "AutoPostback=false"); - + $this->assertText("{$base}Status", "AutoPostback=false"); + // Then submit with an active button and make sure it updates. - $this->click("Submit"); + $this->byId("{$base}Submit")->click(); $this->pause(800); - $this->assertText("Status", "4 : Good"); + $this->assertText("{$base}Status", "4 : Good"); } function testAllowInput() { + $base='ctl0_Content_'; // Verify we're on the right page. - $this->open("active-controls/index.php?page=ActiveRatingListAllowInputTest"); - $this->verifyTextPresent("TActiveRatingList AllowInput Test Case"); - $this->assertText("Status", "AllowInput=false"); - $this->assertCheckBoxes("RatingList", array(3), 6); + $this->url("active-controls/index.php?page=ActiveRatingListAllowInputTest"); + $this->assertContains("TActiveRatingList AllowInput Test Case", $this->source()); + $this->assertText("{$base}Status", "AllowInput=false"); + $this->assertCheckBoxes("{$base}RatingList", array(3), 6); // Make sure that clicking doesn't change anything. - $this->clickTD("RatingList_c5"); + $this->clickTD("{$base}RatingList_c5"); $this->pause(800); - $this->assertText("Status", "AllowInput=false"); - $this->assertCheckBoxes("RatingList", array(3), 6); + $this->assertText("{$base}Status", "AllowInput=false"); + $this->assertCheckBoxes("{$base}RatingList", array(3), 6); } function testReadOnly() { + $base='ctl0_Content_'; // Verify we're on the right page. - $this->open("active-controls/index.php?page=ActiveRatingListReadOnlyTest"); - $this->verifyTextPresent("TActiveRatingList ReadOnly Test Case"); - $this->assertText("Status", "ReadOnly=true"); - $this->assertCheckBoxes("RatingList", array(0), 6); + $this->url("active-controls/index.php?page=ActiveRatingListReadOnlyTest"); + $this->assertContains("TActiveRatingList ReadOnly Test Case", $this->source()); + $this->assertText("{$base}Status", "ReadOnly=true"); + $this->assertCheckBoxes("{$base}RatingList", array(0), 6); - $this->clickTD("RatingList_c4"); + $this->clickTD("{$base}RatingList_c4"); $this->pause(800); - $this->assertText("Status", "ReadOnly=true"); - $this->assertCheckBoxes("RatingList", array(0), 6); - + $this->assertText("{$base}Status", "ReadOnly=true"); + $this->assertCheckBoxes("{$base}RatingList", array(0), 6); + // Then set ReadOnly to false, and make sure it works. - $this->click("Writable"); + $this->byId("{$base}Writable")->click(); $this->pause(800); - $this->assertText("Status", "ReadOnly=false"); - $this->assertCheckBoxes("RatingList", array(0), 6); - - - $this->clickTD("RatingList_c1"); + $this->assertText("{$base}Status", "ReadOnly=false"); + $this->assertCheckBoxes("{$base}RatingList", array(0), 6); + + + $this->clickTD("{$base}RatingList_c1"); $this->pause(800); - $this->assertText("Status", "2 : Fair"); - $this->assertCheckBoxes("RatingList", array(1), 6); - + $this->assertText("{$base}Status", "2 : Fair"); + $this->assertCheckBoxes("{$base}RatingList", array(1), 6); + // Then set ReadOnly to true, and make sure it doesn't work anymore. - $this->click("ReadOnly"); + $this->byId("{$base}ReadOnly")->click(); $this->pause(800); - $this->assertText("Status", "ReadOnly=true"); - $this->assertCheckBoxes("RatingList", array(1), 6); - - - $this->clickTD("RatingList_c2"); + $this->assertText("{$base}Status", "ReadOnly=true"); + $this->assertCheckBoxes("{$base}RatingList", array(1), 6); + + + $this->clickTD("{$base}RatingList_c2"); $this->pause(800); - $this->assertText("Status", "ReadOnly=true"); - $this->assertCheckBoxes("RatingList", array(1), 6); + $this->assertText("{$base}Status", "ReadOnly=true"); + $this->assertCheckBoxes("{$base}RatingList", array(1), 6); } function testEnabled() { + $base='ctl0_Content_'; // Verify we're on the right page. - $this->open("active-controls/index.php?page=ActiveRatingListEnabledTest"); - $this->verifyTextPresent("TActiveRatingList Enabled Test Case"); - $this->assertText("Status", "Enabled=false"); - $this->assertCheckBoxes("RatingList", array(5), 6); + $this->url("active-controls/index.php?page=ActiveRatingListEnabledTest"); + $this->assertContains("TActiveRatingList Enabled Test Case", $this->source()); + $this->assertText("{$base}Status", "Enabled=false"); + $this->assertCheckBoxes("{$base}RatingList", array(5), 6); - $this->clickTD("RatingList_c4"); + $this->clickTD("{$base}RatingList_c4"); $this->pause(800); - $this->assertText("Status", "Enabled=false"); - $this->assertCheckBoxes("RatingList", array(5), 6); - + $this->assertText("{$base}Status", "Enabled=false"); + $this->assertCheckBoxes("{$base}RatingList", array(5), 6); + // Then set Enable to true, and make sure it works. - $this->click("Enable"); + $this->byId("{$base}Enable")->click(); $this->pause(800); - $this->assertText("Status", "Enabled=true"); - $this->assertCheckBoxes("RatingList", array(5), 6); - - - $this->clickTD("RatingList_c3"); + $this->assertText("{$base}Status", "Enabled=true"); + $this->assertCheckBoxes("{$base}RatingList", array(5), 6); + + + $this->clickTD("{$base}RatingList_c3"); $this->pause(800); - $this->assertText("Status", "4 : Good"); - $this->assertCheckBoxes("RatingList", array(3), 6); - + $this->assertText("{$base}Status", "4 : Good"); + $this->assertCheckBoxes("{$base}RatingList", array(3), 6); + // Then set Enable to false, and make sure it doesn't work anymore. - $this->click("Disable"); + $this->byId("{$base}Disable")->click(); $this->pause(800); - $this->assertText("Status", "Enabled=false"); - $this->assertCheckBoxes("RatingList", array(3), 6); - - - $this->clickTD("RatingList_c5"); + $this->assertText("{$base}Status", "Enabled=false"); + $this->assertCheckBoxes("{$base}RatingList", array(3), 6); + + + $this->clickTD("{$base}RatingList_c5"); $this->pause(800); - $this->assertText("Status", "Enabled=false"); - $this->assertCheckBoxes("RatingList", array(3), 6); + $this->assertText("{$base}Status", "Enabled=false"); + $this->assertCheckBoxes("{$base}RatingList", array(3), 6); } - + function testHoverCaption() { + $base='ctl0_Content_'; // Verify we're on the right page. - $this->open("active-controls/index.php?page=ActiveRatingListHoverCaptionTest"); - $this->verifyTextPresent("TActiveRatingList Hover Caption Test Case"); - $this->assertText("Status", "CaptionID='Status'"); - $this->assertElementPresent("//input[@id='RatingList_c0']/../../../td[contains(@class, 'rating_selected')]"); - $this->assertElementPresent("//input[@id='RatingList_c1']/../../../td[contains(@class, 'rating_selected')]"); - $this->assertElementPresent("//input[@id='RatingList_c2']/../../../td[contains(@class, 'rating_selected')]"); - $this->assertElementPresent("//input[@id='RatingList_c3']/../../../td[contains(@class, 'rating_half')]"); - $this->assertElementPresent("//input[@id='RatingList_c3']/../../../td[contains(@class, 'rating')]"); - $this->assertElementPresent("//input[@id='RatingList_c4']/../../../td[contains(@class, 'rating')]"); - $this->assertElementPresent("//input[@id='RatingList_c5']/../../../td[contains(@class, 'rating')]"); - - $this->mouseOver("//input[@id='RatingList_c4']/../../"); - $this->assertText("Status", "Excellent"); - $this->assertElementPresent("//input[@id='RatingList_c0']/../../../td[contains(@class, 'rating_hover')]"); - $this->assertElementPresent("//input[@id='RatingList_c1']/../../../td[contains(@class, 'rating_hover')]"); - $this->assertElementPresent("//input[@id='RatingList_c2']/../../../td[contains(@class, 'rating_hover')]"); - $this->assertElementPresent("//input[@id='RatingList_c3']/../../../td[contains(@class, 'rating_hover')]"); - $this->assertElementPresent("//input[@id='RatingList_c4']/../../../td[contains(@class, 'rating_hover')]"); - $this->assertElementPresent("//input[@id='RatingList_c5']/../../../td[not(contains(@class, 'rating_hover'))]"); - $this->assertElementPresent("//input[@id='RatingList_c5']/../../../td[contains(@class, 'rating')]"); - - $this->mouseOut("//input[@id='RatingList_c4']/../../"); - $this->assertText("Status", "CaptionID='Status'"); - $this->assertElementPresent("//input[@id='RatingList_c0']/../../../td[contains(@class, 'rating_selected')]"); - $this->assertElementPresent("//input[@id='RatingList_c1']/../../../td[contains(@class, 'rating_selected')]"); - $this->assertElementPresent("//input[@id='RatingList_c2']/../../../td[contains(@class, 'rating_selected')]"); - $this->assertElementPresent("//input[@id='RatingList_c3']/../../../td[not(contains(@class, 'rating_selected'))]"); - $this->assertElementPresent("//input[@id='RatingList_c3']/../../../td[contains(@class, 'rating')]"); - $this->assertElementPresent("//input[@id='RatingList_c4']/../../../td[contains(@class, 'rating')]"); - $this->assertElementPresent("//input[@id='RatingList_c5']/../../../td[contains(@class, 'rating')]"); - - - $this->mouseOver("//input[@id='RatingList_c1']/../../"); - $this->assertText("Status", "Fair"); - - $this->click("//input[@id='RatingList_c1']/../../"); - $this->pause(800); - $this->assertText("Status", "2 : Fair"); - $this->assertElementPresent("//input[@id='RatingList_c0']/../../../td[contains(@class, 'rating_selected')]"); - $this->assertElementPresent("//input[@id='RatingList_c1']/../../../td[contains(@class, 'rating_selected')]"); - $this->assertElementPresent("//input[@id='RatingList_c2']/../../../td[not(contains(@class, 'rating_selected'))]"); - $this->assertElementPresent("//input[@id='RatingList_c2']/../../../td[contains(@class, 'rating')]"); - $this->assertElementPresent("//input[@id='RatingList_c3']/../../../td[contains(@class, 'rating')]"); - $this->assertElementPresent("//input[@id='RatingList_c4']/../../../td[contains(@class, 'rating')]"); - $this->assertElementPresent("//input[@id='RatingList_c5']/../../../td[contains(@class, 'rating')]"); + $this->url("active-controls/index.php?page=ActiveRatingListHoverCaptionTest"); + $this->assertContains("TActiveRatingList Hover Caption Test Case", $this->source()); + $this->assertText("{$base}Status", "CaptionID='Status'"); + $this->assertElementPresent("//input[@id='{$base}RatingList_c0']/../../../td[contains(@class, 'rating_selected')]"); + $this->assertElementPresent("//input[@id='{$base}RatingList_c1']/../../../td[contains(@class, 'rating_selected')]"); + $this->assertElementPresent("//input[@id='{$base}RatingList_c2']/../../../td[contains(@class, 'rating_selected')]"); + $this->assertElementPresent("//input[@id='{$base}RatingList_c3']/../../../td[contains(@class, 'rating_half')]"); + $this->assertElementPresent("//input[@id='{$base}RatingList_c3']/../../../td[contains(@class, 'rating')]"); + $this->assertElementPresent("//input[@id='{$base}RatingList_c4']/../../../td[contains(@class, 'rating')]"); + $this->assertElementPresent("//input[@id='{$base}RatingList_c5']/../../../td[contains(@class, 'rating')]"); + + $this->moveto($this->byXPath("//input[@id='{$base}RatingList_c4']/../..")); + $this->assertText("{$base}Status", "Excellent"); + $this->assertElementPresent("//input[@id='{$base}RatingList_c0']/../../../td[contains(@class, 'rating_hover')]"); + $this->assertElementPresent("//input[@id='{$base}RatingList_c1']/../../../td[contains(@class, 'rating_hover')]"); + $this->assertElementPresent("//input[@id='{$base}RatingList_c2']/../../../td[contains(@class, 'rating_hover')]"); + $this->assertElementPresent("//input[@id='{$base}RatingList_c3']/../../../td[contains(@class, 'rating_hover')]"); + $this->assertElementPresent("//input[@id='{$base}RatingList_c4']/../../../td[contains(@class, 'rating_hover')]"); + $this->assertElementPresent("//input[@id='{$base}RatingList_c5']/../../../td[not(contains(@class, 'rating_hover'))]"); + $this->assertElementPresent("//input[@id='{$base}RatingList_c5']/../../../td[contains(@class, 'rating')]"); + + $this->moveto($this->byCssSelector('body')); + $this->assertText("{$base}Status", "CaptionID='Status'"); + $this->assertElementPresent("//input[@id='{$base}RatingList_c0']/../../../td[contains(@class, 'rating_selected')]"); + $this->assertElementPresent("//input[@id='{$base}RatingList_c1']/../../../td[contains(@class, 'rating_selected')]"); + $this->assertElementPresent("//input[@id='{$base}RatingList_c2']/../../../td[contains(@class, 'rating_selected')]"); + $this->assertElementPresent("//input[@id='{$base}RatingList_c3']/../../../td[not(contains(@class, 'rating_selected'))]"); + $this->assertElementPresent("//input[@id='{$base}RatingList_c3']/../../../td[contains(@class, 'rating')]"); + $this->assertElementPresent("//input[@id='{$base}RatingList_c4']/../../../td[contains(@class, 'rating')]"); + $this->assertElementPresent("//input[@id='{$base}RatingList_c5']/../../../td[contains(@class, 'rating')]"); + + + $this->moveto($this->byXPath("//input[@id='{$base}RatingList_c1']/../..")); + $this->assertText("{$base}Status", "Fair"); + + $this->byXPath("//input[@id='{$base}RatingList_c1']/../..")->click(); + $this->pause(800); + $this->assertText("{$base}Status", "2 : Fair"); + $this->assertElementPresent("//input[@id='{$base}RatingList_c0']/../../../td[contains(@class, 'rating_selected')]"); + $this->assertElementPresent("//input[@id='{$base}RatingList_c1']/../../../td[contains(@class, 'rating_selected')]"); + $this->assertElementPresent("//input[@id='{$base}RatingList_c2']/../../../td[not(contains(@class, 'rating_selected'))]"); + $this->assertElementPresent("//input[@id='{$base}RatingList_c2']/../../../td[contains(@class, 'rating')]"); + $this->assertElementPresent("//input[@id='{$base}RatingList_c3']/../../../td[contains(@class, 'rating')]"); + $this->assertElementPresent("//input[@id='{$base}RatingList_c4']/../../../td[contains(@class, 'rating')]"); + $this->assertElementPresent("//input[@id='{$base}RatingList_c5']/../../../td[contains(@class, 'rating')]"); } - + function clickTD($clientID){ - $this->click("//input[@id='{$clientID}']/../.."); + $this->byXPath("//input[@id='{$clientID}']/../..")->click(); } function assertCheckBoxes($clientID, $checks, $total = 5) @@ -244,9 +252,9 @@ class ActiveRatingListTestCase extends PradoGenericSeleniumTest for($i = 0; $i < $total; $i++) { if(in_array($i, $checks)) - $this->assertChecked("{$clientID}_c{$i}"); + $this->assertTrue($this->byId("{$clientID}_c{$i}")->selected()); else - $this->assertNotChecked("{$clientID}_c{$i}"); + $this->assertFalse($this->byId("{$clientID}_c{$i}")->selected()); } } }
\ No newline at end of file diff --git a/tests/FunctionalTests/features/protected/controls/Layout.tpl b/tests/FunctionalTests/features/protected/controls/Layout.tpl index dbd433b8..66b42f6c 100755 --- a/tests/FunctionalTests/features/protected/controls/Layout.tpl +++ b/tests/FunctionalTests/features/protected/controls/Layout.tpl @@ -27,7 +27,6 @@ <body>
<com:TForm>
<com:TContentPlaceHolder ID="Content" />
-<com:TJavascriptLogger />
</com:TForm>
</body>
</html>
\ No newline at end of file diff --git a/tests/FunctionalTests/features/protected/pages/I18N/BasicI18N.php b/tests/FunctionalTests/features/protected/pages/I18N/BasicI18N.php index d4a98e26..5292affb 100755 --- a/tests/FunctionalTests/features/protected/pages/I18N/BasicI18N.php +++ b/tests/FunctionalTests/features/protected/pages/I18N/BasicI18N.php @@ -22,23 +22,23 @@ class BasicI18N extends TPage * @version $Revision: 1.66 $ $Date: ${DATE} ${TIME} $ * @package ${package} *//* -class BasicI18NTestCase extends PradoGenericSeleniumTest +class BasicI18NTestCase extends PradoGenericSelenium2Test { function setup() { $page = Prado::getApplication()->getTestPage(__FILE__); - $this->open($page); + $this->url($page); } function testI18N() { - $this->verifyTitle("Basic I18N Test", ""); - $this->verifyTextPresent("Hello", ""); - $this->verifyTextPresent("US$10,000.00", ""); - $this->verifyTextPresent("2006年1月15日 上午12时00分00秒", ""); - $this->verifyTextPresent("None", ""); - $this->verifyTextPresent("One thing.", ""); - $this->verifyTextPresent("Many things.", ""); + $this->assertEquals("Basic I18N Test", $this->title()); + $this->assertContains("Hello", $this->source()); + $this->assertContains("US$10,000.00", $this->source()); + $this->assertContains("2006年1月15日 上午12时00分00秒", $this->source()); + $this->assertContains("None", $this->source()); + $this->assertContains("One thing.", $this->source()); + $this->assertContains("Many things.", $this->source()); } } */
\ No newline at end of file diff --git a/tests/FunctionalTests/features/protected/pages/RatingList.page b/tests/FunctionalTests/features/protected/pages/RatingList.page index 909180c7..eaf9a282 100755 --- a/tests/FunctionalTests/features/protected/pages/RatingList.page +++ b/tests/FunctionalTests/features/protected/pages/RatingList.page @@ -2,40 +2,46 @@ <h1>TRatingList Examples</h1>
<h2>Default TRatingList</h2>
- <com:TRatingList RepeatDirection="Vertical" Style="caption-side: right;">
+ <com:TLabel ID="label1" Text="Rate it:" />
+ <com:TRatingList CaptionID="label1">
<com:TListItem Text="Fair" />
<com:TListItem Text="Average" />
<com:TListItem Text="Good" />
- <com:TListItem Text="Execellent" />
+ <com:TListItem Text="Excellent" />
</com:TRatingList>
-<h2>TRatingList </h2>
- <com:TRatingList SelectedIndex="2">
+<h2>TRatingList in vertical mode, SelectedIndex=2</h2>
+ <com:TLabel ID="label2" Text="Rate it:" />
+ <com:TRatingList CaptionID="label2" SelectedIndex="2" RepeatDirection="Vertical" Style="caption-side: right;">
<com:TListItem Text="Poor" />
<com:TListItem Text="Fair" />
<com:TListItem Text="Average" />
<com:TListItem Text="Good" />
- <com:TListItem Text="Execellent" />
+ <com:TListItem Text="Excellent" />
<com:TListItem Text="Super" />
</com:TRatingList>
-<h2>TRatingList </h2>
- <com:TRatingList RatingStyle="blocks" SelectedValue="Good">
+<h2>TRatingList with RatingStyle=blocks, AutoPostback=true, SelectedValue=Good</h2>
+ <com:TLabel ID="label3" Text="Rate it:" />
+ <com:TRatingList ID="Rating3" CaptionID="label3" RatingStyle="blocks" SelectedValue="Good" AutoPostBack="true" OnSelectedIndexChanged="rating3_selectionChanged">
<com:TListItem Text="Poor" />
<com:TListItem Text="Fair" />
<com:TListItem Text="Average" />
<com:TListItem Text="Good" />
- <com:TListItem Text="Execellent" />
+ <com:TListItem Text="Excellent" />
<com:TListItem Text="Super" />
</com:TRatingList>
+ Postback result: <com:TLabel ID="labelResult3" />
-<h2>TRatingList </h2>
- <com:TRatingList ID="Rating1" AllowInput="false" Caption="Rating:" Rating="4.6">
+<h2>TRatingList with AllowInput=false, Rating=4.6</h2>
+ <com:TLabel ID="label4" Text="Rate it:" />
+ <com:TRatingList CaptionID="label4" AllowInput="false" Rating="4.6">
<com:TListItem Text="Poor" />
<com:TListItem Text="Fair" />
<com:TListItem Text="Average" />
<com:TListItem Text="Good" />
- <com:TListItem Text="Execellent" />
+ <com:TListItem Text="Excellent" />
<com:TListItem Text="Super" />
- </com:TRatingList>
+ </com:TRatingList>
+
</com:TContent>
\ No newline at end of file diff --git a/tests/FunctionalTests/features/protected/pages/RatingList.php b/tests/FunctionalTests/features/protected/pages/RatingList.php new file mode 100755 index 00000000..9592680a --- /dev/null +++ b/tests/FunctionalTests/features/protected/pages/RatingList.php @@ -0,0 +1,9 @@ +<?php + +class RatingList extends TPage +{ + protected function rating3_selectionChanged($sender, $param) + { + $this->labelResult3->Text=$this->Rating3->SelectedValue; + } +}
\ No newline at end of file diff --git a/tests/FunctionalTests/features/tests/MyTestCase.php b/tests/FunctionalTests/features/tests/MyTestCase.php index 92b0886a..d748b6b0 100755 --- a/tests/FunctionalTests/features/tests/MyTestCase.php +++ b/tests/FunctionalTests/features/tests/MyTestCase.php @@ -1,10 +1,10 @@ <?php -class MyTestCase extends PradoGenericSeleniumTest +class MyTestCase extends PradoGenericSelenium2Test { function test1() { - $this->open('http://127.0.0.1'); - $this->assertTextNotPresent('asd'); + $this->url('http://127.0.0.1'); + $this->assertNotContains('asd', $this->source()); } } diff --git a/tests/FunctionalTests/issues/protected/pages/Issue516.page b/tests/FunctionalTests/issues/protected/pages/Issue516.page new file mode 100644 index 00000000..c922c6e1 --- /dev/null +++ b/tests/FunctionalTests/issues/protected/pages/Issue516.page @@ -0,0 +1,50 @@ + <com:TContent ID="Content"> + +<h1>Issue 516 Test</h1> + +<com:TActiveDataGrid + Width="800px" + CellPadding="2" + ID="DataGrid" + DataKeyField="ISBN" + AutoGenerateColumns="false" + HeaderStyle.BackColor="black" + HeaderStyle.ForeColor="white" + ItemStyle.BackColor="#BFCFFF" + ItemStyle.Font.Italic="true" + AlternatingItemStyle.BackColor="#E6ECFF" + EditItemStyle.BackColor="lightyellow" + OnEditCommand="editItem" + OnUpdateCommand="saveItem" + OnCancelCommand="cancelItem" + > + <com:TTemplateColumn + ID="BookTitleColumn" + HeaderText="Book Title" + HeaderStyle.Width="400px" + > + <prop:ItemTemplate> + <com:TLiteral Text="<%# $this->Parent->Data['title'] %>" Encode="true" /> + </prop:ItemTemplate> + <prop:EditItemTemplate> + <com:TTextBox ID="TextBox" Text="<%# $this->Parent->Data['title'] %>" /> + <com:TRequiredFieldValidator + ControlToValidate="TextBox" + Display="Dynamic" + ErrorMessage="<br/>Please provide a title." + ValidationGroup = "Group1" + /> + </prop:EditItemTemplate> + </com:TTemplateColumn> + <com:TActiveEditCommandColumn + HeaderText="Edit" + HeaderStyle.Width="100px" + UpdateText="Save" + ItemStyle.HorizontalAlign="Center" + ItemStyle.Font.Italic="false" + ValidationGroup = "Group1" + /> +</com:TActiveDataGrid> + + </com:TContent> + diff --git a/tests/FunctionalTests/issues/protected/pages/Issue516.php b/tests/FunctionalTests/issues/protected/pages/Issue516.php new file mode 100644 index 00000000..bd3e7a72 --- /dev/null +++ b/tests/FunctionalTests/issues/protected/pages/Issue516.php @@ -0,0 +1,115 @@ +<?php + +Prado::using('System.Web.UI.ActiveControls.*'); + +class Issue516 extends TPage +{ + private $_data=null; + + protected function getData() + { + if($this->_data===null) + $this->loadData(); + return $this->_data; + } + + protected function loadData() + { + // We use viewstate keep track of data. + // In real applications, data should come from database using an SQL SELECT statement. + // In the following tabular data, field 'ISBN' is the primary key. + // All update and delete operations should come with an 'id' value in order to go through. + if(($this->_data=$this->getViewState('Data',null))===null) + { + $this->_data=array( + array( + 'ISBN'=>'0596007124', + 'title'=>'', + ), + array( + 'ISBN'=>'0201633612', + 'title'=>'Design Patterns: Elements of Reusable Object-Oriented Software', + ), + array( + 'ISBN'=>'0321247140', + 'title'=>'Design Patterns Explained : A New Perspective on Object-Oriented Design', + ), + array( + 'ISBN'=>'0201485672', + 'title'=>'Refactoring: Improving the Design of Existing Code', + ), + array( + 'ISBN'=>'0321213351', + 'title'=>'Refactoring to Patterns', + ), + array( + 'ISBN'=>'0735619670', + 'title'=>'Code Complete', + ), + array( + 'ISBN'=>'0321278658 ', + 'title'=>'Extreme Programming Explained : Embrace Change', + ), + ); + $this->saveData(); + } + } + + protected function saveData() + { + $this->setViewState('Data',$this->_data); + } + + protected function updateBook($isbn,$title) + { + // In real applications, data should be saved to database using an SQL UPDATE statement + if($this->_data===null) + $this->loadData(); + $updateRow=null; + foreach($this->_data as $index=>$row) + if($row['ISBN']===$isbn) + $updateRow=&$this->_data[$index]; + if($updateRow!==null) + { + $updateRow['title']=$title; + $this->saveData(); + } + } + + public function onLoad($param) + { + parent::onLoad($param); + if(!$this->IsPostBack && !$this->IsCallBack) + { + $this->DataGrid->DataSource=$this->Data; + $this->DataGrid->dataBind(); + } + } + + public function editItem($sender,$param) + { + $this->DataGrid->EditItemIndex=$param->Item->ItemIndex; + $this->DataGrid->DataSource=$this->Data; + $this->DataGrid->dataBind(); + } + + public function saveItem($sender,$param) + { + $item=$param->Item; + $this->updateBook( + $this->DataGrid->DataKeys[$item->ItemIndex], // ISBN + $item->BookTitleColumn->TextBox->Text // title + ); + $this->DataGrid->EditItemIndex=-1; + $this->DataGrid->DataSource=$this->Data; + $this->DataGrid->dataBind(); + } + + public function cancelItem($sender,$param) + { + $this->DataGrid->EditItemIndex=-1; + $this->DataGrid->DataSource=$this->Data; + $this->DataGrid->dataBind(); + } + +} diff --git a/tests/FunctionalTests/issues/tests/Issue516TestCase.php b/tests/FunctionalTests/issues/tests/Issue516TestCase.php new file mode 100644 index 00000000..363e9f84 --- /dev/null +++ b/tests/FunctionalTests/issues/tests/Issue516TestCase.php @@ -0,0 +1,37 @@ +<?php + +class Issue516TestCase extends PradoGenericSelenium2Test +{ + function test() + { + $this->url('issues/index.php?page=Issue516'); + $this->assertContains('Issue 516 Test', $this->source()); + $base='ctl0_Content_'; + $row1='DataGrid_ctl1_'; + $row2='DataGrid_ctl2_'; + + // click "edit" and check for textbox + $this->byID("{$base}{$row1}ctl3")->click(); + $this->pause(800); + $this->assertElementPresent("{$base}{$row1}TextBox"); + // click "save" and check for validator + $this->byID("{$base}{$row1}ctl3")->click(); + $this->pause(800); + $this->assertEquals('Please provide a title.', $this->getElement("{$base}{$row1}ctl1")->text()); + // click "cancel" and ensure validator has disappeared + $this->byID("{$base}{$row1}ctl4")->click(); + $this->pause(800); + $this->assertElementNotPresent("{$base}{$row1}ctl1"); + + // click "edit" and check for textbox on the second row + $this->byID("{$base}{$row2}ctl3")->click(); + $this->pause(800); + $this->assertTrue($this->getElement("{$base}{$row2}TextBox")!==null); + // click "save" and ensure bvalidation has been successfull + $this->byID("{$base}{$row2}ctl3")->click(); + $this->pause(800); + $this->assertElementNotPresent("{$base}{$row2}ctl1"); + $this->assertElementNotPresent("{$base}{$row2}TextBox"); + $this->assertEquals('Edit', $this->getElement("{$base}{$row2}ctl3")->text()); + } +} diff --git a/tests/FunctionalTests/quickstart/ActiveControls/ActiveButtonTestCase.php b/tests/FunctionalTests/quickstart/ActiveControls/ActiveButtonTestCase.php index 03861440..9d816978 100755 --- a/tests/FunctionalTests/quickstart/ActiveControls/ActiveButtonTestCase.php +++ b/tests/FunctionalTests/quickstart/ActiveControls/ActiveButtonTestCase.php @@ -1,36 +1,36 @@ <?php //$Id: ActiveButtonTestCase.php 3187 2012-07-12 11:21:01Z ctrlaltca $ -class QuickstartActiveButtonTestCase extends PradoGenericSeleniumTest +class QuickstartActiveButtonTestCase extends PradoGenericSelenium2Test { function test () { - $this->open("../../demos/quickstart/index.php?page=ActiveControls.Samples.TActiveButton.Home&notheme=true&lang=en"); + $this->url("../../demos/quickstart/index.php?page=ActiveControls.Samples.TActiveButton.Home&notheme=true&lang=en"); - $this->verifyTitle("PRADO QuickStart Sample", ""); + $this->assertEquals("PRADO QuickStart Sample", $this->title()); - $this->assertTextPresent('TActiveButton Samples (AJAX)'); + $this->assertContains('TActiveButton Samples (AJAX)', $this->source()); // a click button - $this->verifyElementNotPresent("//input[@type='submit' and @value=\"I'm clicked\"]"); - $this->click("//input[@type='submit' and @value='click me']", ""); + $this->assertElementNotPresent("//input[@type='submit' and @value=\"I'm clicked\"]"); + $this->byXPath("//input[@type='submit' and @value='click me']")->click(); $this->pause(800); - $this->verifyElementPresent("//input[@type='submit' and @value=\"I'm clicked\"]"); + $this->assertElementPresent("//input[@type='submit' and @value=\"I'm clicked\"]"); // a command button - $this->verifyElementNotPresent("//input[@type='submit' and @value=\"Name: test, Param: value using callback\"]"); - $this->click("//input[@type='submit' and @value='click me']", ""); + $this->assertElementNotPresent("//input[@type='submit' and @value=\"Name: test, Param: value using callback\"]"); + $this->byXPath("//input[@type='submit' and @value='click me']")->click(); $this->pause(800); - $this->verifyElementPresent("//input[@type='submit' and @value=\"Name: test, Param: value using callback\"]"); + $this->assertElementPresent("//input[@type='submit' and @value=\"Name: test, Param: value using callback\"]"); // a button causing validation - $this->verifyNotVisible('ctl0_body_ctl2'); - $this->click("//input[@type='submit' and @value='submit']", ""); + $this->assertNotVisible('ctl0_body_ctl2'); + $this->byXPath("//input[@type='submit' and @value='submit']")->click(); $this->pause(800); - $this->verifyVisible('ctl0_body_ctl2'); + $this->assertVisible('ctl0_body_ctl2'); $this->type("ctl0\$body\$TextBox", "test"); - $this->click("//input[@type='submit' and @value='submit']", ""); + $this->byXPath("//input[@type='submit' and @value='submit']")->click(); $this->pause(800); - $this->verifyNotVisible('ctl0_body_ctl2'); - $this->verifyElementPresent("//input[@type='submit' and @value=\"I'm clicked using callback\"]", ""); + $this->assertNotVisible('ctl0_body_ctl2'); + $this->assertElementPresent("//input[@type='submit' and @value=\"I'm clicked using callback\"]", ""); } } diff --git a/tests/FunctionalTests/quickstart/ActiveControls/ActiveCheckBoxTestCase.php b/tests/FunctionalTests/quickstart/ActiveControls/ActiveCheckBoxTestCase.php index 257917ec..9e537abd 100755 --- a/tests/FunctionalTests/quickstart/ActiveControls/ActiveCheckBoxTestCase.php +++ b/tests/FunctionalTests/quickstart/ActiveControls/ActiveCheckBoxTestCase.php @@ -1,58 +1,57 @@ <?php //$Id: ActiveCheckBoxTestCase.php 3187 2012-07-12 11:21:01Z ctrlaltca $ -class QuickstartActiveCheckBoxTestCase extends PradoGenericSeleniumTest +class QuickstartActiveCheckBoxTestCase extends PradoGenericSelenium2Test { function test () { - $this->setSpeed(500); - $this->open("../../demos/quickstart/index.php?page=ActiveControls.Samples.TActiveCheckBox.Home&notheme=true&lang=en", ""); + $this->url("../../demos/quickstart/index.php?page=ActiveControls.Samples.TActiveCheckBox.Home&notheme=true&lang=en"); - $this->verifyTitle("PRADO QuickStart Sample", ""); + $this->assertEquals("PRADO QuickStart Sample", $this->title()); - $this->assertTextPresent('TActiveCheckBox Samples (AJAX)'); + $this->assertContains('TActiveCheckBox Samples (AJAX)', $this->source()); // an auto postback checkbox - $this->verifyTextNotPresent("ctl0_body_ctl0 clicked using callback"); - $this->click("//input[@name='ctl0\$body\$ctl0']"); + $this->assertNotContains("ctl0_body_ctl0 clicked using callback", $this->source()); + $this->byXPath("//input[@name='ctl0\$body\$ctl0']")->click(); $this->pause(800); - $this->assertChecked("//input[@name='ctl0\$body\$ctl0']"); - $this->verifyTextPresent("ctl0_body_ctl0 clicked using callback"); - $this->click("//input[@name='ctl0\$body\$ctl0']"); + $this->assertTrue($this->byXPath("//input[@name='ctl0\$body\$ctl0']")->selected()); + $this->assertContains("ctl0_body_ctl0 clicked using callback", $this->source()); + $this->byXPath("//input[@name='ctl0\$body\$ctl0']")->click(); $this->pause(800); - $this->verifyTextPresent("ctl0_body_ctl0 clicked using callback"); - $this->assertNotChecked("//input[@name='ctl0\$body\$ctl0']"); + $this->assertContains("ctl0_body_ctl0 clicked using callback", $this->source()); + $this->assertFalse($this->byXPath("//input[@name='ctl0\$body\$ctl0']")->selected()); // a checkbox causing validation on a textbox - $this->verifyNotVisible('ctl0_body_ctl1'); - $this->click("//input[@name='ctl0\$body\$ctl2']"); - $this->verifyVisible('ctl0_body_ctl1'); - $this->click("//input[@name='ctl0\$body\$ctl2']", ""); - $this->verifyVisible('ctl0_body_ctl3'); + $this->assertNotVisible('ctl0_body_ctl1'); + $this->byXPath("//input[@name='ctl0\$body\$ctl2']")->click(); + $this->assertVisible('ctl0_body_ctl1'); + $this->byXPath("//input[@name='ctl0\$body\$ctl2']")->click(); + $this->assertVisible('ctl0_body_ctl3'); $this->type("ctl0\$body\$TextBox", "test"); - $this->click("//input[@name='ctl0\$body\$ctl2']", ""); + $this->byXPath("//input[@name='ctl0\$body\$ctl2']")->click(); $this->pause(800); - $this->verifyNotVisible('ctl0_body_ctl1'); - $this->assertTextPresent("ctl0_body_ctl2 clicked using callback"); + $this->assertNotVisible('ctl0_body_ctl1'); + $this->assertContains("ctl0_body_ctl2 clicked using callback", $this->source()); // a checkbox validated by a required field validator - $this->assertNotChecked("//input[@name='ctl0\$body\$CheckBox']"); - $this->verifyNotVisible('ctl0_body_ctl4'); - $this->click("//input[@type='submit' and @value='Submit']", ""); - $this->verifyVisible('ctl0_body_ctl4'); - $this->click("//input[@name='ctl0\$body\$CheckBox']", ""); - $this->assertChecked("//input[@name='ctl0\$body\$CheckBox']"); - $this->click("//input[@type='submit' and @value='Submit']", ""); - $this->verifyNotVisible('ctl0_body_ctl4'); - $this->assertTextPresent("ctl0_body_CheckBox clicked"); + $this->assertFalse($this->byXPath("//input[@name='ctl0\$body\$CheckBox']")->selected()); + $this->assertNotVisible('ctl0_body_ctl4'); + $this->byXPath("//input[@type='submit' and @value='Submit']")->click(); + $this->assertVisible('ctl0_body_ctl4'); + $this->byXPath("//input[@name='ctl0\$body\$CheckBox']")->click(); + $this->assertTrue($this->byXPath("//input[@name='ctl0\$body\$CheckBox']")->selected()); + $this->byXPath("//input[@type='submit' and @value='Submit']")->click(); + $this->pause(800); + $this->assertNotVisible('ctl0_body_ctl4'); + $this->assertContains("ctl0_body_CheckBox clicked", $this->source()); // a checkbox validated by a required field validator using AutoPostBack - $this->assertChecked("//input[@name='ctl0\$body\$CheckBox2']"); - $this->verifyNotVisible('ctl0_body_ctl5'); - $this->click("//input[@name='ctl0\$body\$CheckBox2']", ""); - $this->verifyVisible('ctl0_body_ctl5'); - $this->assertChecked("//input[@name='ctl0\$body\$CheckBox2']"); - $this->setSpeed(0); + $this->assertTrue($this->byXPath("//input[@name='ctl0\$body\$CheckBox2']")->selected()); + $this->assertNotVisible('ctl0_body_ctl5'); + $this->byXPath("//input[@name='ctl0\$body\$CheckBox2']")->click(); + $this->assertVisible('ctl0_body_ctl5'); + $this->assertTrue($this->byXPath("//input[@name='ctl0\$body\$CheckBox2']")->selected()); } } diff --git a/tests/FunctionalTests/quickstart/ActiveControls/ActiveCustomValidatorTestCase.php b/tests/FunctionalTests/quickstart/ActiveControls/ActiveCustomValidatorTestCase.php index 967842b0..7cb29382 100755 --- a/tests/FunctionalTests/quickstart/ActiveControls/ActiveCustomValidatorTestCase.php +++ b/tests/FunctionalTests/quickstart/ActiveControls/ActiveCustomValidatorTestCase.php @@ -1,19 +1,19 @@ <?php //$Id: ActiveButtonTestCase.php 1405 2006-09-10 01:03:56Z wei $ -class QuickstartActiveCustomValidatorTestCase extends PradoGenericSeleniumTest +class QuickstartActiveCustomValidatorTestCase extends PradoGenericSelenium2Test { function test () { - $this->open("../../demos/quickstart/index.php?page=ActiveControls.Samples.TActiveCustomValidator.Home&notheme=true&lang=en"); + $this->url("../../demos/quickstart/index.php?page=ActiveControls.Samples.TActiveCustomValidator.Home&notheme=true&lang=en"); - $this->verifyTitle("PRADO QuickStart Sample", ""); + $this->assertEquals("PRADO QuickStart Sample", $this->title()); - $this->assertTextPresent('TActiveCustomValidator Samples (AJAX)'); + $this->assertContains('TActiveCustomValidator Samples (AJAX)', $this->source()); $base = 'ctl0_body_'; $this->assertNotVisible($base.'validator1'); - $this->click($base.'button1'); + $this->byId($base.'button1')->click(); $this->pause(800); $this->assertVisible($base.'validator1'); @@ -25,7 +25,7 @@ class QuickstartActiveCustomValidatorTestCase extends PradoGenericSeleniumTest $this->pause(800); $this->assertVisible($base.'validator1'); - $this->click($base.'button1'); + $this->byId($base.'button1')->click(); $this->pause(800); $this->assertNotVisible($base.'validator1'); } diff --git a/tests/FunctionalTests/quickstart/Advanced/I18N.php b/tests/FunctionalTests/quickstart/Advanced/I18N.php index 726501ce..ccb8c961 100755 --- a/tests/FunctionalTests/quickstart/Advanced/I18N.php +++ b/tests/FunctionalTests/quickstart/Advanced/I18N.php @@ -1,52 +1,52 @@ <?php //New Test -class QuickstartI18NTestCase extends PradoGenericSeleniumTest +class QuickstartI18NTestCase extends PradoGenericSelenium2Test { function test () { - $this->open("../../demos/quickstart/index.php?notheme=true&page=Advanced.Samples.I18N.Home&lang=en&notheme=true", ""); - $this->verifyTextPresent("Internationlization in PRADO", ""); - $this->verifyTextPresent("46.412,42 €", ""); - $this->verifyTextPresent("$12.40", ""); - $this->verifyTextPresent("€100.00", ""); - $this->verifyTextPresent("December 6, 2004", ""); - $this->open("../../demos/quickstart/index.php?page=Advanced.Samples.I18N.Home&lang=zh&notheme=true", ""); - $this->verifyTextPresent("PRADO 国际化", ""); - $this->verifyTextPresent("2004 十二月", ""); - $this->verifyTextPresent("US$ 12.40", ""); - $this->verifyTextPresent("46.412,42 €", ""); - $this->verifyTextPresent("€100.00 ", ""); - $this->open("../../demos/quickstart/index.php?page=Advanced.Samples.I18N.Home&lang=zh_TW&notheme=true", ""); - $this->verifyTextPresent("PRADO 國際化", ""); - $this->verifyTextPresent("2004年12月6日", ""); - $this->verifyTextPresent("US$12.40", ""); - $this->verifyTextPresent("46.412,42 €", ""); - $this->verifyTextPresent("€100.00", ""); - $this->open("../../demos/quickstart/index.php?page=Advanced.Samples.I18N.Home&lang=de&notheme=true", ""); - $this->verifyTextPresent("Internationalisierung in PRADO", ""); - $this->verifyTextPresent("6. Dezember 2004 ", ""); - $this->verifyTextPresent("$ 12,40", ""); - $this->verifyTextPresent("46.412,42 €", ""); - $this->verifyTextPresent("€100.00", ""); - $this->open("../../demos/quickstart/index.php?page=Advanced.Samples.I18N.Home&lang=es&notheme=true", ""); - $this->verifyTextPresent("Internationlization en PRADO", ""); - $this->verifyTextPresent("6 de diciembre de 2004", ""); - $this->verifyTextPresent("US$12.40", ""); - $this->verifyTextPresent("46.412,42 €", ""); - $this->verifyTextPresent("€100.00", ""); - $this->open("../../demos/quickstart/index.php?page=Advanced.Samples.I18N.Home&lang=fr&notheme=true", ""); - $this->verifyTextPresent("Internationalisation avec PRADO", ""); - $this->verifyTextPresent("6 décembre 2004", ""); - $this->verifyTextPresent("12,40 $", ""); - $this->verifyTextPresent("46.412,42 €", ""); - $this->verifyTextPresent("€100.00", ""); - $this->open("../../demos/quickstart/index.php?page=Advanced.Samples.I18N.Home&lang=pl&notheme=true", ""); - $this->verifyTextPresent("Internacjonalizacja w PRADO", ""); - $this->verifyTextPresent("6 grudnia 2004", ""); - $this->verifyTextPresent("US$ 12,40", ""); - $this->verifyTextPresent("46.412,42 €", ""); - $this->verifyTextPresent("€100.00", ""); + $this->url("../../demos/quickstart/index.php?notheme=true&page=Advanced.Samples.I18N.Home&lang=en&notheme=true"); + $this->assertContains("Internationlization in PRADO", $this->source()); + $this->assertContains("46.412,42 €", $this->source()); + $this->assertContains("$12.40", $this->source()); + $this->assertContains("€100.00", $this->source()); + $this->assertContains("December 6, 2004", $this->source()); + $this->url("../../demos/quickstart/index.php?page=Advanced.Samples.I18N.Home&lang=zh&notheme=true"); + $this->assertContains("PRADO 国际化", $this->source()); + $this->assertContains("2004 十二月", $this->source()); + $this->assertContains("US$ 12.40", $this->source()); + $this->assertContains("46.412,42 €", $this->source()); + $this->assertContains("€100.00 ", $this->source()); + $this->url("../../demos/quickstart/index.php?page=Advanced.Samples.I18N.Home&lang=zh_TW&notheme=true"); + $this->assertContains("PRADO 國際化", $this->source()); + $this->assertContains("2004年12月6日", $this->source()); + $this->assertContains("US$12.40", $this->source()); + $this->assertContains("46.412,42 €", $this->source()); + $this->assertContains("€100.00", $this->source()); + $this->url("../../demos/quickstart/index.php?page=Advanced.Samples.I18N.Home&lang=de&notheme=true"); + $this->assertContains("Internationalisierung in PRADO", $this->source()); + $this->assertContains("6. Dezember 2004 ", $this->source()); + $this->assertContains("$ 12,40", $this->source()); + $this->assertContains("46.412,42 €", $this->source()); + $this->assertContains("€100.00", $this->source()); + $this->url("../../demos/quickstart/index.php?page=Advanced.Samples.I18N.Home&lang=es&notheme=true"); + $this->assertContains("Internationlization en PRADO", $this->source()); + $this->assertContains("6 de diciembre de 2004", $this->source()); + $this->assertContains("US$12.40", $this->source()); + $this->assertContains("46.412,42 €", $this->source()); + $this->assertContains("€100.00", $this->source()); + $this->url("../../demos/quickstart/index.php?page=Advanced.Samples.I18N.Home&lang=fr&notheme=true"); + $this->assertContains("Internationalisation avec PRADO", $this->source()); + $this->assertContains("6 décembre 2004", $this->source()); + $this->assertContains("12,40 $", $this->source()); + $this->assertContains("46.412,42 €", $this->source()); + $this->assertContains("€100.00", $this->source()); + $this->url("../../demos/quickstart/index.php?page=Advanced.Samples.I18N.Home&lang=pl&notheme=true"); + $this->assertContains("Internacjonalizacja w PRADO", $this->source()); + $this->assertContains("6 grudnia 2004", $this->source()); + $this->assertContains("US$ 12,40", $this->source()); + $this->assertContains("46.412,42 €", $this->source()); + $this->assertContains("€100.00", $this->source()); } } diff --git a/tests/FunctionalTests/quickstart/Controls/BulletedListTestCase.php b/tests/FunctionalTests/quickstart/Controls/BulletedListTestCase.php index 0b272428..a23f1d1d 100755 --- a/tests/FunctionalTests/quickstart/Controls/BulletedListTestCase.php +++ b/tests/FunctionalTests/quickstart/Controls/BulletedListTestCase.php @@ -1,36 +1,36 @@ <?php -class QuickstartBulletedListTestCase extends PradoGenericSeleniumTest +class QuickstartBulletedListTestCase extends PradoGenericSelenium2Test { function test() { - $this->open("../../demos/quickstart/index.php?page=Controls.Samples.TBulletedList.Home&notheme=true&lang=en", ""); + $this->url("../../demos/quickstart/index.php?page=Controls.Samples.TBulletedList.Home&notheme=true&lang=en"); // verify if all required texts are present - $this->verifyTextPresent('item 1',''); - $this->verifyTextPresent('item 2',''); - $this->verifyTextPresent('item 3',''); - $this->verifyTextPresent('item 4',''); - $this->verifyTextPresent('google',''); - $this->verifyTextPresent('yahoo',''); - $this->verifyTextPresent('amazon',''); + $this->assertContains('item 1', $this->source()); + $this->assertContains('item 2', $this->source()); + $this->assertContains('item 3', $this->source()); + $this->assertContains('item 4', $this->source()); + $this->assertContains('google', $this->source()); + $this->assertContains('yahoo', $this->source()); + $this->assertContains('amazon', $this->source()); // verify order list starting from 5 - $this->verifyElementPresent("//ol[@start='5']"); + $this->assertElementPresent("//ol[@start='5']"); // unable to verify styles // verify hyperlink list - $this->verifyElementPresent("//a[@href='http://www.google.com/']"); - $this->verifyElementPresent("//a[@href='http://www.yahoo.com/']"); - $this->verifyElementPresent("//a[@href='http://www.amazon.com/']"); + $this->assertElementPresent("//a[@href='http://www.google.com/']"); + $this->assertElementPresent("//a[@href='http://www.yahoo.com/']"); + $this->assertElementPresent("//a[@href='http://www.amazon.com/']"); // verify linkbutton list - $this->clickAndWait("id=ctl0_body_ctl40", ""); - $this->verifyTextPresent("You clicked google : http://www.google.com/.", ""); - $this->clickAndWait("id=ctl0_body_ctl41", ""); - $this->verifyTextPresent("You clicked yahoo : http://www.yahoo.com/.", ""); - $this->clickAndWait("id=ctl0_body_ctl42", ""); - $this->verifyTextPresent("You clicked amazon : http://www.amazon.com/.", ""); + $this->byId("ctl0_body_ctl40")->click(); + $this->assertContains("You clicked google : http://www.google.com/.", $this->source()); + $this->byId("ctl0_body_ctl41")->click(); + $this->assertContains("You clicked yahoo : http://www.yahoo.com/.", $this->source()); + $this->byId("ctl0_body_ctl42")->click(); + $this->assertContains("You clicked amazon : http://www.amazon.com/.", $this->source()); } } diff --git a/tests/FunctionalTests/quickstart/Controls/ButtonTestCase.php b/tests/FunctionalTests/quickstart/Controls/ButtonTestCase.php index ad84e1d0..f5a4a979 100755 --- a/tests/FunctionalTests/quickstart/Controls/ButtonTestCase.php +++ b/tests/FunctionalTests/quickstart/Controls/ButtonTestCase.php @@ -1,33 +1,33 @@ <?php -class QuickstartButtonTestCase extends PradoGenericSeleniumTest +class QuickstartButtonTestCase extends PradoGenericSelenium2Test { function test () { - $this->open("../../demos/quickstart/index.php?page=Controls.Samples.TButton.Home&notheme=true&lang=en", ""); + $this->url("../../demos/quickstart/index.php?page=Controls.Samples.TButton.Home&notheme=true&lang=en"); - $this->verifyTitle("PRADO QuickStart Sample", ""); + $this->assertEquals("PRADO QuickStart Sample", $this->title()); // a regular button - $this->clickAndWait("//input[@type='submit' and @value='text']", ""); + $this->byXPath("//input[@type='submit' and @value='text']")->click(); // a click button - $this->verifyElementNotPresent("//input[@type='submit' and @value=\"I'm clicked\"]"); - $this->clickAndWait("//input[@type='submit' and @value='click me']", ""); - $this->verifyElementPresent("//input[@type='submit' and @value=\"I'm clicked\"]"); + $this->assertElementNotPresent("//input[@type='submit' and @value=\"I'm clicked\"]"); + $this->byXPath("//input[@type='submit' and @value='click me']")->click(); + $this->assertElementPresent("//input[@type='submit' and @value=\"I'm clicked\"]"); // a command button - $this->verifyElementNotPresent("//input[@type='submit' and @value=\"Name: test, Param: value\"]"); - $this->clickAndWait("//input[@type='submit' and @value='click me']", ""); - $this->verifyElementPresent("//input[@type='submit' and @value=\"Name: test, Param: value\"]"); + $this->assertElementNotPresent("//input[@type='submit' and @value=\"Name: test, Param: value\"]"); + $this->byXPath("//input[@type='submit' and @value='click me']")->click(); + $this->assertElementPresent("//input[@type='submit' and @value=\"Name: test, Param: value\"]"); // a button causing validation - $this->verifyNotVisible('ctl0_body_ctl3'); - $this->click("//input[@type='submit' and @value='submit']", ""); + $this->assertNotVisible('ctl0_body_ctl3'); + $this->byXPath("//input[@type='submit' and @value='submit']")->click(); // $this->pause(1000); - $this->verifyVisible('ctl0_body_ctl3'); + $this->assertVisible('ctl0_body_ctl3'); $this->type("ctl0\$body\$TextBox", "test"); - $this->clickAndWait("//input[@type='submit' and @value='submit']", ""); - $this->verifyNotVisible('ctl0_body_ctl3'); + $this->byXPath("//input[@type='submit' and @value='submit']")->click(); + $this->assertNotVisible('ctl0_body_ctl3'); } } diff --git a/tests/FunctionalTests/quickstart/Controls/CheckBoxListTestCase.php b/tests/FunctionalTests/quickstart/Controls/CheckBoxListTestCase.php index 242bc815..781701cf 100755 --- a/tests/FunctionalTests/quickstart/Controls/CheckBoxListTestCase.php +++ b/tests/FunctionalTests/quickstart/Controls/CheckBoxListTestCase.php @@ -1,17 +1,17 @@ <?php //New Test -class QuickstartCheckBoxListTestCase extends PradoGenericSeleniumTest +class QuickstartCheckBoxListTestCase extends PradoGenericSelenium2Test { function test () { - $this->open("../../demos/quickstart/index.php?page=Controls.Samples.TCheckBoxList.Home&notheme=true&lang=en", ""); + $this->url("../../demos/quickstart/index.php?page=Controls.Samples.TCheckBoxList.Home&notheme=true&lang=en"); // Check box list with default settings: - $this->click("//input[@name='ctl0\$body\$ctl0\$c0' and @value='value 1']", ""); + $this->byXPath("//input[@name='ctl0\$body\$ctl0\$c0' and @value='value 1']")->click(); // Check box list with customized cellpadding, cellspacing, color and text alignment: - $this->click("//input[@name='ctl0\$body\$ctl1\$c1' and @value='value 2']", ""); + $this->byXPath("//input[@name='ctl0\$body\$ctl1\$c1' and @value='value 2']")->click(); // *** Currently unable to test the following cases: // Check box list with vertical (default) repeat direction @@ -20,33 +20,33 @@ class QuickstartCheckBoxListTestCase extends PradoGenericSeleniumTest // Check box list with flow layout and horizontal repeat direction: // Check box list's behavior upon postback - $this->click("//input[@name='ctl0\$body\$CheckBoxList\$c2' and @value='value 3']", ""); - $this->clickAndWait("//input[@type='submit' and @value='Submit']", ""); - $this->verifyTextPresent("Your selection is: (Index: 1, Value: value 2, Text: item 2)(Index: 2, Value: value 3, Text: item 3)(Index: 4, Value: value 5, Text: item 5)", ""); + $this->byXPath("//input[@name='ctl0\$body\$CheckBoxList\$c2' and @value='value 3']")->click(); + $this->byXPath("//input[@type='submit' and @value='Submit']")->click(); + $this->assertContains("Your selection is: (Index: 1, Value: value 2, Text: item 2)(Index: 2, Value: value 3, Text: item 3)(Index: 4, Value: value 5, Text: item 5)", $this->source()); // Auto postback check box list - $this->clickAndWait("//input[@name='ctl0\$body\$ctl7\$c1' and @value='value 2']", ""); - $this->verifyTextPresent("Your selection is: (Index: 4, Value: value 5, Text: item 5)", ""); + $this->byXPath("//input[@name='ctl0\$body\$ctl7\$c1' and @value='value 2']")->click(); + $this->assertContains("Your selection is: (Index: 4, Value: value 5, Text: item 5)", $this->source()); // Databind to an integer-indexed array - $this->clickAndWait("//input[@name='ctl0\$body\$DBCheckBoxList1\$c1' and @value='1']", ""); - $this->verifyTextPresent("Your selection is: (Index: 1, Value: 1, Text: item 2)", ""); + $this->byXPath("//input[@name='ctl0\$body\$DBCheckBoxList1\$c1' and @value='1']")->click(); + $this->assertContains("Your selection is: (Index: 1, Value: 1, Text: item 2)", $this->source()); // Databind to an associative array: - $this->clickAndWait("//input[@name='ctl0\$body\$DBCheckBoxList2\$c1' and @value='key 2']", ""); - $this->verifyTextPresent("Your selection is: (Index: 1, Value: key 2, Text: item 2)", ""); + $this->byXPath("//input[@name='ctl0\$body\$DBCheckBoxList2\$c1' and @value='key 2']")->click(); + $this->assertContains("Your selection is: (Index: 1, Value: key 2, Text: item 2)", $this->source()); // Databind with DataTextField and DataValueField specified - $this->clickAndWait("//input[@name='ctl0\$body\$DBCheckBoxList3\$c2' and @value='003']", ""); - $this->verifyTextPresent("Your selection is: (Index: 2, Value: 003, Text: Cary)", ""); + $this->byXPath("//input[@name='ctl0\$body\$DBCheckBoxList3\$c2' and @value='003']")->click(); + $this->assertContains("Your selection is: (Index: 2, Value: 003, Text: Cary)", $this->source()); // CheckBox list causing validation - $this->verifyNotVisible('ctl0_body_ctl8'); - $this->click("//input[@name='ctl0\$body\$ctl9\$c0' and @value='Agree']", ""); + $this->assertNotVisible('ctl0_body_ctl8'); + $this->byXPath("//input[@name='ctl0\$body\$ctl9\$c0' and @value='Agree']")->click(); // $this->pause(1000); - $this->verifyVisible('ctl0_body_ctl8'); + $this->assertVisible('ctl0_body_ctl8'); $this->type("ctl0\$body\$TextBox", "test"); - $this->clickAndWait("//input[@name='ctl0\$body\$ctl9\$c0' and @value='Agree']", ""); - $this->verifyNotVisible('ctl0_body_ctl8'); + $this->byXPath("//input[@name='ctl0\$body\$ctl9\$c0' and @value='Agree']")->click(); + $this->assertNotVisible('ctl0_body_ctl8'); } } diff --git a/tests/FunctionalTests/quickstart/Controls/CheckBoxTestCase.php b/tests/FunctionalTests/quickstart/Controls/CheckBoxTestCase.php index 57b50dd9..ca89b3a0 100755 --- a/tests/FunctionalTests/quickstart/Controls/CheckBoxTestCase.php +++ b/tests/FunctionalTests/quickstart/Controls/CheckBoxTestCase.php @@ -1,53 +1,53 @@ <?php -class QuickstartCheckBoxTestCase extends PradoGenericSeleniumTest +class QuickstartCheckBoxTestCase extends PradoGenericSelenium2Test { function test () { - $this->open("../../demos/quickstart/index.php?page=Controls.Samples.TCheckBox.Home&notheme=true&lang=en", ""); + $this->url("../../demos/quickstart/index.php?page=Controls.Samples.TCheckBox.Home&notheme=true&lang=en"); - $this->verifyTitle("PRADO QuickStart Sample", ""); + $this->assertEquals("PRADO QuickStart Sample", $this->title()); // a regular checkbox - $this->click("//input[@name='ctl0\$body\$ctl0']", ""); + $this->byXPath("//input[@name='ctl0\$body\$ctl0']")->click(); // a checkbox with customized value - $this->click("//input[@name='ctl0\$body\$ctl1' and @value='value']", ""); + $this->byXPath("//input[@name='ctl0\$body\$ctl1' and @value='value']")->click(); // an auto postback checkbox - $this->verifyTextNotPresent("I'm clicked"); - $this->clickAndWait("//input[@name='ctl0\$body\$ctl2']", ""); - $this->verifyTextPresent("I'm clicked"); - $this->clickAndWait("//input[@name='ctl0\$body\$ctl2']", ""); - $this->verifyTextPresent("I'm clicked"); + $this->assertNotContains("I'm clicked", $this->source()); + $this->byXPath("//input[@name='ctl0\$body\$ctl2']")->click(); + $this->assertContains("I'm clicked", $this->source()); + $this->byXPath("//input[@name='ctl0\$body\$ctl2']")->click(); + $this->assertContains("I'm clicked", $this->source()); // a checkbox causing validation on a textbox - $this->verifyNotVisible('ctl0_body_ctl3'); - $this->click("//input[@name='ctl0\$body\$ctl4']", ""); + $this->assertNotVisible('ctl0_body_ctl3'); + $this->byXPath("//input[@name='ctl0\$body\$ctl4']")->click(); // $this->pause(1000); - $this->verifyVisible('ctl0_body_ctl3'); - $this->click("//input[@name='ctl0\$body\$ctl4']", ""); + $this->assertVisible('ctl0_body_ctl3'); + $this->byXPath("//input[@name='ctl0\$body\$ctl4']")->click(); // $this->pause(1000); - $this->verifyVisible('ctl0_body_ctl3'); + $this->assertVisible('ctl0_body_ctl3'); $this->type("ctl0\$body\$TextBox", "test"); - $this->clickAndWait("//input[@name='ctl0\$body\$ctl4']", ""); - $this->verifyNotVisible('ctl0_body_ctl3'); + $this->byXPath("//input[@name='ctl0\$body\$ctl4']")->click(); + $this->assertNotVisible('ctl0_body_ctl3'); // a checkbox validated by a required field validator - $this->verifyNotVisible('ctl0_body_ctl6'); - $this->click("//input[@type='submit' and @value='Submit']", ""); + $this->assertNotVisible('ctl0_body_ctl6'); + $this->byXPath("//input[@type='submit' and @value='Submit']")->click(); // $this->pause(1000); - $this->verifyVisible('ctl0_body_ctl6'); - $this->click("//input[@name='ctl0\$body\$CheckBox']", ""); - $this->clickAndWait("//input[@type='submit' and @value='Submit']", ""); - $this->verifyNotVisible('ctl0_body_ctl6'); + $this->assertVisible('ctl0_body_ctl6'); + $this->byXPath("//input[@name='ctl0\$body\$CheckBox']")->click(); + $this->byXPath("//input[@type='submit' and @value='Submit']")->click(); + $this->assertNotVisible('ctl0_body_ctl6'); // a checkbox validated by a required field validator using AutoPostBack - $this->verifyNotVisible('ctl0_body_ctl7'); - $this->click("//input[@name='ctl0\$body\$CheckBox2']", ""); + $this->assertNotVisible('ctl0_body_ctl7'); + $this->byXPath("//input[@name='ctl0\$body\$CheckBox2']")->click(); // $this->pause(1000); - $this->verifyVisible('ctl0_body_ctl7'); -// $this->clickAndWait("//input[@name='ctl0\$body\$CheckBox2' and @value='ctl0\$body\$CheckBox2']", ""); -// $this->verifyNotVisible('ctl0_body_ctl7'); + $this->assertVisible('ctl0_body_ctl7'); +// $this->byXPath("//input[@name='ctl0\$body\$CheckBox2' and @value='ctl0\$body\$CheckBox2']")->click(); +// $this->assertNotVisible('ctl0_body_ctl7'); } } diff --git a/tests/FunctionalTests/quickstart/Controls/DataGrid1TestCase.php b/tests/FunctionalTests/quickstart/Controls/DataGrid1TestCase.php index 57ee92ae..4f4ca60a 100755 --- a/tests/FunctionalTests/quickstart/Controls/DataGrid1TestCase.php +++ b/tests/FunctionalTests/quickstart/Controls/DataGrid1TestCase.php @@ -1,29 +1,29 @@ <?php -class QuickstartDataGrid1TestCase extends PradoGenericSeleniumTest +class QuickstartDataGrid1TestCase extends PradoGenericSelenium2Test { function test() { - $this->open("../../demos/quickstart/index.php?page=Controls.Samples.TDataGrid.Sample1&notheme=true&lang=en", ""); + $this->url("../../demos/quickstart/index.php?page=Controls.Samples.TDataGrid.Sample1&notheme=true&lang=en"); // verify if all required texts are present - $this->verifyTextPresent('id',''); - $this->verifyTextPresent('name',''); - $this->verifyTextPresent('quantity',''); - $this->verifyTextPresent('price',''); - $this->verifyTextPresent('imported',''); - $this->verifyTextPresent('ITN001',''); - $this->verifyTextPresent('Motherboard',''); - $this->verifyTextPresent('100',''); - $this->verifyTextPresent('true',''); - $this->verifyTextPresent('ITN019',''); - $this->verifyTextPresent('Speaker',''); - $this->verifyTextPresent('35',''); - $this->verifyTextPresent('65',''); - $this->verifyTextPresent('false',''); + $this->assertContains('id', $this->source()); + $this->assertContains('name', $this->source()); + $this->assertContains('quantity', $this->source()); + $this->assertContains('price', $this->source()); + $this->assertContains('imported', $this->source()); + $this->assertContains('ITN001', $this->source()); + $this->assertContains('Motherboard', $this->source()); + $this->assertContains('100', $this->source()); + $this->assertContains('true', $this->source()); + $this->assertContains('ITN019', $this->source()); + $this->assertContains('Speaker', $this->source()); + $this->assertContains('35', $this->source()); + $this->assertContains('65', $this->source()); + $this->assertContains('false', $this->source()); // verify specific table tags - $this->verifyElementPresent("ctl0_body_DataGrid"); - $this->verifyAttribute("ctl0_body_DataGrid@cellpadding","2"); + $this->assertElementPresent("ctl0_body_DataGrid"); + $this->assertAttribute("ctl0_body_DataGrid@cellpadding","2"); } } diff --git a/tests/FunctionalTests/quickstart/Controls/DataGrid2TestCase.php b/tests/FunctionalTests/quickstart/Controls/DataGrid2TestCase.php index 7efd69cc..548b04e3 100755 --- a/tests/FunctionalTests/quickstart/Controls/DataGrid2TestCase.php +++ b/tests/FunctionalTests/quickstart/Controls/DataGrid2TestCase.php @@ -1,49 +1,49 @@ <?php -class QuickstartDataGrid2TestCase extends PradoGenericSeleniumTest +class QuickstartDataGrid2TestCase extends PradoGenericSelenium2Test { function test() { - $this->open("../../demos/quickstart/index.php?page=Controls.Samples.TDataGrid.Sample2&notheme=true&lang=en", ""); + $this->url("../../demos/quickstart/index.php?page=Controls.Samples.TDataGrid.Sample2&notheme=true&lang=en"); // verify if all required texts are present - $this->verifyTextPresent('Book Title',''); - $this->verifyTextPresent('Publisher',''); - $this->verifyTextPresent('Price',''); - $this->verifyTextPresent('In-stock',''); - $this->verifyTextPresent('Rating',''); + $this->assertContains('Book Title', $this->source()); + $this->assertContains('Publisher', $this->source()); + $this->assertContains('Price', $this->source()); + $this->assertContains('In-stock', $this->source()); + $this->assertContains('Rating', $this->source()); // verify book titles - $this->verifyElementPresent("//a[@href='http://www.amazon.com/gp/product/0596007124' and text()='Head First Design Patterns']",''); - $this->verifyElementPresent("//a[@href='http://www.amazon.com/gp/product/0321278658' and text()='Extreme Programming Explained : Embrace Change']",''); + $this->assertElementPresent("//a[@href='http://www.amazon.com/gp/product/0596007124' and text()='Head First Design Patterns']",''); + $this->assertElementPresent("//a[@href='http://www.amazon.com/gp/product/0321278658' and text()='Extreme Programming Explained : Embrace Change']",''); // verify publishers - $this->verifyTextPresent("O'Reilly Media, Inc.",''); - $this->verifyTextPresent("Addison-Wesley Professional",''); + $this->assertContains("O'Reilly Media, Inc.", $this->source()); + $this->assertContains("Addison-Wesley Professional", $this->source()); // verify prices - $this->verifyTextPresent("\$37.49",''); - $this->verifyTextPresent("\$38.49",''); + $this->assertContains("\$37.49", $this->source()); + $this->assertContains("\$38.49", $this->source()); // verify in-stock - $this->verifyAttribute('ctl0_body_DataGrid_ctl1_ctl5@checked','regexp:true|checked'); - $this->verifyAttribute('ctl0_body_DataGrid_ctl1_ctl5@disabled','regexp:true|disabled'); - $this->verifyAttribute('ctl0_body_DataGrid_ctl2_ctl5@checked','regexp:true|checked'); - $this->assertEquals($this->getEval('this.browserbot.findElement("ctl0_body_DataGrid_ctl6_ctl5").hasAttribute("checked")'), 'false'); - $this->verifyAttribute('ctl0_body_DataGrid_ctl6_ctl5@disabled','regexp:true|disabled'); + $this->assertAttribute('ctl0_body_DataGrid_ctl1_ctl5@checked','regexp:true|checked'); + $this->assertAttribute('ctl0_body_DataGrid_ctl1_ctl5@disabled','regexp:true|disabled'); + $this->assertAttribute('ctl0_body_DataGrid_ctl2_ctl5@checked','regexp:true|checked'); + $this->assertAttribute('ctl0_body_DataGrid_ctl6_ctl5@checked',null); + $this->assertAttribute('ctl0_body_DataGrid_ctl6_ctl5@disabled','regexp:true|disabled'); // verify ratings - //$this->verifyElementPresent("//img[@src='images/star5.gif']",''); - //$this->verifyElementPresent("//img[@src='images/star2.gif']",''); + //$this->assertElementPresent("//img[@src='images/star5.gif']",''); + //$this->assertElementPresent("//img[@src='images/star2.gif']",''); // verify toggle column visibility - $this->clickAndWait("//input[@name='ctl0\$body\$ctl1\$c0' and @value='Book Title']", ""); - $this->verifyTextNotPresent('Head First Design Patterns',''); - $this->clickAndWait("//input[@name='ctl0\$body\$ctl1\$c3' and @value='In-stock']", ""); - $this->verifyElementNotPresent('ctl0_body_DataGrid_ctl1_ctl5',''); - $this->clickAndWait("//input[@name='ctl0\$body\$ctl1\$c3' and @value='In-stock']", ""); - $this->verifyElementPresent('ctl0_body_DataGrid_ctl1_ctl5',''); - $this->clickAndWait("//input[@name='ctl0\$body\$ctl1\$c0' and @value='Book Title']", ""); - $this->verifyTextPresent('Head First Design Patterns',''); + $this->byXPath("//input[@name='ctl0\$body\$ctl1\$c0' and @value='Book Title']")->click(); + $this->assertNotContains('Head First Design Patterns', $this->source()); + $this->byXPath("//input[@name='ctl0\$body\$ctl1\$c3' and @value='In-stock']")->click(); + $this->assertElementNotPresent('ctl0_body_DataGrid_ctl1_ctl5',''); + $this->byXPath("//input[@name='ctl0\$body\$ctl1\$c3' and @value='In-stock']")->click(); + $this->assertElementPresent('ctl0_body_DataGrid_ctl1_ctl5',''); + $this->byXPath("//input[@name='ctl0\$body\$ctl1\$c0' and @value='Book Title']")->click(); + $this->assertContains('Head First Design Patterns', $this->source()); } } diff --git a/tests/FunctionalTests/quickstart/Controls/DataGrid3TestCase.php b/tests/FunctionalTests/quickstart/Controls/DataGrid3TestCase.php index 2cdace20..f0e88996 100755 --- a/tests/FunctionalTests/quickstart/Controls/DataGrid3TestCase.php +++ b/tests/FunctionalTests/quickstart/Controls/DataGrid3TestCase.php @@ -1,50 +1,55 @@ <?php -class QuickstartDataGrid3TestCase extends PradoGenericSeleniumTest +class QuickstartDataGrid3TestCase extends PradoGenericSelenium2Test { function test() { - $this->open("../../demos/quickstart/index.php?page=Controls.Samples.TDataGrid.Sample3&notheme=true&lang=en", ""); + $this->url("../../demos/quickstart/index.php?page=Controls.Samples.TDataGrid.Sample3&notheme=true&lang=en"); // verify the 2nd row of data - $this->verifyTextPresent("Design Patterns: Elements of Reusable Object-Oriented Software", ""); - $this->verifyTextPresent("Addison-Wesley Professional", ""); - $this->verifyTextPresent("$47.04", ""); - $this->verifyAttribute('ctl0_body_DataGrid_ctl2_ctl4@checked','regexp:true|checked'); - $this->verifyAttribute('ctl0_body_DataGrid_ctl2_ctl4@disabled','regexp:true|disabled'); - //$this->verifyElementPresent("//img[@src='images/star5.gif']",''); + $this->assertContains("Design Patterns: Elements of Reusable Object-Oriented Software", $this->source()); + $this->assertContains("Addison-Wesley Professional", $this->source()); + $this->assertContains("$47.04", $this->source()); + $this->assertAttribute('ctl0_body_DataGrid_ctl2_ctl4@checked','regexp:true|checked'); + $this->assertAttribute('ctl0_body_DataGrid_ctl2_ctl4@disabled','regexp:true|disabled'); + //$this->assertElementPresent("//img[@src='images/star5.gif']",''); // edit the 2nd row - $this->clickAndWait("id=ctl0_body_DataGrid_ctl2_ctl7", ""); + $this->byId("ctl0_body_DataGrid_ctl2_ctl7")->click(); $this->type("ctl0\$body\$DataGrid\$ctl2\$ctl1", "Design Pattern: Elements of Reusable Object-Oriented Software"); $this->type("ctl0\$body\$DataGrid\$ctl2\$ctl3", "Addison Wesley Professional"); $this->type("ctl0\$body\$DataGrid\$ctl2\$ctl5", "\$57.04"); - $this->click("//input[@name='ctl0\$body\$DataGrid\$ctl2\$ctl7']", ""); - $this->select("ctl0\$body\$DataGrid\$ctl2\$ctl9", "label=1"); - $this->clickAndWait("link=Save", ""); + $this->byXPath("//input[@name='ctl0\$body\$DataGrid\$ctl2\$ctl7']")->click(); + $this->select("ctl0\$body\$DataGrid\$ctl2\$ctl9", "1"); + $this->byLinkText("Save")->click(); // verify the 2nd row is saved - $this->verifyTextPresent("Design Pattern: Elements of Reusable Object-Oriented Software", ""); - $this->verifyTextPresent("Addison Wesley Professional", ""); - $this->verifyTextPresent("$57.04", ""); - $this->assertEquals($this->getEval('this.browserbot.findElement("ctl0_body_DataGrid_ctl2_ctl4").hasAttribute("checked")'), 'false'); - $this->verifyAttribute('ctl0_body_DataGrid_ctl2_ctl4@disabled','regexp:true|disabled'); - //$this->verifyElementPresent("//img[@src='images/star1.gif']",''); + $this->assertContains("Design Pattern: Elements of Reusable Object-Oriented Software", $this->source()); + $this->assertContains("Addison Wesley Professional", $this->source()); + $this->assertContains("$57.04", $this->source()); + $this->assertAttribute("ctl0_body_DataGrid_ctl2_ctl4@checked", null); + $this->assertAttribute('ctl0_body_DataGrid_ctl2_ctl4@disabled','regexp:true|disabled'); + //$this->assertElementPresent("//img[@src='images/star1.gif']",''); // verify cancel editting the 3rd row - $this->clickAndWait("id=ctl0_body_DataGrid_ctl3_ctl7", ""); - $this->clickAndWait("link=Cancel", ""); - $this->verifyTextPresent("Design Patterns Explained : A New Perspective on Object-Oriented Design", ""); + $this->byId("ctl0_body_DataGrid_ctl3_ctl7")->click(); + $this->byLinkText("Cancel")->click(); + $this->assertContains("Design Patterns Explained : A New Perspective on Object-Oriented Design", $this->source()); // verify deleting - $this->clickAndWait("id=ctl0_body_DataGrid_ctl3_ctl9", ""); - $this->verifyConfirmation("Are you sure?"); - $this->verifyTextNotPresent("Design Patterns Explained : A New Perspective on Object-Oriented Design", ""); - - $this->verifyTextPresent("Extreme Programming Explained : Embrace Change",''); - $this->chooseCancelOnNextConfirmation(); - $this->click("id=ctl0_body_DataGrid_ctl6_ctl9", ""); - $this->verifyConfirmation("Are you sure?"); - $this->verifyTextPresent("Extreme Programming Explained : Embrace Change",''); + $this->byId("ctl0_body_DataGrid_ctl3_ctl9")->click(); + + $this->assertEquals("Are you sure?", $this->alertText()); + $this->acceptAlert(); + + $this->assertNotContains("Design Patterns Explained : A New Perspective on Object-Oriented Design", $this->source()); + + $this->assertContains("Extreme Programming Explained : Embrace Change", $this->source()); + $this->byId("ctl0_body_DataGrid_ctl6_ctl9")->click(); + + $this->assertEquals("Are you sure?", $this->alertText()); + $this->dismissAlert(); + + $this->assertContains("Extreme Programming Explained : Embrace Change", $this->source()); } } diff --git a/tests/FunctionalTests/quickstart/Controls/DataGrid4TestCase.php b/tests/FunctionalTests/quickstart/Controls/DataGrid4TestCase.php index 702b997e..f67f5634 100755 --- a/tests/FunctionalTests/quickstart/Controls/DataGrid4TestCase.php +++ b/tests/FunctionalTests/quickstart/Controls/DataGrid4TestCase.php @@ -1,28 +1,28 @@ <?php -class QuickstartDataGrid4TestCase extends PradoGenericSeleniumTest +class QuickstartDataGrid4TestCase extends PradoGenericSelenium2Test { function test() { - $this->open("../../demos/quickstart/index.php?page=Controls.Samples.TDataGrid.Sample4&notheme=true&lang=en", ""); + $this->url("../../demos/quickstart/index.php?page=Controls.Samples.TDataGrid.Sample4&notheme=true&lang=en"); // verify the 2nd row of data - $this->verifyTextPresent("Design Patterns: Elements of Reusable Object-Oriented Software", ""); - $this->verifyTextPresent("Addison-Wesley Professional", ""); - $this->verifyTextPresent("$47.04", ""); - $this->verifyAttribute('ctl0_body_DataGrid_ctl2_ctl5@checked','regexp:true|checked'); - $this->verifyAttribute('ctl0_body_DataGrid_ctl2_ctl5@disabled','regexp:true|disabled'); + $this->assertContains("Design Patterns: Elements of Reusable Object-Oriented Software", $this->source()); + $this->assertContains("Addison-Wesley Professional", $this->source()); + $this->assertContains("$47.04", $this->source()); + $this->assertAttribute('ctl0_body_DataGrid_ctl2_ctl5@checked','regexp:true|checked'); + $this->assertAttribute('ctl0_body_DataGrid_ctl2_ctl5@disabled','regexp:true|disabled'); // verify sorting - $this->clickAndWait("link=Book Title", ""); - $this->assertEquals($this->getEval('this.browserbot.findElement("ctl0_body_DataGrid_ctl1_ctl5").hasAttribute("checked")'), 'false'); - $this->clickAndWait("link=Publisher", ""); - $this->assertEquals($this->getEval('this.browserbot.findElement("ctl0_body_DataGrid_ctl6_ctl5").hasAttribute("checked")'), 'false'); - $this->clickAndWait("link=Price", ""); - $this->assertEquals($this->getEval('this.browserbot.findElement("ctl0_body_DataGrid_ctl2_ctl5").hasAttribute("checked")'), 'false'); - $this->clickAndWait("link=In-stock", ""); - $this->assertEquals($this->getEval('this.browserbot.findElement("ctl0_body_DataGrid_ctl1_ctl5").hasAttribute("checked")'), 'false'); - $this->clickAndWait("link=Rating", ""); - $this->assertEquals($this->getEval('this.browserbot.findElement("ctl0_body_DataGrid_ctl4_ctl5").hasAttribute("checked")'), 'false'); + $this->byLinkText("Book Title")->click(); + $this->assertAttribute('ctl0_body_DataGrid_ctl1_ctl5@checked', null); + $this->byLinkText("Publisher")->click(); + $this->assertAttribute('ctl0_body_DataGrid_ctl6_ctl5@checked', null); + $this->byLinkText("Price")->click(); + $this->assertAttribute('ctl0_body_DataGrid_ctl2_ctl5@checked', null); + $this->byLinkText("In-stock")->click(); + $this->assertAttribute('ctl0_body_DataGrid_ctl1_ctl5@checked', null); + $this->byLinkText("Rating")->click(); + $this->assertAttribute('ctl0_body_DataGrid_ctl4_ctl5@checked', null); } } diff --git a/tests/FunctionalTests/quickstart/Controls/DataGrid5TestCase.php b/tests/FunctionalTests/quickstart/Controls/DataGrid5TestCase.php index f854d44c..3df22ff8 100755 --- a/tests/FunctionalTests/quickstart/Controls/DataGrid5TestCase.php +++ b/tests/FunctionalTests/quickstart/Controls/DataGrid5TestCase.php @@ -1,113 +1,113 @@ <?php -class QuickstartDataGrid5TestCase extends PradoGenericSeleniumTest +class QuickstartDataGrid5TestCase extends PradoGenericSelenium2Test { function test() { - $this->open("../../demos/quickstart/index.php?page=Controls.Samples.TDataGrid.Sample5&notheme=true&lang=en", ""); + $this->url("../../demos/quickstart/index.php?page=Controls.Samples.TDataGrid.Sample5&notheme=true&lang=en"); // verify if all required texts are present // verify column headers - $this->verifyTextPresent('id',''); - $this->verifyTextPresent('name',''); - $this->verifyTextPresent('quantity',''); - $this->verifyTextPresent('price',''); - $this->verifyTextPresent('imported',''); + $this->assertContains('id', $this->source()); + $this->assertContains('name', $this->source()); + $this->assertContains('quantity', $this->source()); + $this->assertContains('price', $this->source()); + $this->assertContains('imported', $this->source()); - $this->verifyTextPresent('ITN001',''); - $this->verifyTextPresent('ITN002',''); - $this->verifyTextPresent('ITN003',''); - $this->verifyTextPresent('ITN004',''); - $this->verifyTextPresent('ITN005',''); - $this->verifyTextNotPresent('ITN006',''); + $this->assertContains('ITN001', $this->source()); + $this->assertContains('ITN002', $this->source()); + $this->assertContains('ITN003', $this->source()); + $this->assertContains('ITN004', $this->source()); + $this->assertContains('ITN005', $this->source()); + $this->assertNotContains('ITN006', $this->source()); // verify paging - $this->clickAndWait("link=2", ""); - $this->verifyTextPresent('ITN006',''); - $this->verifyTextPresent('ITN007',''); - $this->verifyTextPresent('ITN008',''); - $this->verifyTextPresent('ITN009',''); - $this->verifyTextPresent('ITN010',''); - $this->verifyTextNotPresent('ITN011',''); - $this->verifyTextNotPresent('ITN005',''); + $this->byLinkText("2")->click(); + $this->assertContains('ITN006', $this->source()); + $this->assertContains('ITN007', $this->source()); + $this->assertContains('ITN008', $this->source()); + $this->assertContains('ITN009', $this->source()); + $this->assertContains('ITN010', $this->source()); + $this->assertNotContains('ITN011', $this->source()); + $this->assertNotContains('ITN005', $this->source()); - $this->clickAndWait("link=4", ""); - $this->verifyTextPresent('ITN016',''); - $this->verifyTextPresent('ITN017',''); - $this->verifyTextPresent('ITN018',''); - $this->verifyTextPresent('ITN019',''); - $this->verifyTextNotPresent('ITN015',''); + $this->byLinkText("4")->click(); + $this->assertContains('ITN016', $this->source()); + $this->assertContains('ITN017', $this->source()); + $this->assertContains('ITN018', $this->source()); + $this->assertContains('ITN019', $this->source()); + $this->assertNotContains('ITN015', $this->source()); - $this->clickAndWait("link=1", ""); - $this->verifyTextPresent('ITN001',''); - $this->verifyTextPresent('ITN002',''); - $this->verifyTextPresent('ITN003',''); - $this->verifyTextPresent('ITN004',''); - $this->verifyTextPresent('ITN005',''); - $this->verifyTextNotPresent('ITN006',''); + $this->byLinkText("1")->click(); + $this->assertContains('ITN001', $this->source()); + $this->assertContains('ITN002', $this->source()); + $this->assertContains('ITN003', $this->source()); + $this->assertContains('ITN004', $this->source()); + $this->assertContains('ITN005', $this->source()); + $this->assertNotContains('ITN006', $this->source()); // show top pager - $this->clickAndWait("//input[@name='ctl0\$body\$ctl1\$c0' and @value='Top']", ""); - $this->clickAndWait("id=ctl0_body_DataGrid_ctl8_ctl3", ""); - $this->clickAndWait("link=1", ""); + $this->byXPath("//input[@name='ctl0\$body\$ctl1\$c0' and @value='Top']")->click(); + $this->byId("ctl0_body_DataGrid_ctl8_ctl3")->click(); + $this->byLinkText("1")->click(); // hide top pager - $this->clickAndWait("//input[@name='ctl0\$body\$ctl1\$c0' and @value='Top']", ""); + $this->byXPath("//input[@name='ctl0\$body\$ctl1\$c0' and @value='Top']")->click(); // change next prev caption $this->type("ctl0\$body\$NextPageText", "Next Page"); $this->type("ctl0\$body\$PrevPageText", "Prev Page"); - $this->clickAndWait("//input[@type='submit' and @value='Submit']", ""); + $this->byXPath("//input[@type='submit' and @value='Submit']")->click(); // verify next prev paging - $this->verifyTextPresent('ITN001',''); - $this->verifyTextNotPresent('ITN006',''); - $this->clickAndWait("link=Next Page", ""); - $this->verifyTextNotPresent('ITN005',''); - $this->verifyTextPresent('ITN006',''); - $this->verifyTextNotPresent('ITN011',''); - $this->clickAndWait("link=Next Page", ""); - $this->verifyTextNotPresent('ITN010',''); - $this->verifyTextPresent('ITN011',''); - $this->verifyTextNotPresent('ITN016',''); - $this->clickAndWait("link=Next Page", ""); - $this->verifyTextNotPresent('ITN015',''); - $this->verifyTextPresent('ITN016',''); - $this->clickAndWait("link=Prev Page", ""); - $this->verifyTextNotPresent('ITN010',''); - $this->verifyTextPresent('ITN011',''); - $this->verifyTextNotPresent('ITN016',''); - $this->clickAndWait("link=Prev Page", ""); - $this->verifyTextNotPresent('ITN005',''); - $this->verifyTextPresent('ITN006',''); - $this->verifyTextNotPresent('ITN011',''); - $this->clickAndWait("link=Prev Page", ""); - $this->verifyTextPresent('ITN001',''); - $this->verifyTextNotPresent('ITN006',''); + $this->assertContains('ITN001', $this->source()); + $this->assertNotContains('ITN006', $this->source()); + $this->byLinkText("Next Page")->click(); + $this->assertNotContains('ITN005', $this->source()); + $this->assertContains('ITN006', $this->source()); + $this->assertNotContains('ITN011', $this->source()); + $this->byLinkText("Next Page")->click(); + $this->assertNotContains('ITN010', $this->source()); + $this->assertContains('ITN011', $this->source()); + $this->assertNotContains('ITN016', $this->source()); + $this->byLinkText("Next Page")->click(); + $this->assertNotContains('ITN015', $this->source()); + $this->assertContains('ITN016', $this->source()); + $this->byLinkText("Prev Page")->click(); + $this->assertNotContains('ITN010', $this->source()); + $this->assertContains('ITN011', $this->source()); + $this->assertNotContains('ITN016', $this->source()); + $this->byLinkText("Prev Page")->click(); + $this->assertNotContains('ITN005', $this->source()); + $this->assertContains('ITN006', $this->source()); + $this->assertNotContains('ITN011', $this->source()); + $this->byLinkText("Prev Page")->click(); + $this->assertContains('ITN001', $this->source()); + $this->assertNotContains('ITN006', $this->source()); // change button count $this->type("ctl0\$body\$PageButtonCount", "2"); - $this->clickAndWait("name=ctl0\$body\$ctl6", ""); - $this->clickAndWait("link=Next Page", ""); - $this->verifyTextNotPresent('ITN010',''); - $this->verifyTextPresent('ITN011',''); - $this->verifyTextNotPresent('ITN016',''); - $this->clickAndWait("link=4", ""); - $this->verifyTextNotPresent('ITN015',''); - $this->verifyTextPresent('ITN016',''); - $this->clickAndWait("link=Prev Page", ""); - $this->verifyTextNotPresent('ITN005',''); - $this->verifyTextPresent('ITN006',''); - $this->verifyTextNotPresent('ITN011',''); + $this->byName("ctl0\$body\$ctl6")->click(); + $this->byLinkText("Next Page")->click(); + $this->assertNotContains('ITN010', $this->source()); + $this->assertContains('ITN011', $this->source()); + $this->assertNotContains('ITN016', $this->source()); + $this->byLinkText("4")->click(); + $this->assertNotContains('ITN015', $this->source()); + $this->assertContains('ITN016', $this->source()); + $this->byLinkText("Prev Page")->click(); + $this->assertNotContains('ITN005', $this->source()); + $this->assertContains('ITN006', $this->source()); + $this->assertNotContains('ITN011', $this->source()); $this->type("ctl0\$body\$PageButtonCount", "10"); - $this->clickAndWait("name=ctl0\$body\$ctl6", ""); + $this->byName("ctl0\$body\$ctl6")->click(); $this->type("ctl0\$body\$PageSize", "2"); - $this->clickAndWait("name=ctl0\$body\$ctl8", ""); - $this->verifyTextPresent('ITN001',''); - $this->verifyTextPresent('ITN002',''); - $this->verifyTextNotPresent('ITN003',''); - $this->clickAndWait("link=10", ""); - $this->verifyTextPresent('ITN019',''); - $this->verifyTextNotPresent('ITN018',''); + $this->byName("ctl0\$body\$ctl8")->click(); + $this->assertContains('ITN001', $this->source()); + $this->assertContains('ITN002', $this->source()); + $this->assertNotContains('ITN003', $this->source()); + $this->byLinkText("10")->click(); + $this->assertContains('ITN019', $this->source()); + $this->assertNotContains('ITN018', $this->source()); } } diff --git a/tests/FunctionalTests/quickstart/Controls/DataGrid6TestCase.php b/tests/FunctionalTests/quickstart/Controls/DataGrid6TestCase.php index c6fba20f..54af86a8 100755 --- a/tests/FunctionalTests/quickstart/Controls/DataGrid6TestCase.php +++ b/tests/FunctionalTests/quickstart/Controls/DataGrid6TestCase.php @@ -1,48 +1,48 @@ <?php -class QuickstartDataGrid6TestCase extends PradoGenericSeleniumTest +class QuickstartDataGrid6TestCase extends PradoGenericSelenium2Test { function test() { - $this->open("../../demos/quickstart/index.php?page=Controls.Samples.TDataGrid.Sample6&notheme=true&lang=en", ""); + $this->url("../../demos/quickstart/index.php?page=Controls.Samples.TDataGrid.Sample6&notheme=true&lang=en"); // verify column headers - $this->verifyTextPresent('id',''); - $this->verifyTextPresent('name',''); - $this->verifyTextPresent('quantity',''); - $this->verifyTextPresent('price',''); - $this->verifyTextPresent('imported',''); + $this->assertContains('id', $this->source()); + $this->assertContains('name', $this->source()); + $this->assertContains('quantity', $this->source()); + $this->assertContains('price', $this->source()); + $this->assertContains('imported', $this->source()); - $this->verifyTextPresent('ITN001',''); - $this->verifyTextPresent('ITN002',''); - $this->verifyTextPresent('ITN003',''); - $this->verifyTextPresent('ITN004',''); - $this->verifyTextPresent('ITN005',''); - $this->verifyTextNotPresent('ITN006',''); + $this->assertContains('ITN001', $this->source()); + $this->assertContains('ITN002', $this->source()); + $this->assertContains('ITN003', $this->source()); + $this->assertContains('ITN004', $this->source()); + $this->assertContains('ITN005', $this->source()); + $this->assertNotContains('ITN006', $this->source()); // verify paging - $this->clickAndWait("link=2", ""); - $this->verifyTextPresent('ITN006',''); - $this->verifyTextPresent('ITN007',''); - $this->verifyTextPresent('ITN008',''); - $this->verifyTextPresent('ITN009',''); - $this->verifyTextPresent('ITN010',''); - $this->verifyTextNotPresent('ITN011',''); - $this->verifyTextNotPresent('ITN005',''); + $this->byLinkText("2")->click(); + $this->assertContains('ITN006', $this->source()); + $this->assertContains('ITN007', $this->source()); + $this->assertContains('ITN008', $this->source()); + $this->assertContains('ITN009', $this->source()); + $this->assertContains('ITN010', $this->source()); + $this->assertNotContains('ITN011', $this->source()); + $this->assertNotContains('ITN005', $this->source()); - $this->clickAndWait("link=4", ""); - $this->verifyTextPresent('ITN016',''); - $this->verifyTextPresent('ITN017',''); - $this->verifyTextPresent('ITN018',''); - $this->verifyTextPresent('ITN019',''); - $this->verifyTextNotPresent('ITN015',''); + $this->byLinkText("4")->click(); + $this->assertContains('ITN016', $this->source()); + $this->assertContains('ITN017', $this->source()); + $this->assertContains('ITN018', $this->source()); + $this->assertContains('ITN019', $this->source()); + $this->assertNotContains('ITN015', $this->source()); - $this->clickAndWait("link=1", ""); - $this->verifyTextPresent('ITN001',''); - $this->verifyTextPresent('ITN002',''); - $this->verifyTextPresent('ITN003',''); - $this->verifyTextPresent('ITN004',''); - $this->verifyTextPresent('ITN005',''); - $this->verifyTextNotPresent('ITN006',''); + $this->byLinkText("1")->click(); + $this->assertContains('ITN001', $this->source()); + $this->assertContains('ITN002', $this->source()); + $this->assertContains('ITN003', $this->source()); + $this->assertContains('ITN004', $this->source()); + $this->assertContains('ITN005', $this->source()); + $this->assertNotContains('ITN006', $this->source()); } } diff --git a/tests/FunctionalTests/quickstart/Controls/DataList1TestCase.php b/tests/FunctionalTests/quickstart/Controls/DataList1TestCase.php index 4ff6478a..436af2ad 100755 --- a/tests/FunctionalTests/quickstart/Controls/DataList1TestCase.php +++ b/tests/FunctionalTests/quickstart/Controls/DataList1TestCase.php @@ -1,24 +1,24 @@ <?php -class QuickstartDataList1TestCase extends PradoGenericSeleniumTest +class QuickstartDataList1TestCase extends PradoGenericSelenium2Test { function test() { - $this->open("../../demos/quickstart/index.php?page=Controls.Samples.TDataList.Sample1&notheme=true&lang=en", ""); + $this->url("../../demos/quickstart/index.php?page=Controls.Samples.TDataList.Sample1&notheme=true&lang=en"); // verify if all required texts are present - $this->verifyTextPresent('ITN001',''); - $this->verifyTextPresent('$100',''); - $this->verifyTextPresent('Motherboard',''); - $this->verifyTextPresent('ITN018',''); - $this->verifyTextPresent('Surge protector',''); - $this->verifyTextPresent('45',''); - $this->verifyTextPresent('$15',''); - $this->verifyTextPresent('Total 19 products.',''); - $this->verifyTextPresent('Computer Parts',''); + $this->assertContains('ITN001', $this->source()); + $this->assertContains('$100', $this->source()); + $this->assertContains('Motherboard', $this->source()); + $this->assertContains('ITN018', $this->source()); + $this->assertContains('Surge protector', $this->source()); + $this->assertContains('45', $this->source()); + $this->assertContains('$15', $this->source()); + $this->assertContains('Total 19 products.', $this->source()); + $this->assertContains('Computer Parts', $this->source()); // verify specific table tags - $this->verifyElementPresent("ctl0_body_DataList"); - $this->verifyElementPresent("//td[@align='right']"); + $this->assertElementPresent("ctl0_body_DataList"); + $this->assertElementPresent("//td[@align='right']"); } } diff --git a/tests/FunctionalTests/quickstart/Controls/DataList2TestCase.php b/tests/FunctionalTests/quickstart/Controls/DataList2TestCase.php index 4fb3743e..911fdc93 100755 --- a/tests/FunctionalTests/quickstart/Controls/DataList2TestCase.php +++ b/tests/FunctionalTests/quickstart/Controls/DataList2TestCase.php @@ -1,59 +1,64 @@ <?php -class QuickstartDataList2TestCase extends PradoGenericSeleniumTest +class QuickstartDataList2TestCase extends PradoGenericSelenium2Test { function test() { - $this->open("../../demos/quickstart/index.php?page=Controls.Samples.TDataList.Sample2&notheme=true&lang=en", ""); + $this->url("../../demos/quickstart/index.php?page=Controls.Samples.TDataList.Sample2&notheme=true&lang=en"); // verify initial presentation - $this->verifyTextPresent("Motherboard ", ""); - $this->verifyTextPresent("Monitor ", ""); + $this->assertContains("Motherboard", $this->source()); + $this->assertContains("Monitor", $this->source()); // verify selecting an item - $this->clickAndWait("link=ITN003", ""); - $this->verifyTextPresent("Quantity", ""); - $this->verifyTextPresent("Price", ""); - $this->verifyTextPresent("\$80", ""); - $this->clickAndWait("link=ITN005", ""); - $this->verifyTextPresent("\$150", ""); + $this->byLinkText("ITN003")->click(); + $this->assertContains("Quantity", $this->source()); + $this->assertContains("Price", $this->source()); + $this->assertContains("\$80", $this->source()); + $this->byLinkText("ITN005")->click(); + $this->assertContains("\$150", $this->source()); // verify editting an item - $this->clickAndWait("id=ctl0_body_DataList_ctl5_ctl0", ""); + $this->byId("ctl0_body_DataList_ctl5_ctl0")->click(); $this->type("ctl0\$body\$DataList\$ctl5\$ProductQuantity", "11"); $this->type("ctl0\$body\$DataList\$ctl5\$ProductPrice", "140.99"); - $this->click("//input[@name='ctl0\$body\$DataList\$ctl5\$ProductImported']", ""); - $this->clickAndWait("link=Save", ""); + $this->byXPath("//input[@name='ctl0\$body\$DataList\$ctl5\$ProductImported']")->click(); + $this->byLinkText("Save")->click(); // verify item is saved - $this->clickAndWait("link=ITN005", ""); - $this->verifyTextPresent("\$140.99", ""); - $this->verifyTextPresent("11", ""); + $this->byLinkText("ITN005")->click(); + $this->assertContains("\$140.99", $this->source()); + $this->assertContains("11", $this->source()); // verify editting another item - $this->clickAndWait("id=ctl0_body_DataList_ctl3_ctl1", ""); + $this->byId("ctl0_body_DataList_ctl3_ctl1")->click(); $this->type("ctl0\$body\$DataList\$ctl3\$ProductName", "Hard Drive"); $this->type("ctl0\$body\$DataList\$ctl3\$ProductQuantity", "23"); - $this->click("//input[@name='ctl0\$body\$DataList\$ctl3\$ProductImported']", ""); - $this->clickAndWait("link=Cancel", ""); + $this->byXPath("//input[@name='ctl0\$body\$DataList\$ctl3\$ProductImported']")->click(); + $this->byLinkText("Cancel")->click(); // verify item is canceled - $this->clickAndWait("link=ITN003", ""); - $this->verifyTextPresent("2", ""); - $this->verifyTextPresent("Harddrive ", ""); + $this->byLinkText("ITN003")->click(); + $this->assertContains("2", $this->source()); + $this->assertContains("Harddrive", $this->source()); // verify item deletion - $this->clickAndWait("id=ctl0_body_DataList_ctl3_ctl1", ""); - $this->verifyConfirmation("Are you sure?"); - $this->chooseCancelOnNextConfirmation(); - $this->click("id=ctl0_body_DataList_ctl5_ctl2", ""); - $this->verifyConfirmation("Are you sure?"); - $this->verifyTextPresent("Motherboard ", ""); - $this->verifyTextPresent("CPU ", ""); - $this->verifyTextNotPresent("Harddrive",""); - $this->verifyTextPresent("Sound card", ""); - $this->verifyTextPresent("Video card", ""); - $this->verifyTextPresent("Keyboard",""); - $this->verifyTextPresent("Monitor ", ""); + $this->byId("ctl0_body_DataList_ctl3_ctl1")->click(); + + $this->assertEquals("Are you sure?", $this->alertText()); + $this->acceptAlert(); + + $this->byId("ctl0_body_DataList_ctl5_ctl2")->click(); + + $this->assertEquals("Are you sure?", $this->alertText()); + $this->dismissAlert(); + + $this->assertContains("Motherboard", $this->source()); + $this->assertContains("CPU", $this->source()); + $this->assertNotContains("Harddrive", $this->source()); + $this->assertContains("Sound card", $this->source()); + $this->assertContains("Video card", $this->source()); + $this->assertContains("Keyboard", $this->source()); + $this->assertContains("Monitor", $this->source()); } } diff --git a/tests/FunctionalTests/quickstart/Controls/DropDownListTestCase.php b/tests/FunctionalTests/quickstart/Controls/DropDownListTestCase.php index eae8ab36..cb01e948 100755 --- a/tests/FunctionalTests/quickstart/Controls/DropDownListTestCase.php +++ b/tests/FunctionalTests/quickstart/Controls/DropDownListTestCase.php @@ -1,65 +1,65 @@ <?php -class QuickstartDropDownListTestCase extends PradoGenericSeleniumTest +class QuickstartDropDownListTestCase extends PradoGenericSelenium2Test { function test () { - $this->open("../../demos/quickstart/index.php?page=Controls.Samples.TDropDownList.Home&notheme=true&lang=en", ""); + $this->url("../../demos/quickstart/index.php?page=Controls.Samples.TDropDownList.Home&notheme=true&lang=en"); - $this->verifyTitle("PRADO QuickStart Sample", ""); + $this->assertEquals("PRADO QuickStart Sample", $this->title()); // dropdown list with default settings - $this->verifyElementPresent("ctl0\$body\$ctl0"); + $this->assertElementPresent("ctl0\$body\$ctl0"); // dropdown list with initial options - $this->assertEquals($this->getSelectOptions("ctl0\$body\$ctl1"), array('item 1', 'item 2', 'item 3', 'item 4')); + $this->assertEquals($this->getSelectOptions("ctl0\$body\$ctl1"), array('item 1', 'item 2', 'item 3', 'item 4')); $this->assertSelected("ctl0\$body\$ctl1","item 2"); // dropdown list with customized styles - $this->assertEquals($this->getSelectOptions("ctl0\$body\$ctl2"), array('item 1', 'item 2', 'item 3', 'item 4')); + $this->assertEquals($this->getSelectOptions("ctl0\$body\$ctl2"), array('item 1', 'item 2', 'item 3', 'item 4')); $this->assertSelected("ctl0\$body\$ctl2","item 2"); // a disabled dropdown list - $this->verifyAttribute("ctl0\$body\$ctl3@disabled","regexp:true|disabled"); + $this->assertAttribute("ctl0\$body\$ctl3@disabled","regexp:true|disabled"); // an auto postback dropdown list - $this->verifyTextNotPresent("Your selection is: (Index: 2, Value: value 3, Text: item 3)", ""); - $this->selectAndWait("ctl0\$body\$ctl4", "label=item 3"); - $this->verifyTextPresent("Your selection is: (Index: 2, Value: value 3, Text: item 3)", ""); + $this->assertNotContains("Your selection is: (Index: 2, Value: value 3, Text: item 3)", $this->source()); + $this->selectAndWait("ctl0\$body\$ctl4", "item 3"); + $this->assertContains("Your selection is: (Index: 2, Value: value 3, Text: item 3)", $this->source()); // a single selection list box upon postback - $this->select("ctl0\$body\$DropDownList1", "label=item 4"); - $this->verifyTextNotPresent("Your selection is: (Index: 3, Value: value 4, Text: item 4)", ""); - $this->clickAndWait("//input[@type='submit' and @value='Submit']", ""); - $this->verifyTextPresent("Your selection is: (Index: 3, Value: value 4, Text: item 4)", ""); + $this->select("ctl0\$body\$DropDownList1", "item 4"); + $this->assertNotContains("Your selection is: (Index: 3, Value: value 4, Text: item 4)", $this->source()); + $this->byXPath("//input[@type='submit' and @value='Submit']")->click(); + $this->assertContains("Your selection is: (Index: 3, Value: value 4, Text: item 4)", $this->source()); // Databind to an integer-indexed array - $this->selectAndWait("ctl0\$body\$DBDropDownList1", "label=item 3"); - $this->verifyTextPresent("Your selection is: (Index: 2, Value: 2, Text: item 3)", ""); + $this->selectAndWait("ctl0\$body\$DBDropDownList1", "item 3"); + $this->assertContains("Your selection is: (Index: 2, Value: 2, Text: item 3)", $this->source()); // Databind to an associative array - $this->selectAndWait("ctl0\$body\$DBDropDownList2", "label=item 2"); - $this->verifyTextPresent("Your selection is: (Index: 1, Value: key 2, Text: item 2)", ""); + $this->selectAndWait("ctl0\$body\$DBDropDownList2", "item 2"); + $this->assertContains("Your selection is: (Index: 1, Value: key 2, Text: item 2)", $this->source()); // Databind with DataTextField and DataValueField specified - $this->selectAndWait("ctl0\$body\$DBDropDownList3", "label=Cary"); - $this->verifyTextPresent("Your selection is: (Index: 2, Value: 003, Text: Cary)", ""); + $this->selectAndWait("ctl0\$body\$DBDropDownList3", "Cary"); + $this->assertContains("Your selection is: (Index: 2, Value: 003, Text: Cary)", $this->source()); // dropdown list is being validated - $this->verifyNotVisible('ctl0_body_ctl6'); - $this->click("id=ctl0_body_ctl7", ""); - $this->verifyVisible('ctl0_body_ctl6'); - $this->select("ctl0\$body\$VDropDownList1", "label=item 2"); - $this->clickAndWait("id=ctl0_body_ctl7", ""); - $this->verifyNotVisible('ctl0_body_ctl6'); + $this->assertNotVisible('ctl0_body_ctl6'); + $this->byId("ctl0_body_ctl7")->click(); + $this->assertVisible('ctl0_body_ctl6'); + $this->select("ctl0\$body\$VDropDownList1", "item 2"); + $this->byId("ctl0_body_ctl7")->click(); + $this->assertNotVisible('ctl0_body_ctl6'); // dropdown list causing validation - $this->verifyNotVisible('ctl0_body_ctl8'); - $this->select("ctl0\$body\$VDropDownList2", "label=Disagree"); + $this->assertNotVisible('ctl0_body_ctl8'); + $this->select("ctl0\$body\$VDropDownList2", "Disagree"); $this->pause(1000); - $this->verifyVisible('ctl0_body_ctl8'); + $this->assertVisible('ctl0_body_ctl8'); $this->type("ctl0\$body\$TextBox", "test"); - $this->selectAndWait("ctl0\$body\$VDropDownList2", "label=Agree"); - $this->verifyNotVisible('ctl0_body_ctl8'); + $this->selectAndWait("ctl0\$body\$VDropDownList2", "Agree"); + $this->assertNotVisible('ctl0_body_ctl8'); } } diff --git a/tests/FunctionalTests/quickstart/Controls/ExpressionTestCase.php b/tests/FunctionalTests/quickstart/Controls/ExpressionTestCase.php index 4d47fecd..8c5add48 100755 --- a/tests/FunctionalTests/quickstart/Controls/ExpressionTestCase.php +++ b/tests/FunctionalTests/quickstart/Controls/ExpressionTestCase.php @@ -1,13 +1,13 @@ <?php -class QuickstartExpressionTestCase extends PradoGenericSeleniumTest +class QuickstartExpressionTestCase extends PradoGenericSelenium2Test { function test () { - $this->open("../../demos/quickstart/index.php?page=Controls.Samples.TExpression.Home&notheme=true&lang=en", ""); + $this->url("../../demos/quickstart/index.php?page=Controls.Samples.TExpression.Home&notheme=true&lang=en"); - $this->verifyTitle("PRADO QuickStart Sample", ""); + $this->assertEquals("PRADO QuickStart Sample", $this->title()); - $this->verifyTextPresent('PRADO QuickStart Sample'); + $this->assertContains('PRADO QuickStart Sample', $this->source()); } } diff --git a/tests/FunctionalTests/quickstart/Controls/HtmlAreaTestCase.php b/tests/FunctionalTests/quickstart/Controls/HtmlAreaTestCase.php index caa7a893..53ee6697 100755 --- a/tests/FunctionalTests/quickstart/Controls/HtmlAreaTestCase.php +++ b/tests/FunctionalTests/quickstart/Controls/HtmlAreaTestCase.php @@ -1,12 +1,12 @@ <?php -class QuickstartHtmlAreaTestCase extends PradoGenericSeleniumTest +class QuickstartHtmlAreaTestCase extends PradoGenericSelenium2Test { function test () { - $this->open("../../demos/quickstart/index.php?page=Controls.Samples.THtmlArea.Home&notheme=true&lang=en", ""); + $this->url("../../demos/quickstart/index.php?page=Controls.Samples.THtmlArea.Home&notheme=true&lang=en"); - $this->verifyTitle("PRADO QuickStart Sample", ""); + $this->assertEquals("PRADO QuickStart Sample", $this->title()); // can't perform any test } diff --git a/tests/FunctionalTests/quickstart/Controls/HyperLinkTestCase.php b/tests/FunctionalTests/quickstart/Controls/HyperLinkTestCase.php index dc0261e7..bc7ef8b8 100755 --- a/tests/FunctionalTests/quickstart/Controls/HyperLinkTestCase.php +++ b/tests/FunctionalTests/quickstart/Controls/HyperLinkTestCase.php @@ -1,15 +1,15 @@ <?php -class QuickstartHyperLinkTestCase extends PradoGenericSeleniumTest +class QuickstartHyperLinkTestCase extends PradoGenericSelenium2Test { function test () { - $this->open("../../demos/quickstart/index.php?page=Controls.Samples.THyperLink.Home&notheme=true&lang=en", ""); - $this->verifyTitle("PRADO QuickStart Sample", ""); - $this->verifyElementPresent("//a[@href=\"http://www.pradosoft.com/\" and @target=\"_blank\"]"); - $this->verifyTextPresent("Welcome to", ""); - $this->verifyTextPresent("Body contents", ""); - $this->verifyElementPresent("//a[img/@alt='Hello World']"); - $this->verifyElementPresent("//a[contains(text(),'Body contents')]"); + $this->url("../../demos/quickstart/index.php?page=Controls.Samples.THyperLink.Home&notheme=true&lang=en"); + $this->assertEquals("PRADO QuickStart Sample", $this->title()); + $this->assertElementPresent("//a[@href=\"http://www.pradosoft.com/\" and @target=\"_blank\"]"); + $this->assertContains("Welcome to", $this->source()); + $this->assertContains("Body contents", $this->source()); + $this->assertElementPresent("//a[img/@alt='Hello World']"); + $this->assertElementPresent("//a[contains(text(),'Body contents')]"); } } diff --git a/tests/FunctionalTests/quickstart/Controls/ImageButtonTestCase.php b/tests/FunctionalTests/quickstart/Controls/ImageButtonTestCase.php index bf531d72..0f86216e 100755 --- a/tests/FunctionalTests/quickstart/Controls/ImageButtonTestCase.php +++ b/tests/FunctionalTests/quickstart/Controls/ImageButtonTestCase.php @@ -1,28 +1,28 @@ <?php -class QuickstartImageButtonTestCase extends PradoGenericSeleniumTest +class QuickstartImageButtonTestCase extends PradoGenericSelenium2Test { function test () { - $this->open("../../demos/quickstart/index.php?page=Controls.Samples.TImageButton.Home&notheme=true&lang=en", ""); + $this->url("../../demos/quickstart/index.php?page=Controls.Samples.TImageButton.Home&notheme=true&lang=en"); - $this->verifyTitle("PRADO QuickStart Sample", ""); + $this->assertEquals("PRADO QuickStart Sample", $this->title()); // a click button - $this->clickAndWait("//input[@type='image' and @alt='hello world']", ""); - $this->verifyTextPresent("You clicked at ",""); + $this->byXPath("//input[@type='image' and @alt='hello world']")->click(); + $this->assertContains("You clicked at ", $this->source()); // a command button - $this->clickAndWait("ctl0\$body\$ctl1", ""); - $this->verifyTextPresent("Command name: test, Command parameter: value",""); + $this->byName("ctl0\$body\$ctl1")->click(); + $this->assertContains("Command name: test, Command parameter: value", $this->source()); // a button causing validation - $this->verifyNotVisible('ctl0_body_ctl2'); - $this->click("id=ctl0_body_ctl3", ""); + $this->assertNotVisible('ctl0_body_ctl2'); + $this->byId("ctl0_body_ctl3")->click(); // $this->pause(1000); - $this->verifyVisible('ctl0_body_ctl2'); + $this->assertVisible('ctl0_body_ctl2'); $this->type("ctl0\$body\$TextBox", "test"); - $this->clickAndWait("id=ctl0_body_ctl3", ""); - $this->verifyNotVisible('ctl0_body_ctl2'); + $this->byId("ctl0_body_ctl3")->click(); + $this->assertNotVisible('ctl0_body_ctl2'); } } diff --git a/tests/FunctionalTests/quickstart/Controls/ImageTestCase.php b/tests/FunctionalTests/quickstart/Controls/ImageTestCase.php index 19e80470..f3bd4775 100755 --- a/tests/FunctionalTests/quickstart/Controls/ImageTestCase.php +++ b/tests/FunctionalTests/quickstart/Controls/ImageTestCase.php @@ -1,18 +1,18 @@ <?php //New Test -class QuickstartImageTestCase extends PradoGenericSeleniumTest +class QuickstartImageTestCase extends PradoGenericSelenium2Test { function test () { - $this->open("../../demos/quickstart/index.php?page=Controls.Samples.TImage.Home&notheme=true&lang=en", ""); + $this->url("../../demos/quickstart/index.php?page=Controls.Samples.TImage.Home&notheme=true&lang=en"); - $this->verifyTitle("PRADO QuickStart Sample", ""); + $this->assertEquals("PRADO QuickStart Sample", $this->title()); - //$this->verifyElementPresent("//img[contains(@src,'/hello_world.gif') and @alt='']"); - $this->verifyElementPresent("//img[contains(@src,'/hello_world.gif') and @alt='Hello World!']"); - $this->verifyTextPresent("Hello World! Hello World! Hello World!", ""); - //$this->verifyElementPresent("//img[contains(@src,'/hello_world.gif') and @align='baseline']"); - //$this->verifyElementPresent("//img[contains(@src,'/hello_world.gif') and contains(@longdesc,'HelloWorld.html')]"); + //$this->assertElementPresent("//img[contains(@src,'/hello_world.gif') and @alt='']"); + $this->assertElementPresent("//img[contains(@src,'/hello_world.gif') and @alt='Hello World!']"); + $this->assertContains("Hello World! Hello World! Hello World!", $this->source()); + //$this->assertElementPresent("//img[contains(@src,'/hello_world.gif') and @align='baseline']"); + //$this->assertElementPresent("//img[contains(@src,'/hello_world.gif') and contains(@longdesc,'HelloWorld.html')]"); } } diff --git a/tests/FunctionalTests/quickstart/Controls/LabelTestCase.php b/tests/FunctionalTests/quickstart/Controls/LabelTestCase.php index 03bba8ed..a9aa0bbe 100755 --- a/tests/FunctionalTests/quickstart/Controls/LabelTestCase.php +++ b/tests/FunctionalTests/quickstart/Controls/LabelTestCase.php @@ -1,20 +1,20 @@ <?php //New Test -class QuickstartLabelTestCase extends PradoGenericSeleniumTest +class QuickstartLabelTestCase extends PradoGenericSelenium2Test { function test () { - $this->open("../../demos/quickstart/index.php?page=Controls.Samples.TLabel.Home&notheme=true&lang=en", ""); - $this->verifyTitle("PRADO QuickStart Sample", ""); - $this->verifyTextPresent("This is a label with customized color and font.", ""); - $this->verifyTextPresent("This is a form label associated with the TTextBox control below", ""); - $this->verifyTextPresent("This is a label with empty Text property and nonempty body", ""); - $this->verifyTextPresent("This is a disabled label", ""); + $this->url("../../demos/quickstart/index.php?page=Controls.Samples.TLabel.Home&notheme=true&lang=en"); + $this->assertEquals("PRADO QuickStart Sample", $this->title()); + $this->assertContains("This is a label with customized color and font.", $this->source()); + $this->assertContains("This is a form label associated with the TTextBox control below", $this->source()); + $this->assertContains("This is a label with empty Text property and <b>nonempty body</b>", $this->source()); + $this->assertContains("This is a disabled label", $this->source()); - $this->verifyAttribute("ctl0_body_Label2@disabled","regexp:true|disabled"); + $this->assertAttribute("ctl0_body_Label2@disabled","regexp:true|disabled"); - //$this->verifyAttribute("ctl0_body_Label1@for","ctl0_body_test"); + //$this->assertAttribute("ctl0_body_Label1@for","ctl0_body_test"); $this->type("ctl0\$body\$test", "test"); } diff --git a/tests/FunctionalTests/quickstart/Controls/LinkButtonTestCase.php b/tests/FunctionalTests/quickstart/Controls/LinkButtonTestCase.php index 57e7b975..97b4863d 100755 --- a/tests/FunctionalTests/quickstart/Controls/LinkButtonTestCase.php +++ b/tests/FunctionalTests/quickstart/Controls/LinkButtonTestCase.php @@ -1,32 +1,32 @@ <?php -class QuickstartLinkButtonTestCase extends PradoGenericSeleniumTest +class QuickstartLinkButtonTestCase extends PradoGenericSelenium2Test { function test () { - $this->open("../../demos/quickstart/index.php?page=Controls.Samples.TLinkButton.Home&notheme=true&lang=en", ""); + $this->url("../../demos/quickstart/index.php?page=Controls.Samples.TLinkButton.Home&notheme=true&lang=en"); - $this->verifyTitle("PRADO QuickStart Sample", ""); + $this->assertEquals("PRADO QuickStart Sample", $this->title()); // regular buttons - $this->clickAndWait("link=link button", ""); - $this->clickAndWait("//a[contains(text(),'body content')]", ""); + $this->byLinkText("link button")->click(); + $this->byXPath("//a[contains(text(),'body content')]")->click(); // a click button - $this->clickAndWait("link=click me", ""); - $this->clickAndWait("link=I'm clicked", ""); + $this->byLinkText("click me")->click(); + $this->byLinkText("I'm clicked")->click(); // a command button - $this->clickAndWait("link=click me", ""); - $this->clickAndWait("//a[contains(text(),'Name: test, Param: value')]", ""); + $this->byLinkText("click me")->click(); + $this->byXPath("//a[contains(text(),'Name: test, Param: value')]")->click(); // a button causing validation - $this->verifyNotVisible('ctl0_body_ctl4'); - $this->click("link=submit", ""); + $this->assertNotVisible('ctl0_body_ctl4'); + $this->byLinkText("submit")->click(); // $this->pause(1000); - $this->verifyVisible('ctl0_body_ctl4'); + $this->assertVisible('ctl0_body_ctl4'); $this->type("ctl0\$body\$TextBox", "test"); - $this->clickAndWait("link=submit", ""); - $this->verifyNotVisible('ctl0_body_ctl4'); + $this->byLinkText("submit")->click(); + $this->assertNotVisible('ctl0_body_ctl4'); } } diff --git a/tests/FunctionalTests/quickstart/Controls/ListBoxTestCase.php b/tests/FunctionalTests/quickstart/Controls/ListBoxTestCase.php index 1cae0d43..11910ba5 100755 --- a/tests/FunctionalTests/quickstart/Controls/ListBoxTestCase.php +++ b/tests/FunctionalTests/quickstart/Controls/ListBoxTestCase.php @@ -1,82 +1,81 @@ <?php //New Test -class QuickstartListBoxTestCase extends PradoGenericSeleniumTest +class QuickstartListBoxTestCase extends PradoGenericSelenium2Test { function test () { - $this->open("../../demos/quickstart/index.php?page=Controls.Samples.TListBox.Home&notheme=true&lang=en", ""); + $this->url("../../demos/quickstart/index.php?page=Controls.Samples.TListBox.Home&notheme=true&lang=en"); // a default single selection listbox - $this->verifyAttribute("ctl0\$body\$ctl0@size","4"); + $this->assertAttribute("ctl0\$body\$ctl0@size","4"); // single selection list box with initial options - $this->assertEquals($this->getSelectOptions("ctl0\$body\$ctl1"), array('item 1', 'item 2', 'item 3', 'item 4')); + $this->assertEquals($this->getSelectOptions("ctl0\$body\$ctl1"), array('item 1', 'item 2', 'item 3', 'item 4')); $this->assertSelected("ctl0\$body\$ctl1","item 2"); // a single selection list box with customized style - $this->verifyAttribute("ctl0\$body\$ctl2@size","3"); - $this->assertEquals($this->getSelectOptions("ctl0\$body\$ctl2"), array('item 1', 'item 2', 'item 3', 'item 4')); + $this->assertAttribute("ctl0\$body\$ctl2@size","3"); + $this->assertEquals($this->getSelectOptions("ctl0\$body\$ctl2"), array('item 1', 'item 2', 'item 3', 'item 4')); $this->assertSelected("ctl0\$body\$ctl2","item 2"); // a disabled list box - $this->verifyAttribute("ctl0\$body\$ctl3@disabled","regexp:true|disabled"); + $this->assertAttribute("ctl0\$body\$ctl3@disabled","regexp:true|disabled"); // an auto postback single selection list box - $this->verifyTextNotPresent("Your selection is: (Index: 2, Value: value 3, Text: item 3)", ""); - $this->selectAndWait("ctl0\$body\$ctl4", "label=item 3"); - $this->verifyTextPresent("exact:Your selection is: (Index: 2, Value: value 3, Text: item 3)", ""); + $this->assertNotContains("Your selection is: (Index: 2, Value: value 3, Text: item 3)", $this->source()); + $this->selectAndWait("ctl0\$body\$ctl4", "item 3"); + $this->assertContains("Your selection is: (Index: 2, Value: value 3, Text: item 3)", $this->source()); // a single selection list box upon postback - $this->select("ctl0\$body\$ListBox1", "label=item 4"); - $this->verifyTextNotPresent("Your selection is: (Index: 3, Value: value 4, Text: item 4)", ""); - $this->clickAndWait("//input[@type='submit' and @value='Submit']", ""); - $this->verifyTextPresent("exact:Your selection is: (Index: 3, Value: value 4, Text: item 4)", ""); + $this->select("ctl0\$body\$ListBox1", "item 4"); + $this->assertNotContains("Your selection is: (Index: 3, Value: value 4, Text: item 4)", $this->source()); + $this->byXPath("//input[@type='submit' and @value='Submit']")->click(); + $this->assertContains("Your selection is: (Index: 3, Value: value 4, Text: item 4)", $this->source()); // a multiple selection list box - $this->verifyAttribute("ctl0\$body\$ctl6[]@size","4"); - $this->verifyAttribute("ctl0\$body\$ctl6[]@multiple","regexp:true|multiple"); + $this->assertAttribute("ctl0\$body\$ctl6[]@size","4"); + $this->assertAttribute("ctl0\$body\$ctl6[]@multiple","regexp:true|multiple"); // a multiple selection list box with initial options - $this->verifyAttribute("ctl0\$body\$ctl7[]@multiple","regexp:true|multiple"); + $this->assertAttribute("ctl0\$body\$ctl7[]@multiple","regexp:true|multiple"); $this->assertEquals($this->getSelectOptions("ctl0\$body\$ctl7[]"), array('item 1', 'item 2', 'item 3', 'item 4')); // multiselection list box's behavior upon postback - $this->addSelection("ctl0\$body\$ListBox2[]", "label=item 3"); - $this->clickAndWait("name=ctl0\$body\$ctl8", ""); - $this->verifyText("ctl0_body_MultiSelectionResult2","exact:Your selection is: (Index: 1, Value: value 2, Text: item 2)(Index: 2, Value: value 3, Text: item 3)(Index: 3, Value: value 4, Text: item 4)"); + $this->addSelection("ctl0\$body\$ListBox2[]", "item 3"); + $this->byName("ctl0\$body\$ctl8")->click(); + $this->assertText("ctl0_body_MultiSelectionResult2","Your selection is: (Index: 1, Value: value 2, Text: item 2)(Index: 2, Value: value 3, Text: item 3)(Index: 3, Value: value 4, Text: item 4)"); // Auto postback multiselection list box - $this->addSelection("ctl0\$body\$ctl9[]", "label=item 1"); - $this->waitForPageToLoad(1000); - $this->verifyText("ctl0_body_MultiSelectionResult","exact:Your selection is: (Index: 0, Value: value 1, Text: item 1)(Index: 1, Value: value 2, Text: item 2)(Index: 3, Value: value 4, Text: item 4)"); + $this->addSelection("ctl0\$body\$ctl9[]", "item 1"); + $this->assertText("ctl0_body_MultiSelectionResult","Your selection is: (Index: 0, Value: value 1, Text: item 1)(Index: 1, Value: value 2, Text: item 2)(Index: 3, Value: value 4, Text: item 4)"); // Databind to an integer-indexed array - $this->selectAndWait("ctl0\$body\$DBListBox1[]", "label=item 3"); - $this->verifyTextPresent("exact:Your selection is: (Index: 2, Value: 2, Text: item 3)", ""); + $this->selectAndWait("ctl0\$body\$DBListBox1[]", "item 3"); + $this->assertContains("Your selection is: (Index: 2, Value: 2, Text: item 3)", $this->source()); // Databind to an associative array - $this->selectAndWait("ctl0\$body\$DBListBox2[]", "label=item 2"); - $this->verifyTextPresent("exact:Your selection is: (Index: 1, Value: key 2, Text: item 2)", ""); + $this->selectAndWait("ctl0\$body\$DBListBox2[]", "item 2"); + $this->assertContains("Your selection is: (Index: 1, Value: key 2, Text: item 2)", $this->source()); // Databind with DataTextField and DataValueField specified - $this->selectAndWait("ctl0\$body\$DBListBox3[]", "label=Cary"); - $this->verifyTextPresent("exact:Your selection is: (Index: 2, Value: 003, Text: Cary)", ""); + $this->selectAndWait("ctl0\$body\$DBListBox3[]", "Cary"); + $this->assertContains("Your selection is: (Index: 2, Value: 003, Text: Cary)", $this->source()); // List box is being validated - $this->verifyNotVisible('ctl0_body_ctl10'); - $this->click("id=ctl0_body_ctl11", ""); - $this->verifyVisible('ctl0_body_ctl10'); - $this->select("ctl0\$body\$VListBox1", "label=item 2"); - $this->clickAndWait("id=ctl0_body_ctl11", ""); - $this->verifyNotVisible('ctl0_body_ctl10'); + $this->assertNotVisible('ctl0_body_ctl10'); + $this->byId("ctl0_body_ctl11")->click(); + $this->assertVisible('ctl0_body_ctl10'); + $this->select("ctl0\$body\$VListBox1", "item 2"); + $this->byId("ctl0_body_ctl11")->click(); + $this->assertNotVisible('ctl0_body_ctl10'); // List box causing validation - $this->verifyNotVisible('ctl0_body_ctl12'); - $this->select("ctl0\$body\$VListBox2", "label=Agree"); - $this->verifyVisible('ctl0_body_ctl12'); + $this->assertNotVisible('ctl0_body_ctl12'); + $this->select("ctl0\$body\$VListBox2", "Agree"); + $this->assertVisible('ctl0_body_ctl12'); $this->type("ctl0\$body\$TextBox", "test"); - $this->selectAndWait("ctl0\$body\$VListBox2", "label=Disagree"); - $this->verifyNotVisible('ctl0_body_ctl12'); + $this->selectAndWait("ctl0\$body\$VListBox2", "Disagree"); + $this->assertNotVisible('ctl0_body_ctl12'); } } diff --git a/tests/FunctionalTests/quickstart/Controls/MultiViewTestCase.php b/tests/FunctionalTests/quickstart/Controls/MultiViewTestCase.php index 2b47456e..d7a5ebec 100755 --- a/tests/FunctionalTests/quickstart/Controls/MultiViewTestCase.php +++ b/tests/FunctionalTests/quickstart/Controls/MultiViewTestCase.php @@ -1,35 +1,35 @@ <?php -class QuickstartMultiViewTestCase extends PradoGenericSeleniumTest +class QuickstartMultiViewTestCase extends PradoGenericSelenium2Test { function test () { - $this->open("../../demos/quickstart/index.php?page=Controls.Samples.TMultiView.Home&notheme=true&lang=en", ""); + $this->url("../../demos/quickstart/index.php?page=Controls.Samples.TMultiView.Home&notheme=true&lang=en"); - $this->verifyTitle("PRADO QuickStart Sample", ""); + $this->assertEquals("PRADO QuickStart Sample", $this->title()); // view 1 : type in a string - $this->verifyElementNotPresent('ctl0_body_Result1'); - $this->verifyElementNotPresent('ctl0_body_Result2'); + $this->assertElementNotPresent('ctl0_body_Result1'); + $this->assertElementNotPresent('ctl0_body_Result2'); $this->type('ctl0_body_Memo','test'); - $this->clickAndWait('ctl0$body$ctl0'); // view 2 to select the dropdown - $this->clickAndWait('ctl0$body$ctl4'); + $this->byName('ctl0$body$ctl0')->click(); // view 2 to select the dropdown + $this->byName('ctl0$body$ctl4')->click(); // view 3 : check if the output is updated - $this->verifyTextPresent('Your text input is: test'); - $this->verifyTextPresent('Your color choice is: Red'); - $this->clickAndWait('ctl0$body$ctl7'); + $this->assertContains('Your text input is: test', $this->source()); + $this->assertContains('Your color choice is: Red', $this->source()); + $this->byName('ctl0$body$ctl7')->click(); // view 2 : update dropdownlist - $this->verifyElementNotPresent('ctl0_body_Result1'); - $this->verifyElementNotPresent('ctl0_body_Result2'); - $this->select('ctl0$body$DropDownList', "label=Blue"); - $this->clickAndWait('ctl0$body$ctl4'); + $this->assertElementNotPresent('ctl0_body_Result1'); + $this->assertElementNotPresent('ctl0_body_Result2'); + $this->select('ctl0$body$DropDownList', "Blue"); + $this->byName('ctl0$body$ctl4')->click(); // view 3 : check if the output is updated - $this->verifyTextPresent('Your text input is: test'); - $this->verifyTextPresent('Your color choice is: Blue'); - $this->clickAndWait('ctl0$body$ctl7'); + $this->assertContains('Your text input is: test', $this->source()); + $this->assertContains('Your color choice is: Blue', $this->source()); + $this->byName('ctl0$body$ctl7')->click(); // view 2 : check if dropdownlist maintains state $this->assertSelected('ctl0$body$DropDownList', "Blue"); diff --git a/tests/FunctionalTests/quickstart/Controls/PagerTestCase.php b/tests/FunctionalTests/quickstart/Controls/PagerTestCase.php index a1fefed6..7e4a6627 100755 --- a/tests/FunctionalTests/quickstart/Controls/PagerTestCase.php +++ b/tests/FunctionalTests/quickstart/Controls/PagerTestCase.php @@ -1,56 +1,56 @@ <?php -class QuickstartPagerTestCase extends PradoGenericSeleniumTest +class QuickstartPagerTestCase extends PradoGenericSelenium2Test { function test() { - $this->open("../../demos/quickstart/index.php?page=Controls.Samples.TPager.Sample1&notheme=true&lang=en", ""); + $this->url("../../demos/quickstart/index.php?page=Controls.Samples.TPager.Sample1&notheme=true&lang=en"); // verify datalist content - $this->verifyTextPresent('ITN001',''); - $this->verifyTextPresent('ITN002',''); - $this->verifyTextNotPresent('ITN003',''); + $this->assertContains('ITN001', $this->source()); + $this->assertContains('ITN002', $this->source()); + $this->assertNotContains('ITN003', $this->source()); // verify numeric paging - $this->clickAndWait("ctl0_body_Pager_ctl1", ""); // 2nd page - $this->verifyTextPresent('ITN003',''); - $this->verifyTextPresent('ITN004',''); - $this->verifyTextNotPresent('ITN002',''); - $this->verifyTextNotPresent('ITN005',''); - $this->clickAndWait("ctl0_body_Pager_ctl3", ""); // 4rd page - $this->verifyTextPresent('ITN007',''); - $this->verifyTextPresent('ITN008',''); - $this->verifyTextNotPresent('ITN006',''); - $this->verifyTextNotPresent('ITN009',''); - $this->clickAndWait("ctl0_body_Pager_ctl6", ""); // last page - $this->verifyTextPresent('ITN019',''); - $this->verifyTextNotPresent('ITN018',''); - $this->verifyTextNotPresent('ITN001',''); + $this->byId("ctl0_body_Pager_ctl1")->click(); // 2nd page + $this->assertContains('ITN003', $this->source()); + $this->assertContains('ITN004', $this->source()); + $this->assertNotContains('ITN002', $this->source()); + $this->assertNotContains('ITN005', $this->source()); + $this->byId("ctl0_body_Pager_ctl3")->click(); // 4rd page + $this->assertContains('ITN007', $this->source()); + $this->assertContains('ITN008', $this->source()); + $this->assertNotContains('ITN006', $this->source()); + $this->assertNotContains('ITN009', $this->source()); + $this->byId("ctl0_body_Pager_ctl6")->click(); // last page + $this->assertContains('ITN019', $this->source()); + $this->assertNotContains('ITN018', $this->source()); + $this->assertNotContains('ITN001', $this->source()); // verify next-prev paging - $this->clickAndWait("ctl0_body_Pager2_ctl1", ""); // prev page - $this->verifyTextPresent('ITN017',''); - $this->verifyTextPresent('ITN018',''); - $this->verifyTextNotPresent('ITN019',''); - $this->verifyTextNotPresent('ITN016',''); - $this->clickAndWait("ctl0_body_Pager2_ctl0", ""); // first page - $this->verifyTextPresent('ITN001',''); - $this->verifyTextPresent('ITN002',''); - $this->verifyTextNotPresent('ITN003',''); - $this->clickAndWait("ctl0_body_Pager2_ctl2", ""); // next page - $this->verifyTextPresent('ITN003',''); - $this->verifyTextPresent('ITN004',''); - $this->verifyTextNotPresent('ITN002',''); - $this->verifyTextNotPresent('ITN005',''); + $this->byId("ctl0_body_Pager2_ctl1")->click(); // prev page + $this->assertContains('ITN017', $this->source()); + $this->assertContains('ITN018', $this->source()); + $this->assertNotContains('ITN019', $this->source()); + $this->assertNotContains('ITN016', $this->source()); + $this->byId("ctl0_body_Pager2_ctl0")->click(); // first page + $this->assertContains('ITN001', $this->source()); + $this->assertContains('ITN002', $this->source()); + $this->assertNotContains('ITN003', $this->source()); + $this->byId("ctl0_body_Pager2_ctl2")->click(); // next page + $this->assertContains('ITN003', $this->source()); + $this->assertContains('ITN004', $this->source()); + $this->assertNotContains('ITN002', $this->source()); + $this->assertNotContains('ITN005', $this->source()); $this->assertSelected("ctl0_body_Pager3_ctl0","2"); - $this->selectAndWait("ctl0_body_Pager3_ctl0", "label=5"); - $this->verifyTextPresent('ITN009',''); - $this->verifyTextPresent('ITN010',''); - $this->verifyTextNotPresent('ITN008',''); - $this->verifyTextNotPresent('ITN011',''); - $this->selectAndWait("ctl0_body_Pager3_ctl0", "label=10"); - $this->verifyTextPresent('ITN019',''); - $this->verifyTextNotPresent('ITN018',''); + $this->selectAndWait("ctl0_body_Pager3_ctl0", "5"); + $this->assertContains('ITN009', $this->source()); + $this->assertContains('ITN010', $this->source()); + $this->assertNotContains('ITN008', $this->source()); + $this->assertNotContains('ITN011', $this->source()); + $this->selectAndWait("ctl0_body_Pager3_ctl0", "10"); + $this->assertContains('ITN019', $this->source()); + $this->assertNotContains('ITN018', $this->source()); } } diff --git a/tests/FunctionalTests/quickstart/Controls/PanelTestCase.php b/tests/FunctionalTests/quickstart/Controls/PanelTestCase.php index 3def308b..0d3e2797 100755 --- a/tests/FunctionalTests/quickstart/Controls/PanelTestCase.php +++ b/tests/FunctionalTests/quickstart/Controls/PanelTestCase.php @@ -1,16 +1,16 @@ <?php -class QuickstartPanelTestCase extends PradoGenericSeleniumTest +class QuickstartPanelTestCase extends PradoGenericSelenium2Test { function test () { - $this->open("../../demos/quickstart/index.php?page=Controls.Samples.TPanel.Home&notheme=true&lang=en", ""); - $this->verifyTextPresent("This is panel content with", ""); - $this->verifyElementPresent("//span[text()='label']"); - $this->verifyTextPresent("grouping text", ""); - $this->click("//input[@name='ctl0\$body\$ctl17']", ""); - $this->verifyTextNotPresent("You have clicked on 'button2'."); - $this->clickAndWait("//input[@type='submit' and @value='button2']", ""); - $this->verifyTextPresent("You have clicked on 'button2'."); + $this->url("../../demos/quickstart/index.php?page=Controls.Samples.TPanel.Home&notheme=true&lang=en"); + $this->assertContains("This is panel content with", $this->source()); + $this->assertElementPresent("//span[text()='label']"); + $this->assertContains("grouping text", $this->source()); + $this->byXPath("//input[@name='ctl0\$body\$ctl17']")->click(); + $this->assertNotContains("You have clicked on 'button2'.", $this->source()); + $this->byXPath("//input[@type='submit' and @value='button2']")->click(); + $this->assertContains("You have clicked on 'button2'.", $this->source()); } } diff --git a/tests/FunctionalTests/quickstart/Controls/RadioButtonListTestCase.php b/tests/FunctionalTests/quickstart/Controls/RadioButtonListTestCase.php index 659f20ff..6242cebe 100755 --- a/tests/FunctionalTests/quickstart/Controls/RadioButtonListTestCase.php +++ b/tests/FunctionalTests/quickstart/Controls/RadioButtonListTestCase.php @@ -1,17 +1,17 @@ <?php //New Test -class QuickstartRadioButtonListTestCase extends PradoGenericSeleniumTest +class QuickstartRadioButtonListTestCase extends PradoGenericSelenium2Test { function test () { - $this->open("../../demos/quickstart/index.php?page=Controls.Samples.TRadioButtonList.Home&notheme=true&lang=en", ""); + $this->url("../../demos/quickstart/index.php?page=Controls.Samples.TRadioButtonList.Home&notheme=true&lang=en"); // RadioButton list with default settings: - $this->click("//input[@name='ctl0\$body\$ctl0' and @value='value 3']", ""); + $this->byXPath("//input[@name='ctl0\$body\$ctl0' and @value='value 3']")->click(); // RadioButton list with customized cellpadding, cellspacing, color and text alignment: - $this->click("//input[@name='ctl0\$body\$ctl1' and @value='value 1']", ""); + $this->byXPath("//input[@name='ctl0\$body\$ctl1' and @value='value 1']")->click(); // *** Currently unable to test the following cases: // RadioButton list with vertical (default) repeat direction @@ -20,33 +20,33 @@ class QuickstartRadioButtonListTestCase extends PradoGenericSeleniumTest // RadioButton list with flow layout and horizontal repeat direction: // RadioButton list's behavior upon postback - $this->click("//input[@name='ctl0\$body\$RadioButtonList' and @value='value 3']", ""); - $this->clickAndWait("//input[@type='submit' and @value='Submit']", ""); - $this->verifyTextPresent("Your selection is: (Index: 2, Value: value 3, Text: item 3)", ""); + $this->byXPath("//input[@name='ctl0\$body\$RadioButtonList' and @value='value 3']")->click(); + $this->byXPath("//input[@type='submit' and @value='Submit']")->click(); + $this->assertContains("Your selection is: (Index: 2, Value: value 3, Text: item 3)", $this->source()); // Auto postback check box list - $this->clickAndWait("//input[@name='ctl0\$body\$ctl7' and @value='value 5']", ""); - $this->verifyTextPresent("Your selection is: (Index: 4, Value: value 5, Text: item 5)", ""); + $this->byXPath("//input[@name='ctl0\$body\$ctl7' and @value='value 5']")->click(); + $this->assertContains("Your selection is: (Index: 4, Value: value 5, Text: item 5)", $this->source()); // Databind to an integer-indexed array - $this->clickAndWait("//input[@name='ctl0\$body\$DBRadioButtonList1' and @value='0']", ""); - $this->verifyTextPresent("Your selection is: (Index: 0, Value: 0, Text: item 1)", ""); + $this->byXPath("//input[@name='ctl0\$body\$DBRadioButtonList1' and @value='0']")->click(); + $this->assertContains("Your selection is: (Index: 0, Value: 0, Text: item 1)", $this->source()); // Databind to an associative array: - $this->clickAndWait("//input[@name='ctl0\$body\$DBRadioButtonList2' and @value='key 2']", ""); - $this->verifyTextPresent("Your selection is: (Index: 1, Value: key 2, Text: item 2)", ""); + $this->byXPath("//input[@name='ctl0\$body\$DBRadioButtonList2' and @value='key 2']")->click(); + $this->assertContains("Your selection is: (Index: 1, Value: key 2, Text: item 2)", $this->source()); // Databind with DataTextField and DataValueField specified - $this->clickAndWait("//input[@name='ctl0\$body\$DBRadioButtonList3' and @value='003']", ""); - $this->verifyTextPresent("Your selection is: (Index: 2, Value: 003, Text: Cary)", ""); + $this->byXPath("//input[@name='ctl0\$body\$DBRadioButtonList3' and @value='003']")->click(); + $this->assertContains("Your selection is: (Index: 2, Value: 003, Text: Cary)", $this->source()); // RadioButton list causing validation - $this->verifyNotVisible('ctl0_body_ctl8'); - $this->click("//input[@name='ctl0\$body\$ctl9' and @value='Agree']", ""); + $this->assertNotVisible('ctl0_body_ctl8'); + $this->byXPath("//input[@name='ctl0\$body\$ctl9' and @value='Agree']")->click(); // $this->pause(1000); - $this->verifyVisible('ctl0_body_ctl8'); + $this->assertVisible('ctl0_body_ctl8'); $this->type("ctl0\$body\$TextBox", "test"); - $this->clickAndWait("//input[@name='ctl0\$body\$ctl9' and @value='Disagree']", ""); - $this->verifyNotVisible('ctl0_body_ctl8'); + $this->byXPath("//input[@name='ctl0\$body\$ctl9' and @value='Disagree']")->click(); + $this->assertNotVisible('ctl0_body_ctl8'); } } diff --git a/tests/FunctionalTests/quickstart/Controls/RadioButtonTestCase.php b/tests/FunctionalTests/quickstart/Controls/RadioButtonTestCase.php index 22031235..214b1596 100755 --- a/tests/FunctionalTests/quickstart/Controls/RadioButtonTestCase.php +++ b/tests/FunctionalTests/quickstart/Controls/RadioButtonTestCase.php @@ -1,56 +1,56 @@ <?php -class QuickstartRadioButtonTestCase extends PradoGenericSeleniumTest +class QuickstartRadioButtonTestCase extends PradoGenericSelenium2Test { function test () { - $this->open("../../demos/quickstart/index.php?page=Controls.Samples.TRadioButton.Home&notheme=true&lang=en", ""); + $this->url("../../demos/quickstart/index.php?page=Controls.Samples.TRadioButton.Home&notheme=true&lang=en"); - $this->verifyTitle("PRADO QuickStart Sample", ""); + $this->assertEquals("PRADO QuickStart Sample", $this->title()); // a regular radiobutton - $this->click("//input[@name='ctl0\$body\$ctl0' and @value='ctl0\$body\$ctl0']", ""); + $this->byXPath("//input[@name='ctl0\$body\$ctl0' and @value='ctl0\$body\$ctl0']")->click(); // a radiobutton with customized value - $this->click("//input[@name='ctl0\$body\$ctl1' and @value='value']", ""); + $this->byXPath("//input[@name='ctl0\$body\$ctl1' and @value='value']")->click(); // an auto postback radiobutton - $this->verifyTextNotPresent("I'm clicked"); - $this->clickAndWait("//input[@name='ctl0\$body\$ctl2' and @value='ctl0\$body\$ctl2']", ""); - $this->verifyTextPresent("I'm clicked"); - $this->click("//input[@name='ctl0\$body\$ctl2' and @value='ctl0\$body\$ctl2']", ""); - $this->verifyTextPresent("I'm clicked"); + $this->assertNotContains("I'm clicked", $this->source()); + $this->byXPath("//input[@name='ctl0\$body\$ctl2' and @value='ctl0\$body\$ctl2']")->click(); + $this->assertContains("I'm clicked", $this->source()); + $this->byXPath("//input[@name='ctl0\$body\$ctl2' and @value='ctl0\$body\$ctl2']")->click(); + $this->assertContains("I'm clicked", $this->source()); // a radiobutton causing validation on a textbox - $this->verifyNotVisible('ctl0_body_ctl3'); - $this->click("//input[@name='ctl0\$body\$ctl4' and @value='ctl0\$body\$ctl4']", ""); + $this->assertNotVisible('ctl0_body_ctl3'); + $this->byXPath("//input[@name='ctl0\$body\$ctl4' and @value='ctl0\$body\$ctl4']")->click(); $this->pause(1000); - $this->verifyVisible('ctl0_body_ctl3'); - $this->click("//input[@name='ctl0\$body\$ctl4' and @value='ctl0\$body\$ctl4']", ""); + $this->assertVisible('ctl0_body_ctl3'); + $this->byXPath("//input[@name='ctl0\$body\$ctl4' and @value='ctl0\$body\$ctl4']")->click(); $this->pause(1000); - $this->verifyVisible('ctl0_body_ctl3'); + $this->assertVisible('ctl0_body_ctl3'); $this->type("ctl0\$body\$TextBox", "test"); - $this->clickAndWait("//input[@name='ctl0\$body\$ctl4' and @value='ctl0\$body\$ctl4']", ""); - $this->verifyNotVisible('ctl0_body_ctl3'); + $this->byXPath("//input[@name='ctl0\$body\$ctl4' and @value='ctl0\$body\$ctl4']")->click(); + $this->assertNotVisible('ctl0_body_ctl3'); // a radiobutton validated by a required field validator - $this->verifyNotVisible('ctl0_body_ctl6'); - $this->click("//input[@type='submit' and @value='Submit']", ""); + $this->assertNotVisible('ctl0_body_ctl6'); + $this->byXPath("//input[@type='submit' and @value='Submit']")->click(); $this->pause(1000); - $this->verifyVisible('ctl0_body_ctl6'); - $this->click("//input[@name='ctl0\$body\$RadioButton' and @value='ctl0\$body\$RadioButton']", ""); - $this->clickAndWait("//input[@type='submit' and @value='Submit']", ""); - $this->verifyNotVisible('ctl0_body_ctl6'); + $this->assertVisible('ctl0_body_ctl6'); + $this->byXPath("//input[@name='ctl0\$body\$RadioButton' and @value='ctl0\$body\$RadioButton']")->click(); + $this->byXPath("//input[@type='submit' and @value='Submit']")->click(); + $this->assertNotVisible('ctl0_body_ctl6'); // a radiobutton group - $this->clickAndWait("name=ctl0\$body\$ctl7", ""); - $this->verifyTextPresent("Your selection is empty"); - $this->click("//input[@name='ctl0\$body\$RadioGroup' and @value='ctl0\$body\$Radio2']", ""); - $this->clickAndWait("name=ctl0\$body\$ctl7", ""); - $this->verifyTextPresent("Your selection is 2"); - $this->click("//input[@name='ctl0\$body\$RadioGroup' and @value='ctl0\$body\$Radio3']", ""); - $this->click("//input[@name='ctl0\$body\$Radio4' and @value='ctl0\$body\$Radio4']", ""); - $this->clickAndWait("name=ctl0\$body\$ctl7", ""); - $this->verifyTextPresent("Your selection is 34"); + $this->byName("ctl0\$body\$ctl7")->click(); + $this->assertContains("Your selection is empty", $this->source()); + $this->byXPath("//input[@name='ctl0\$body\$RadioGroup' and @value='ctl0\$body\$Radio2']")->click(); + $this->byName("ctl0\$body\$ctl7")->click(); + $this->assertContains("Your selection is 2", $this->source()); + $this->byXPath("//input[@name='ctl0\$body\$RadioGroup' and @value='ctl0\$body\$Radio3']")->click(); + $this->byXPath("//input[@name='ctl0\$body\$Radio4' and @value='ctl0\$body\$Radio4']")->click(); + $this->byName("ctl0\$body\$ctl7")->click(); + $this->assertContains("Your selection is 34", $this->source()); } } diff --git a/tests/FunctionalTests/quickstart/Controls/Repeater1TestCase.php b/tests/FunctionalTests/quickstart/Controls/Repeater1TestCase.php index 948055e1..4d7db9b3 100755 --- a/tests/FunctionalTests/quickstart/Controls/Repeater1TestCase.php +++ b/tests/FunctionalTests/quickstart/Controls/Repeater1TestCase.php @@ -1,27 +1,27 @@ <?php -class QuickstartRepeater1TestCase extends PradoGenericSeleniumTest +class QuickstartRepeater1TestCase extends PradoGenericSelenium2Test { function test() { - $this->open("../../demos/quickstart/index.php?page=Controls.Samples.TRepeater.Sample1&notheme=true&lang=en", ""); + $this->url("../../demos/quickstart/index.php?page=Controls.Samples.TRepeater.Sample1&notheme=true&lang=en"); // verify if all required texts are present - $this->verifyTextPresent('ID',''); - $this->verifyTextPresent('Name',''); - $this->verifyTextPresent('Quantity',''); - $this->verifyTextPresent('Price',''); - $this->verifyTextPresent('Imported',''); - $this->verifyTextPresent('ITN001',''); - $this->verifyTextPresent('Motherboard',''); - $this->verifyTextPresent('Yes',''); - $this->verifyTextPresent('ITN019',''); - $this->verifyTextPresent('Speaker',''); - $this->verifyTextPresent('No',''); - $this->verifyTextPresent('Computer Parts Inventory',''); + $this->assertContains('ID', $this->source()); + $this->assertContains('Name', $this->source()); + $this->assertContains('Quantity', $this->source()); + $this->assertContains('Price', $this->source()); + $this->assertContains('Imported', $this->source()); + $this->assertContains('ITN001', $this->source()); + $this->assertContains('Motherboard', $this->source()); + $this->assertContains('Yes', $this->source()); + $this->assertContains('ITN019', $this->source()); + $this->assertContains('Speaker', $this->source()); + $this->assertContains('No', $this->source()); + $this->assertContains('Computer Parts Inventory', $this->source()); // verify specific table tags - $this->verifyElementPresent("//td[@colspan='5']"); - $this->verifyElementPresent("//table[@cellpadding='2']"); + $this->assertElementPresent("//td[@colspan='5']"); + $this->assertElementPresent("//table[@cellpadding='2']"); } } diff --git a/tests/FunctionalTests/quickstart/Controls/Repeater2TestCase.php b/tests/FunctionalTests/quickstart/Controls/Repeater2TestCase.php index 7d989fd0..8eb8c863 100755 --- a/tests/FunctionalTests/quickstart/Controls/Repeater2TestCase.php +++ b/tests/FunctionalTests/quickstart/Controls/Repeater2TestCase.php @@ -1,35 +1,35 @@ <?php -class QuickstartRepeater2TestCase extends PradoGenericSeleniumTest +class QuickstartRepeater2TestCase extends PradoGenericSelenium2Test { function test() { - $this->open("../../demos/quickstart/index.php?page=Controls.Samples.TRepeater.Sample2&notheme=true&lang=en", ""); + $this->url("../../demos/quickstart/index.php?page=Controls.Samples.TRepeater.Sample2&notheme=true&lang=en"); // verify if all required texts are present - $this->verifyTextPresent('North',''); - $this->verifyTextPresent('John',''); - $this->verifyTextPresent('Developer',''); - $this->verifyTextPresent('South',''); - $this->verifyTextPresent('Carter',''); - $this->verifyTextPresent('Program Manager',''); + $this->assertContains('North', $this->source()); + $this->assertContains('John', $this->source()); + $this->assertContains('Developer', $this->source()); + $this->assertContains('South', $this->source()); + $this->assertContains('Carter', $this->source()); + $this->assertContains('Program Manager', $this->source()); // verify specific table tags - $this->verifyElementPresent("//table[@cellspacing='1']"); - $this->verifyElementPresent("//td[@id='ctl0_body_Repeater_ctl1_Cell' and contains(text(),'North')]",""); - $this->verifyElementPresent("//td[@id='ctl0_body_Repeater_ctl1_Cell']",""); - $this->verifyElementPresent("//td[@id='ctl0_body_Repeater_ctl2_Cell']",""); - $this->verifyElementPresent("//td[@id='ctl0_body_Repeater_ctl3_Cell']",""); - $this->verifyElementPresent("//td[@id='ctl0_body_Repeater_ctl4_Cell']",""); - $this->verifyElementPresent("//tr[@id='ctl0_body_Repeater_ctl1_Repeater2_ctl1_Row']",""); - $this->verifyElementPresent("//tr[@id='ctl0_body_Repeater_ctl1_Repeater2_ctl2_Row']",""); - $this->verifyElementPresent("//tr[@id='ctl0_body_Repeater_ctl1_Repeater2_ctl3_Row']",""); - $this->verifyElementPresent("//tr[@id='ctl0_body_Repeater_ctl2_Repeater2_ctl1_Row']",""); - $this->verifyElementPresent("//tr[@id='ctl0_body_Repeater_ctl2_Repeater2_ctl2_Row']",""); - $this->verifyElementPresent("//tr[@id='ctl0_body_Repeater_ctl2_Repeater2_ctl3_Row']",""); - $this->verifyElementPresent("//tr[@id='ctl0_body_Repeater_ctl3_Repeater2_ctl1_Row']",""); - $this->verifyElementPresent("//tr[@id='ctl0_body_Repeater_ctl3_Repeater2_ctl2_Row']",""); - $this->verifyElementPresent("//tr[@id='ctl0_body_Repeater_ctl4_Repeater2_ctl1_Row']",""); - $this->verifyElementPresent("//tr[@id='ctl0_body_Repeater_ctl4_Repeater2_ctl2_Row']",""); + $this->assertElementPresent("//table[@cellspacing='1']"); + $this->assertElementPresent("//td[@id='ctl0_body_Repeater_ctl1_Cell' and contains(text(),'North')]",""); + $this->assertElementPresent("//td[@id='ctl0_body_Repeater_ctl1_Cell']",""); + $this->assertElementPresent("//td[@id='ctl0_body_Repeater_ctl2_Cell']",""); + $this->assertElementPresent("//td[@id='ctl0_body_Repeater_ctl3_Cell']",""); + $this->assertElementPresent("//td[@id='ctl0_body_Repeater_ctl4_Cell']",""); + $this->assertElementPresent("//tr[@id='ctl0_body_Repeater_ctl1_Repeater2_ctl1_Row']",""); + $this->assertElementPresent("//tr[@id='ctl0_body_Repeater_ctl1_Repeater2_ctl2_Row']",""); + $this->assertElementPresent("//tr[@id='ctl0_body_Repeater_ctl1_Repeater2_ctl3_Row']",""); + $this->assertElementPresent("//tr[@id='ctl0_body_Repeater_ctl2_Repeater2_ctl1_Row']",""); + $this->assertElementPresent("//tr[@id='ctl0_body_Repeater_ctl2_Repeater2_ctl2_Row']",""); + $this->assertElementPresent("//tr[@id='ctl0_body_Repeater_ctl2_Repeater2_ctl3_Row']",""); + $this->assertElementPresent("//tr[@id='ctl0_body_Repeater_ctl3_Repeater2_ctl1_Row']",""); + $this->assertElementPresent("//tr[@id='ctl0_body_Repeater_ctl3_Repeater2_ctl2_Row']",""); + $this->assertElementPresent("//tr[@id='ctl0_body_Repeater_ctl4_Repeater2_ctl1_Row']",""); + $this->assertElementPresent("//tr[@id='ctl0_body_Repeater_ctl4_Repeater2_ctl2_Row']",""); } } diff --git a/tests/FunctionalTests/quickstart/Controls/Repeater3TestCase.php b/tests/FunctionalTests/quickstart/Controls/Repeater3TestCase.php index a5031af5..3572a36f 100755 --- a/tests/FunctionalTests/quickstart/Controls/Repeater3TestCase.php +++ b/tests/FunctionalTests/quickstart/Controls/Repeater3TestCase.php @@ -1,35 +1,35 @@ <?php -class QuickstartRepeater3TestCase extends PradoGenericSeleniumTest +class QuickstartRepeater3TestCase extends PradoGenericSelenium2Test { function test() { - $this->open("../../demos/quickstart/index.php?page=Controls.Samples.TRepeater.Sample3&notheme=true&lang=en", ""); + $this->url("../../demos/quickstart/index.php?page=Controls.Samples.TRepeater.Sample3&notheme=true&lang=en"); // verify product name is required - $this->verifyNotVisible('ctl0_body_Repeater_ctl0_ctl0'); + $this->assertNotVisible('ctl0_body_Repeater_ctl0_ctl0'); $this->type("ctl0_body_Repeater_ctl0_ProductName", ""); - $this->click("//input[@type='submit' and @value='Save']", ""); - $this->verifyVisible('ctl0_body_Repeater_ctl0_ctl0'); + $this->byXPath("//input[@type='submit' and @value='Save']")->click(); + $this->assertVisible('ctl0_body_Repeater_ctl0_ctl0'); // verify product price is of proper format - $this->verifyNotVisible('ctl0_body_Repeater_ctl0_ctl1'); + $this->assertNotVisible('ctl0_body_Repeater_ctl0_ctl1'); $this->type("ctl0_body_Repeater_ctl0_ProductPrice", "abc"); - $this->click("//input[@type='submit' and @value='Save']", ""); - $this->verifyVisible('ctl0_body_Repeater_ctl0_ctl1'); + $this->byXPath("//input[@type='submit' and @value='Save']")->click(); + $this->assertVisible('ctl0_body_Repeater_ctl0_ctl1'); // perform postback - $this->click("ctl0_body_Repeater_ctl0_ProductImported",''); + $this->byId("ctl0_body_Repeater_ctl0_ProductImported",'')->click(); $this->type("ctl0_body_Repeater_ctl0_ProductName", "Mother Board"); $this->type("ctl0_body_Repeater_ctl0_ProductPrice", "99.01"); - $this->select("ctl0_body_Repeater_ctl3_ProductCategory", "label=Accessories"); - $this->clickAndWait("//input[@type='submit' and @value='Save']", ""); - $this->verifyNotVisible('ctl0_body_Repeater_ctl0_ctl0'); - $this->verifyNotVisible('ctl0_body_Repeater_ctl0_ctl1'); + $this->select("ctl0_body_Repeater_ctl3_ProductCategory", "Accessories"); + $this->byXPath("//input[@type='submit' and @value='Save']")->click(); + $this->assertNotVisible('ctl0_body_Repeater_ctl0_ctl0'); + $this->assertNotVisible('ctl0_body_Repeater_ctl0_ctl1'); // verify postback results - $this->verifyElementPresent("//td[text()='Mother Board']",''); - $this->verifyElementNotPresent("//td[text()='Input Devices']",''); - $this->verifyElementPresent("//td[text()='99.01']",''); + $this->assertElementPresent("//td[text()='Mother Board']",''); + $this->assertElementNotPresent("//td[text()='Input Devices']",''); + $this->assertElementPresent("//td[text()='99.01']",''); } } diff --git a/tests/FunctionalTests/quickstart/Controls/StatementsTestCase.php b/tests/FunctionalTests/quickstart/Controls/StatementsTestCase.php index a7c4c579..df0e6f89 100755 --- a/tests/FunctionalTests/quickstart/Controls/StatementsTestCase.php +++ b/tests/FunctionalTests/quickstart/Controls/StatementsTestCase.php @@ -1,13 +1,13 @@ <?php -class QuickstartStatementsTestCase extends PradoGenericSeleniumTest +class QuickstartStatementsTestCase extends PradoGenericSelenium2Test { function test () { - $this->open("../../demos/quickstart/index.php?page=Controls.Samples.TStatements.Home&notheme=true&lang=en", ""); + $this->url("../../demos/quickstart/index.php?page=Controls.Samples.TStatements.Home&notheme=true&lang=en"); - $this->verifyTitle("PRADO QuickStart Sample", ""); + $this->assertEquals("PRADO QuickStart Sample", $this->title()); - $this->verifyTextPresent('UniqueID is \'ctl0$body$ctl0\''); + $this->assertContains('UniqueID is \'ctl0$body$ctl0\'', $this->source()); } } diff --git a/tests/FunctionalTests/quickstart/Controls/TabPanelTestCase.php b/tests/FunctionalTests/quickstart/Controls/TabPanelTestCase.php index d01e824d..13392ca5 100755 --- a/tests/FunctionalTests/quickstart/Controls/TabPanelTestCase.php +++ b/tests/FunctionalTests/quickstart/Controls/TabPanelTestCase.php @@ -1,47 +1,47 @@ <?php -class QuickstartTabPanelTestCase extends PradoGenericSeleniumTest +class QuickstartTabPanelTestCase extends PradoGenericSelenium2Test { function test () { - $this->open("../../demos/quickstart/index.php?page=Controls.Samples.TTabPanel.Home&notheme=true&lang=en", ""); + $this->url("../../demos/quickstart/index.php?page=Controls.Samples.TTabPanel.Home&notheme=true&lang=en"); - $this->verifyTitle("PRADO QuickStart Sample", ""); + $this->assertEquals("PRADO QuickStart Sample", $this->title()); // verify initial visibility - $this->verifyNotVisible('ctl0_body_View1'); // view 1 - $this->verifyVisible('ctl0_body_View2'); // view 2 - $this->verifyNotVisible('ctl0_body_ctl2'); // view 3 + $this->assertNotVisible('ctl0_body_View1'); // view 1 + $this->assertVisible('ctl0_body_View2'); // view 2 + $this->assertNotVisible('ctl0_body_ctl2'); // view 3 // switching to the first view - $this->click('ctl0_body_View1_0'); + $this->byId('ctl0_body_View1_0')->click(); $this->pause(500); - $this->verifyVisible('ctl0_body_View1'); // view 1 - $this->verifyNotVisible('ctl0_body_View2'); // view 2 - $this->verifyNotVisible('ctl0_body_ctl2'); // view 3 - $this->verifyNotVisible('ctl0_body_View11'); // view 11 - $this->verifyVisible('ctl0_body_View21'); // view 21 + $this->assertVisible('ctl0_body_View1'); // view 1 + $this->assertNotVisible('ctl0_body_View2'); // view 2 + $this->assertNotVisible('ctl0_body_ctl2'); // view 3 + $this->assertNotVisible('ctl0_body_View11'); // view 11 + $this->assertVisible('ctl0_body_View21'); // view 21 // switching to View11 - $this->click('ctl0_body_View11_0'); + $this->byId('ctl0_body_View11_0')->click(); $this->pause(500); - $this->verifyVisible('ctl0_body_View1'); // view 1 - $this->verifyNotVisible('ctl0_body_View2'); // view 2 - $this->verifyNotVisible('ctl0_body_ctl2'); // view 3 - $this->verifyVisible('ctl0_body_View11'); // view 11 - $this->verifyNotVisible('ctl0_body_View21'); // view 21 + $this->assertVisible('ctl0_body_View1'); // view 1 + $this->assertNotVisible('ctl0_body_View2'); // view 2 + $this->assertNotVisible('ctl0_body_ctl2'); // view 3 + $this->assertVisible('ctl0_body_View11'); // view 11 + $this->assertNotVisible('ctl0_body_View21'); // view 21 // switching to the third view - $this->click('ctl0_body_ctl2_0'); + $this->byId('ctl0_body_ctl2_0')->click(); $this->pause(500); - $this->verifyNotVisible('ctl0_body_View1'); // view 1 - $this->verifyNotVisible('ctl0_body_View2'); // view 2 - $this->verifyVisible('ctl0_body_ctl2'); // view 3 + $this->assertNotVisible('ctl0_body_View1'); // view 1 + $this->assertNotVisible('ctl0_body_View2'); // view 2 + $this->assertVisible('ctl0_body_ctl2'); // view 3 // submit: check if the visibility is kept - $this->clickAndWait("//input[@type='submit' and @value='Submit']", ""); - $this->verifyNotVisible('ctl0_body_View1'); // view 1 - $this->verifyNotVisible('ctl0_body_View2'); // view 2 - $this->verifyVisible('ctl0_body_ctl2'); // view 3 + $this->byXPath("//input[@type='submit' and @value='Submit']")->click(); + $this->assertNotVisible('ctl0_body_View1'); // view 1 + $this->assertNotVisible('ctl0_body_View2'); // view 2 + $this->assertVisible('ctl0_body_ctl2'); // view 3 } } diff --git a/tests/FunctionalTests/quickstart/Controls/TableTestCase.php b/tests/FunctionalTests/quickstart/Controls/TableTestCase.php index 128f4b22..aafd6f80 100755 --- a/tests/FunctionalTests/quickstart/Controls/TableTestCase.php +++ b/tests/FunctionalTests/quickstart/Controls/TableTestCase.php @@ -1,18 +1,18 @@ <?php -class QuickstartTableTestCase extends PradoGenericSeleniumTest +class QuickstartTableTestCase extends PradoGenericSelenium2Test { function test () { - $this->open("../../demos/quickstart/index.php?page=Controls.Samples.TTable.Home&notheme=true&lang=en", ""); + $this->url("../../demos/quickstart/index.php?page=Controls.Samples.TTable.Home&notheme=true&lang=en"); - $this->verifyElementPresent("//table[@rules='all' and @border='1']"); - $this->verifyElementPresent("//table/caption[@align='bottom' and text()='This is table caption']"); - $this->verifyElementPresent("//th[text()='header cell 2']"); - $this->verifyElementPresent("//tr[@align='right']/td[text()='text']"); - $this->verifyElementPresent("//td[@align='center' and contains(text(),'cell 5')]"); + $this->assertElementPresent("//table[@rules='all' and @border='1']"); + $this->assertElementPresent("//table/caption[@align='bottom' and text()='This is table caption']"); + $this->assertElementPresent("//th[text()='header cell 2']"); + $this->assertElementPresent("//tr[@align='right']/td[text()='text']"); + $this->assertElementPresent("//td[@align='center' and contains(text(),'cell 5')]"); - $this->verifyElementPresent("//th[text()='Header 1']"); - $this->verifyElementPresent("//td[text()='Cell 1']"); + $this->assertElementPresent("//th[text()='Header 1']"); + $this->assertElementPresent("//td[text()='Cell 1']"); } } diff --git a/tests/FunctionalTests/quickstart/Controls/TextBoxTestCase.php b/tests/FunctionalTests/quickstart/Controls/TextBoxTestCase.php index a3464702..3865e33d 100755 --- a/tests/FunctionalTests/quickstart/Controls/TextBoxTestCase.php +++ b/tests/FunctionalTests/quickstart/Controls/TextBoxTestCase.php @@ -1,58 +1,58 @@ <?php -class QuickstartTextBoxTestCase extends PradoGenericSeleniumTest +class QuickstartTextBoxTestCase extends PradoGenericSelenium2Test { function test () { - $this->open("../../demos/quickstart/index.php?page=Controls.Samples.TTextBox.Home&notheme=true&lang=en", ""); + $this->url("../../demos/quickstart/index.php?page=Controls.Samples.TTextBox.Home&notheme=true&lang=en"); - $this->verifyTitle("PRADO QuickStart Sample", ""); + $this->assertEquals("PRADO QuickStart Sample", $this->title()); // a normal textbox $this->type("ctl0\$body\$ctl0", "test"); // textbox with maxlength set - $this->verifyAttribute("ctl0\$body\$ctl1@size","4"); - $this->verifyAttribute("ctl0\$body\$ctl1@maxlength","6"); + $this->assertAttribute("ctl0\$body\$ctl1@size","4"); + $this->assertAttribute("ctl0\$body\$ctl1@maxlength","6"); $this->type("ctl0\$body\$ctl1", "textte"); // vCard textboxes - $this->verifyAttribute("ctl0\$body\$ctl2@vcard_name","vCard.FirstName"); + $this->assertAttribute("ctl0\$body\$ctl2@vcard_name","vCard.FirstName"); $this->type("ctl0\$body\$ctl2", "first"); - $this->verifyAttribute("ctl0\$body\$ctl3@vcard_name","vCard.LastName"); + $this->assertAttribute("ctl0\$body\$ctl3@vcard_name","vCard.LastName"); $this->type("ctl0\$body\$ctl3", "last"); // a disabled textbox - $this->verifyAttribute("ctl0\$body\$ctl4@disabled","regexp:true|disabled"); + $this->assertAttribute("ctl0\$body\$ctl4@disabled","regexp:true|disabled"); // a read-only textbox - $this->verifyAttribute("ctl0\$body\$ctl5@readonly","regexp:true|readonly"); + $this->assertAttribute("ctl0\$body\$ctl5@readonly","regexp:true|readonly"); // auto postback textbox, CausesValidation=false - $this->verifyValue("ctl0\$body\$ctl6", "change me"); - $this->typeAndWait("ctl0\$body\$ctl6", "change mes"); - $this->verifyValue("ctl0\$body\$ctl6", "text changed"); + $this->assertValue("ctl0\$body\$ctl6", "change me"); + $this->typeSpecial("ctl0\$body\$ctl6", "change mes"); + $this->assertValue("ctl0\$body\$ctl6", "text changed"); // auto postback textbox, CausesValidation=true - $this->verifyNotVisible('ctl0_body_ctl7'); - $this->type("ctl0\$body\$TextBox3", "test"); + $this->assertNotVisible('ctl0_body_ctl7'); + $this->typeSpecial("ctl0\$body\$TextBox3", "test"); // $this->pause(1000); - $this->verifyVisible('ctl0_body_ctl7'); - $this->typeAndWait("ctl0\$body\$TextBox3", "non test"); - $this->verifyNotVisible('ctl0_body_ctl7'); + $this->assertVisible('ctl0_body_ctl7'); + $this->typeSpecial("ctl0\$body\$TextBox3", "non test"); + $this->assertNotVisible('ctl0_body_ctl7'); // submitting textbox with a button $this->type("ctl0\$body\$TextBox1", "texttext"); - $this->clickAndWait("//input[@type='submit' and @value='Submit']", ""); - $this->verifyValue("ctl0\$body\$TextBox1", "You just entered 'texttext'."); + $this->byXPath("//input[@type='submit' and @value='Submit']")->click(); + $this->assertValue("ctl0\$body\$TextBox1", "You just entered 'texttext'."); // SafeText - $this->verifyText("ctl0_body_Output","test"); - $this->typeAndWait("ctl0\$body\$TextBox2","<a href=javascript:xxx>malicious code</a>"); - $this->verifyText("ctl0_body_Output","malicious code"); + $this->assertText("ctl0_body_Output","test"); + $this->typeSpecial("ctl0\$body\$TextBox2","<a href=javascript:xxx>malicious code</a>"); + $this->assertText("ctl0_body_Output","malicious code"); // password - $this->verifyAttribute("ctl0\$body\$ctl9@type","password"); + $this->assertAttribute("ctl0\$body\$ctl9@type","password"); // ------------------multiline textbox---------------------- @@ -64,28 +64,28 @@ End of message "); // a disabled multiline textbox - $this->verifyAttribute("ctl0\$body\$ctl12@disabled","regexp:true|disabled"); + $this->assertAttribute("ctl0\$body\$ctl12@disabled","regexp:true|disabled"); // a read-only multiline textbox - $this->verifyAttribute("ctl0\$body\$ctl13@readonly","regexp:true|readonly"); - $this->verifyAttribute("ctl0\$body\$ctl13@wrap","off"); + $this->assertAttribute("ctl0\$body\$ctl13@readonly","regexp:true|readonly"); + $this->assertAttribute("ctl0\$body\$ctl13@wrap","off"); // auto postback textbox - $this->verifyValue("ctl0\$body\$ctl14", "change me"); - $this->typeAndWait("ctl0\$body\$ctl14", "change mes"); - $this->verifyValue("ctl0\$body\$ctl14", "text changed"); - $this->verifyValue("ctl0\$body\$ctl10", "This is a\nmultiline\ntextbox."); - $this->verifyValue("ctl0\$body\$ctl11", "This is a multiline text box. + $this->assertValue("ctl0\$body\$ctl14", "change me"); + $this->typeSpecial("ctl0\$body\$ctl14", "change mes"); + $this->assertValue("ctl0\$body\$ctl14", "text changed"); + $this->assertValue("ctl0\$body\$ctl10", "This is a\nmultiline\ntextbox."); + $this->assertValue("ctl0\$body\$ctl11", "This is a multiline text box. In HTML, it is displayed as a textarea. End of message "); // textbox associated with a validator - $this->verifyNotVisible('ctl0_body_ctl15'); - $this->type("ctl0\$body\$MultiTextBox3", "demo"); + $this->assertNotVisible('ctl0_body_ctl15'); + $this->typeSpecial("ctl0\$body\$MultiTextBox3", "demo"); // $this->pause(1000); - $this->verifyVisible('ctl0_body_ctl15'); - $this->typeAndWait("ctl0\$body\$MultiTextBox3", "non demo"); - $this->verifyNotVisible('ctl0_body_ctl15'); + $this->assertVisible('ctl0_body_ctl15'); + $this->typeSpecial("ctl0\$body\$MultiTextBox3", "non demo"); + $this->assertNotVisible('ctl0_body_ctl15'); } } diff --git a/tests/FunctionalTests/quickstart/Controls/Wizard1TestCase.php b/tests/FunctionalTests/quickstart/Controls/Wizard1TestCase.php index 5e7018c4..7ac55349 100755 --- a/tests/FunctionalTests/quickstart/Controls/Wizard1TestCase.php +++ b/tests/FunctionalTests/quickstart/Controls/Wizard1TestCase.php @@ -1,24 +1,24 @@ <?php -class QuickstartWizard1TestCase extends PradoGenericSeleniumTest +class QuickstartWizard1TestCase extends PradoGenericSelenium2Test { function test () { - $this->open("../../demos/quickstart/index.php?page=Controls.Samples.TWizard.Sample1&notheme=true&lang=en", ""); + $this->url("../../demos/quickstart/index.php?page=Controls.Samples.TWizard.Sample1&notheme=true&lang=en"); - $this->verifyTitle("PRADO QuickStart Sample", ""); + $this->assertEquals("PRADO QuickStart Sample", $this->title()); // step 1 - $this->verifyTextPresent('Wizard Step 1'); - $this->verifyTextNotPresent('Wizard Step 2'); - $this->verifyVisible('ctl0_body_Wizard1_SideBarList_ctl0_SideBarButton'); - $this->verifyAttribute('ctl0_body_Wizard1_SideBarList_ctl1_SideBarButton@disabled','regexp:true|disabled'); - $this->select('ctl0$body$Wizard1$DropDownList1', "label=Purple"); - $this->clickAndWait('ctl0$body$Wizard1$ctl6$ctl1'); + $this->assertContains('Wizard Step 1', $this->source()); + $this->assertNotContains('Wizard Step 2', $this->source()); + $this->assertVisible('ctl0_body_Wizard1_SideBarList_ctl0_SideBarButton'); + $this->assertAttribute('ctl0_body_Wizard1_SideBarList_ctl1_SideBarButton@disabled','regexp:true|disabled'); + $this->select('ctl0$body$Wizard1$DropDownList1', "Purple"); + $this->byName('ctl0$body$Wizard1$ctl6$ctl1')->click(); // step 2 - $this->verifyTextPresent('Your favorite color is: Purple'); - $this->verifyTextNotPresent('Wizard Step 1'); - $this->verifyTextPresent('Wizard Step 2'); + $this->assertContains('Your favorite color is: Purple', $this->source()); + $this->assertNotContains('Wizard Step 1', $this->source()); + $this->assertContains('Wizard Step 2', $this->source()); } } diff --git a/tests/FunctionalTests/quickstart/Controls/Wizard2TestCase.php b/tests/FunctionalTests/quickstart/Controls/Wizard2TestCase.php index a77280ff..85ef8655 100755 --- a/tests/FunctionalTests/quickstart/Controls/Wizard2TestCase.php +++ b/tests/FunctionalTests/quickstart/Controls/Wizard2TestCase.php @@ -1,24 +1,24 @@ <?php -class QuickstartWizard2TestCase extends PradoGenericSeleniumTest +class QuickstartWizard2TestCase extends PradoGenericSelenium2Test { function test () { - $this->open("../../demos/quickstart/index.php?page=Controls.Samples.TWizard.Sample2&notheme=true&lang=en", ""); + $this->url("../../demos/quickstart/index.php?page=Controls.Samples.TWizard.Sample2&notheme=true&lang=en"); - $this->verifyTitle("PRADO QuickStart Sample", ""); + $this->assertEquals("PRADO QuickStart Sample", $this->title()); // step 1 - $this->verifyTextPresent('Please let us know your preference'); - $this->verifyTextNotPresent('Thank you for your answer'); - $this->verifyVisible('ctl0_body_Wizard1_SideBarList_ctl0_SideBarButton'); - $this->verifyAttribute('ctl0_body_Wizard1_SideBarList_ctl1_SideBarButton@disabled','regexp:true|disabled'); - $this->select('ctl0$body$Wizard1$DropDownList1', "label=Blue"); - $this->clickAndWait('ctl0$body$Wizard1$ctl6$ctl1'); + $this->assertContains('Please let us know your preference', $this->source()); + $this->assertNotContains('Thank you for your answer', $this->source()); + $this->assertVisible('ctl0_body_Wizard1_SideBarList_ctl0_SideBarButton'); + $this->assertAttribute('ctl0_body_Wizard1_SideBarList_ctl1_SideBarButton@disabled','regexp:true|disabled'); + $this->select('ctl0$body$Wizard1$DropDownList1', "Blue"); + $this->byName('ctl0$body$Wizard1$ctl6$ctl1')->click(); // step 2 - $this->verifyTextPresent('Your favorite color is: Blue'); - $this->verifyTextNotPresent('Please let us know your preference'); - $this->verifyTextPresent('Thank you for your answer'); + $this->assertContains('Your favorite color is: Blue', $this->source()); + $this->assertNotContains('Please let us know your preference', $this->source()); + $this->assertContains('Thank you for your answer', $this->source()); } } diff --git a/tests/FunctionalTests/quickstart/Controls/Wizard3TestCase.php b/tests/FunctionalTests/quickstart/Controls/Wizard3TestCase.php index ec0efe90..2568f233 100755 --- a/tests/FunctionalTests/quickstart/Controls/Wizard3TestCase.php +++ b/tests/FunctionalTests/quickstart/Controls/Wizard3TestCase.php @@ -1,44 +1,44 @@ <?php -class QuickstartWizard3TestCase extends PradoGenericSeleniumTest +class QuickstartWizard3TestCase extends PradoGenericSelenium2Test { function test () { - $this->open("../../demos/quickstart/index.php?page=Controls.Samples.TWizard.Sample3&notheme=true&lang=en", ""); + $this->url("../../demos/quickstart/index.php?page=Controls.Samples.TWizard.Sample3&notheme=true&lang=en"); - $this->verifyTitle("PRADO QuickStart Sample", ""); + $this->assertEquals("PRADO QuickStart Sample", $this->title()); // step 1 - $this->verifyTextPresent('A Mini Survey'); - $this->verifyTextPresent('PRADO QuickStart Sample'); - $this->click('ctl0_body_Wizard3_StudentCheckBox'); - $this->clickAndWait('ctl0$body$Wizard3$ctl4$ctl0'); + $this->assertContains('A Mini Survey', $this->source()); + $this->assertContains('PRADO QuickStart Sample', $this->source()); + $this->byId('ctl0_body_Wizard3_StudentCheckBox')->click(); + $this->byName('ctl0$body$Wizard3$ctl4$ctl0')->click(); // step 2 - $this->select('ctl0$body$Wizard3$DropDownList11', "label=Chemistry"); - $this->clickAndWait('ctl0$body$Wizard3$ctl5$ctl1'); + $this->select('ctl0$body$Wizard3$DropDownList11', "Chemistry"); + $this->byName('ctl0$body$Wizard3$ctl5$ctl1')->click(); // step 3 - $this->select('ctl0$body$Wizard3$DropDownList22', "label=Tennis"); - $this->clickAndWait('ctl0$body$Wizard3$ctl6$ctl1'); + $this->select('ctl0$body$Wizard3$DropDownList22', "Tennis"); + $this->byName('ctl0$body$Wizard3$ctl6$ctl1')->click(); // step 4 - $this->verifyTextPresent('You are a college student'); - $this->verifyTextPresent('You are in major: Chemistry'); - $this->verifyTextPresent('Your favorite sport is: Tennis'); + $this->assertContains('You are a college student', $this->source()); + $this->assertContains('You are in major: Chemistry', $this->source()); + $this->assertContains('Your favorite sport is: Tennis', $this->source()); // run the example again. this time we skip the page asking about major - $this->open("../../demos/quickstart/index.php?page=Controls.Samples.TWizard.Sample3&notheme=true", ""); + $this->url("../../demos/quickstart/index.php?page=Controls.Samples.TWizard.Sample3&notheme=true"); // step 1 - $this->clickAndWait('ctl0$body$Wizard3$ctl4$ctl0'); + $this->byName('ctl0$body$Wizard3$ctl4$ctl0')->click(); // step 3 - $this->select('ctl0$body$Wizard3$DropDownList22', "label=Baseball"); - $this->clickAndWait('ctl0$body$Wizard3$ctl6$ctl1'); + $this->select('ctl0$body$Wizard3$DropDownList22', "Baseball"); + $this->byName('ctl0$body$Wizard3$ctl6$ctl1')->click(); // step 4 - $this->verifyTextNotPresent('You are a college student'); - $this->verifyTextPresent('Your favorite sport is: Baseball'); + $this->assertNotContains('You are a college student', $this->source()); + $this->assertContains('Your favorite sport is: Baseball', $this->source()); } } diff --git a/tests/FunctionalTests/quickstart/Controls/Wizard4TestCase.php b/tests/FunctionalTests/quickstart/Controls/Wizard4TestCase.php index f2b8ad6e..41d3463e 100755 --- a/tests/FunctionalTests/quickstart/Controls/Wizard4TestCase.php +++ b/tests/FunctionalTests/quickstart/Controls/Wizard4TestCase.php @@ -1,42 +1,42 @@ <?php -class QuickstartWizard4TestCase extends PradoGenericSeleniumTest +class QuickstartWizard4TestCase extends PradoGenericSelenium2Test { function test () { - $this->open("../../demos/quickstart/index.php?page=Controls.Samples.TWizard.Sample4&notheme=true&lang=en", ""); + $this->url("../../demos/quickstart/index.php?page=Controls.Samples.TWizard.Sample4&notheme=true&lang=en"); - $this->verifyTitle("PRADO QuickStart Sample", ""); + $this->assertEquals("PRADO QuickStart Sample", $this->title()); // step 1 - $this->verifyTextPresent('Step 1 of 3'); - $this->select('ctl0_body_Wizard1_DropDownList1', "label=Cyan"); - $this->clickAndWait('ctl0_body_Wizard1_SideBarList_ctl2_SideBarButton'); + $this->assertContains('Step 1 of 3', $this->source()); + $this->select('ctl0_body_Wizard1_DropDownList1', "Cyan"); + $this->byId('ctl0_body_Wizard1_SideBarList_ctl2_SideBarButton')->click(); // step 3 - $this->verifyTextPresent('Step 3 of 3'); - $this->verifyTextPresent('Thank you for completing this survey.'); - $this->clickAndWait('ctl0_body_Wizard1_SideBarList_ctl0_SideBarButton'); + $this->assertContains('Step 3 of 3', $this->source()); + $this->assertContains('Thank you for completing this survey.', $this->source()); + $this->byId('ctl0_body_Wizard1_SideBarList_ctl0_SideBarButton')->click(); // step 1 $this->assertSelected('ctl0_body_Wizard1_DropDownList1', "Cyan"); - $this->select('ctl0_body_Wizard1_DropDownList1', "label=Black"); - $this->clickAndWait('ctl0_body_Wizard1_ctl4_ctl0'); + $this->select('ctl0_body_Wizard1_DropDownList1', "Black"); + $this->byId('ctl0_body_Wizard1_ctl4_ctl0')->click(); // step 2 - $this->verifyTextPresent('Step 2 of 3'); - $this->verifyTextPresent('Your favorite color is: Black'); - $this->clickAndWait('ctl0_body_Wizard1_ctl5_ctl0'); + $this->assertContains('Step 2 of 3', $this->source()); + $this->assertContains('Your favorite color is: Black', $this->source()); + $this->byId('ctl0_body_Wizard1_ctl5_ctl0')->click(); // step 1 - $this->verifyTextPresent('Step 1 of 3'); + $this->assertContains('Step 1 of 3', $this->source()); $this->assertSelected('ctl0_body_Wizard1_DropDownList1', "Black"); - $this->clickAndWait('ctl0_body_Wizard1_ctl4_ctl0'); + $this->byId('ctl0_body_Wizard1_ctl4_ctl0')->click(); // step 2 - $this->clickAndWait('ctl0_body_Wizard1_ctl5_ctl1'); + $this->byId('ctl0_body_Wizard1_ctl5_ctl1')->click(); // step 3 - $this->verifyTextPresent('Step 3 of 3'); + $this->assertContains('Step 3 of 3', $this->source()); } } diff --git a/tests/FunctionalTests/quickstart/Controls/Wizard5TestCase.php b/tests/FunctionalTests/quickstart/Controls/Wizard5TestCase.php index eb5edb3b..4c41a074 100755 --- a/tests/FunctionalTests/quickstart/Controls/Wizard5TestCase.php +++ b/tests/FunctionalTests/quickstart/Controls/Wizard5TestCase.php @@ -1,35 +1,35 @@ <?php -class QuickstartWizard5TestCase extends PradoGenericSeleniumTest +class QuickstartWizard5TestCase extends PradoGenericSelenium2Test { function test () { - $this->open("../../demos/quickstart/index.php?page=Controls.Samples.TWizard.Sample5&notheme=true&lang=en", ""); + $this->url("../../demos/quickstart/index.php?page=Controls.Samples.TWizard.Sample5&notheme=true&lang=en"); - $this->verifyTitle("PRADO QuickStart Sample", ""); + $this->assertEquals("PRADO QuickStart Sample", $this->title()); // step 1 - $this->verifyTextPresent('Please let us know your preference'); - $this->verifyVisible('ctl0_body_Wizard1_SideBarList_ctl0_SideBarButton'); - $this->verifyVisible('ctl0_body_Wizard1_SideBarList_ctl1_SideBarButton'); - $this->verifyAttribute('ctl0_body_Wizard1_SideBarList_ctl2_SideBarButton@disabled','regexp:true|disabled'); - $this->select('ctl0_body_Wizard1_DropDownList1', "label=Cyan"); - $this->clickAndWait('ctl0$body$Wizard1$ctl4$ctl0'); + $this->assertContains('Please let us know your preference', $this->source()); + $this->assertVisible('ctl0_body_Wizard1_SideBarList_ctl0_SideBarButton'); + $this->assertVisible('ctl0_body_Wizard1_SideBarList_ctl1_SideBarButton'); + $this->assertAttribute('ctl0_body_Wizard1_SideBarList_ctl2_SideBarButton@disabled','regexp:true|disabled'); + $this->select('ctl0_body_Wizard1_DropDownList1', "Cyan"); + $this->byName('ctl0$body$Wizard1$ctl4$ctl0')->click(); // step 2 - $this->select('ctl0_body_Wizard1_Step2_DropDownList2','label=Football'); - $this->clickAndWait('ctl0$body$Wizard1$ctl6$ctl0'); + $this->select('ctl0_body_Wizard1_Step2_DropDownList2','Football'); + $this->byName('ctl0$body$Wizard1$ctl6$ctl0')->click(); // step 1 $this->assertSelected('ctl0_body_Wizard1_DropDownList1','Cyan'); - $this->clickAndWait('ctl0_body_Wizard1_SideBarList_ctl1_SideBarButton'); + $this->byId('ctl0_body_Wizard1_SideBarList_ctl1_SideBarButton')->click(); // step 2 $this->assertSelected('ctl0_body_Wizard1_Step2_DropDownList2','Football'); - $this->clickAndWait('ctl0$body$Wizard1$ctl6$ctl1'); + $this->byName('ctl0$body$Wizard1$ctl6$ctl1')->click(); // step 3 - $this->verifyTextPresent('Your favorite color is: Cyan'); - $this->verifyTextPresent('Your favorite sport is: Football'); + $this->assertContains('Your favorite color is: Cyan', $this->source()); + $this->assertContains('Your favorite sport is: Football', $this->source()); } } diff --git a/tests/FunctionalTests/quickstart/Fundamentals/HangmanTestCase.php b/tests/FunctionalTests/quickstart/Fundamentals/HangmanTestCase.php index 3d531b47..8f5557ca 100755 --- a/tests/FunctionalTests/quickstart/Fundamentals/HangmanTestCase.php +++ b/tests/FunctionalTests/quickstart/Fundamentals/HangmanTestCase.php @@ -1,32 +1,32 @@ <?php -class QuickstartHangmanTestCase extends PradoGenericSeleniumTest +class QuickstartHangmanTestCase extends PradoGenericSelenium2Test { function test () { - $this->open("../../demos/quickstart/index.php?page=Fundamentals.Samples.Hangman.Home&notheme=true&lang=en", ""); - $this->verifyTitle("Hangman Game", ""); - $this->verifyTextPresent("Medium game; you are allowed 5 misses.", ""); - $this->clickAndWait("//input[@type='submit' and @value='Play!']", ""); - $this->verifyTextPresent("You must choose a difficulty level", ""); - $this->clickAndWait("//input[@type='submit' and @value='Play!']", ""); - $this->click("//input[@name='ctl0\$body\$LevelSelection' and @value='3']", ""); - $this->clickAndWait("//input[@type='submit' and @value='Play!']", ""); - $this->verifyTextPresent("Please make a guess", ""); - $this->verifyTextPresent("maximum of 3", ""); - $this->clickAndWait("link=B", ""); - $this->clickAndWait("link=F", ""); - $this->clickAndWait("link=Give up?", ""); - $this->verifyTextPresent("You Lose", ""); - $this->clickAndWait("link=Start Again", ""); - $this->clickAndWait("//input[@type='submit' and @value='Play!']", ""); - $this->verifyTextPresent("Please make a guess", ""); - $this->verifyTextPresent("maximum of 3", ""); - $this->clickAndWait("link=Give up?", ""); - $this->verifyTextPresent("You Lose", ""); - $this->clickAndWait("link=Start Again", ""); - $this->click("//input[@name='ctl0\$body\$LevelSelection' and @value='5']", ""); - $this->clickAndWait("//input[@type='submit' and @value='Play!']", ""); - $this->verifyTextPresent("maximum of 5", ""); + $this->url("../../demos/quickstart/index.php?page=Fundamentals.Samples.Hangman.Home&notheme=true&lang=en"); + $this->assertEquals("Hangman Game", $this->title()); + $this->assertContains("Medium game; you are allowed 5 misses.", $this->source()); + $this->byXPath("//input[@type='submit' and @value='Play!']")->click(); + $this->assertContains("You must choose a difficulty level", $this->source()); + $this->byXPath("//input[@type='submit' and @value='Play!']")->click(); + $this->byXPath("//input[@name='ctl0\$body\$LevelSelection' and @value='3']")->click(); + $this->byXPath("//input[@type='submit' and @value='Play!']")->click(); + $this->assertContains("Please make a guess", $this->source()); + $this->assertContains("maximum of 3", $this->source()); + $this->byLinkText("B")->click(); + $this->byLinkText("F")->click(); + $this->byLinkText("Give up?")->click(); + $this->assertContains("You Lose", $this->source()); + $this->byLinkText("Start Again")->click(); + $this->byXPath("//input[@type='submit' and @value='Play!']")->click(); + $this->assertContains("Please make a guess", $this->source()); + $this->assertContains("maximum of 3", $this->source()); + $this->byLinkText("Give up?")->click(); + $this->assertContains("You Lose", $this->source()); + $this->byLinkText("Start Again")->click(); + $this->byXPath("//input[@name='ctl0\$body\$LevelSelection' and @value='5']")->click(); + $this->byXPath("//input[@type='submit' and @value='Play!']")->click(); + $this->assertContains("maximum of 5", $this->source()); } } diff --git a/tests/FunctionalTests/tickets/protected/controls/ToggleImageButton.php b/tests/FunctionalTests/tickets/protected/controls/ToggleImageButton.php index 9aecda84..0165edac 100755 --- a/tests/FunctionalTests/tickets/protected/controls/ToggleImageButton.php +++ b/tests/FunctionalTests/tickets/protected/controls/ToggleImageButton.php @@ -6,7 +6,6 @@ * @author Christophe BOULAIN (Christophe.Boulain@ceram.fr) * @copyright Copyright © 2007, CERAM Sophia Antipolis * @license url nameoflicense - * @version $Id: ToggleImageButton.php 2043 2007-06-30 15:07:50Z xue $ * */ diff --git a/tests/FunctionalTests/tickets/protected/pages/ExtendedToggleImageButton.php b/tests/FunctionalTests/tickets/protected/pages/ExtendedToggleImageButton.php index 934efcef..7bc53ba3 100755 --- a/tests/FunctionalTests/tickets/protected/pages/ExtendedToggleImageButton.php +++ b/tests/FunctionalTests/tickets/protected/pages/ExtendedToggleImageButton.php @@ -1,16 +1,15 @@ <?php /** * - * + * * @author Christophe BOULAIN (Christophe.Boulain@ceram.fr) * @copyright Copyright © 2007, CERAM Sophia Antipolis * @license url nameoflicense - * @version $Id: ExtendedToggleImageButton.php 2039 2007-06-28 08:41:57Z tof $ - * + * */ prado::using ('Application.controls.ToggleImageButton'); class ExtendedToggleImageButton extends ToggleImageButton { - + }
\ No newline at end of file diff --git a/tests/FunctionalTests/tickets/protected/pages/Layout.tpl b/tests/FunctionalTests/tickets/protected/pages/Layout.tpl index bf2f8fab..b245a50d 100755 --- a/tests/FunctionalTests/tickets/protected/pages/Layout.tpl +++ b/tests/FunctionalTests/tickets/protected/pages/Layout.tpl @@ -1,7 +1,7 @@ -<!DOCTYPE html PUBLIC
- "-//W3C//DTD XHTML 1.0 Strict//EN"
+<!DOCTYPE html PUBLIC
+ "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<com:THead Title="PRADO Functional Tests">
<meta http-equiv="Content-type" content="text/html; charset=UTF-8" />
@@ -30,7 +30,6 @@ <com:TContentPlaceHolder ID="Content" />
<hr style="margin-top: 2em" />
-<com:TJavascriptLogger />
</com:TForm>
<div class="w3c">
<a href="http://validator.w3.org/check?uri=referer">
@@ -38,7 +37,7 @@ </a>
<a href="?page=ViewSource&path=<%= str_replace('.','/', $this->Request->ServiceParameter) %>.page"
style="margin: 0 1em;"
- onclick="window.open(this.href); return false;"
+ onclick="window.open(this.href); return false;"
onkeypress="window.open(this.href); return false;">View Source</a>
</div>
</body>
diff --git a/tests/FunctionalTests/tickets/protected/pages/Ticket220.page b/tests/FunctionalTests/tickets/protected/pages/Ticket220.page index e4c8fa95..fec54092 100755 --- a/tests/FunctionalTests/tickets/protected/pages/Ticket220.page +++ b/tests/FunctionalTests/tickets/protected/pages/Ticket220.page @@ -1,30 +1,26 @@ <com:TContent ID="Content"> <h1>ClientScript Test</h1> - + <com:TClientScript ScriptUrl=<%~ test.js %>> if(typeof(ClientScriptInfo) == "undefined") ClientScriptInfo = []; ClientScriptInfo.push("ok 3?") </com:TClientScript> - + <com:TClientScript> if(typeof(ClientScriptInfo) == "undefined") ClientScriptInfo = []; ClientScriptInfo.push("ok 2!") </com:TClientScript> - + <com:TLabel ID="label1" Text="Label 1" /> <input type="button" id="button1" value="update" /> - + <com:TClientScript PradoScripts="prado"> - Event.observe("button1", "click", function() + $('#button1').click(function() { - element = $("<%= $this->label1->ClientID %>"); - if(element) - element.innerHTML = "Label 1: "+inspect(ClientScriptInfo); - else - alert("failed"); + $("#<%= $this->label1->ClientID %>").html('Label 1: ' + ClientScriptInfo.join('; ')); }); </com:TClientScript> - + </com:TContent>
\ No newline at end of file diff --git a/tests/FunctionalTests/tickets/protected/pages/Ticket278.page b/tests/FunctionalTests/tickets/protected/pages/Ticket278.page index e7341bcc..8afaff22 100755 --- a/tests/FunctionalTests/tickets/protected/pages/Ticket278.page +++ b/tests/FunctionalTests/tickets/protected/pages/Ticket278.page @@ -21,7 +21,7 @@ OnPreRender="validate2_onPostValidate"
ErrorMessage="Text 2 is required">
<prop:ClientSide.OnValidate>
- sender.enabled = $("<%= $this->check1->ClientID %>").checked;
+ sender.enabled = $("#<%= $this->check1->ClientID %>").get(0).checked;
</prop:ClientSide.OnValidate>
</com:TRequiredFieldValidator>
@@ -30,13 +30,11 @@ <com:TButton ID="button1" Text="Submit!" />
<com:TClientScript>
- Event.OnLoad(function()
- {
- Event.observe("<%= $this->check1->ClientID %>", "click", function(ev)
- {
- $("<%= $this->panel1->ClientID %>").toggle();
+ jQuery( document ).ready(function() {
+ jQuery("#<%= $this->check1->ClientID %>").click(function() {
+ $("#<%= $this->panel1->ClientID %>").toggle();
+ });
});
- });
</com:TClientScript>
</com:TContent>
\ No newline at end of file diff --git a/tests/FunctionalTests/tickets/protected/pages/Ticket290.page b/tests/FunctionalTests/tickets/protected/pages/Ticket290.page index e9d40b92..3d4bf647 100755 --- a/tests/FunctionalTests/tickets/protected/pages/Ticket290.page +++ b/tests/FunctionalTests/tickets/protected/pages/Ticket290.page @@ -1,18 +1,17 @@ <com:TContent ID="Content"> - <h3>Needs manual testing</h3> <com:TPanel ID="panel1" DefaultButton="button2" Style="border:1px solid #ccc; padding:2em"> <com:TTextBox ID="textbox1" /> - + <com:TCustomValidator ControlToValidate="textbox1" OnServerValidate="customValidate" ValidationGroup="group1" ErrorMessage="required" /> - - <com:TButton ID="button1" Text="Button 1" + + <com:TButton ID="button1" Text="Button 1" ValidationGroup="group1" OnClick="button_clicked" /> - <com:TButton ID="button2" Text="Button 2 (default)" + <com:TButton ID="button2" Text="Button 2 (default)" ValidationGroup="group1" OnClick="button_clicked" /> <com:TLabel ID="label1" Text="Label 1" /> diff --git a/tests/FunctionalTests/tickets/protected/pages/Ticket504.page b/tests/FunctionalTests/tickets/protected/pages/Ticket504.page index 767a9c3a..535997d1 100755 --- a/tests/FunctionalTests/tickets/protected/pages/Ticket504.page +++ b/tests/FunctionalTests/tickets/protected/pages/Ticket504.page @@ -9,48 +9,48 @@ <com:TCallbackOptions ID="LoadDataOptions">
<prop:ClientSide.OnSuccess>
- $('status').innerHTML = sender.ActiveControl.CallbackParameter + " updated";
+ $('#status').html(sender.options.CallbackParameter + " updated");
</prop:ClientSide.OnSuccess>
<prop:ClientSide.OnLoading>
- $('loading').show();
+ $('#loading').show();
</prop:ClientSide.OnLoading>
<prop:ClientSide.OnComplete>
- $('loading').hide();
+ $('#loading').hide();
</prop:ClientSide.OnComplete>
</com:TCallbackOptions>
-
-<com:TActiveLinkButton
+
+<com:TActiveLinkButton
Text="Tab A"
ID="linka"
OnCallback="changePanel"
ActiveControl.CallbackOptions="LoadDataOptions"
ActiveControl.CallbackParameter="panelA"
- />
+ />
<com:TActiveLinkButton
Text="Tab B"
ID="linkb"
OnCallback="changePanel"
ActiveControl.CallbackOptions="LoadDataOptions"
ActiveControl.CallbackParameter="panelB"
- />
+ />
<com:TActiveLinkButton
Text="Tab C"
ID="linkc"
OnCallback="changePanel"
ActiveControl.CallbackOptions="LoadDataOptions"
ActiveControl.CallbackParameter="panelC"
- />
+ />
<com:TActiveLinkButton
Text="Tab D"
ID="linkd"
OnCallback="changePanel"
ActiveControl.CallbackOptions="LoadDataOptions"
ActiveControl.CallbackParameter="panelD"
- />
+ />
<com:TActivePanel ID="panelA">
<h1>Panel A</h1>
diff --git a/tests/FunctionalTests/tickets/protected/pages/Ticket585.page b/tests/FunctionalTests/tickets/protected/pages/Ticket585.page index 9c02df4e..58cff91c 100755 --- a/tests/FunctionalTests/tickets/protected/pages/Ticket585.page +++ b/tests/FunctionalTests/tickets/protected/pages/Ticket585.page @@ -5,12 +5,12 @@ ID="validator1"
ControlToValidate="test"
OnServerValidate="ChkDate"
- ErrorMessage="*">
+ ErrorMessage="*">
<prop:ClientSide
- OnValidationError="$('error').innerHTML='Error'"
- OnValidationSuccess="$('error').innerHTML='Success'"
+ OnValidationError="$('#error').html('Error')"
+ OnValidationSuccess="$('#error').html('Success')"
ObserveChanges="false"
-
+
/>
</com:TActiveCustomValidator>
<span id="error"></span>
diff --git a/tests/FunctionalTests/tickets/protected/pages/Ticket586.page b/tests/FunctionalTests/tickets/protected/pages/Ticket586.page index 29751cab..31bc7237 100755 --- a/tests/FunctionalTests/tickets/protected/pages/Ticket586.page +++ b/tests/FunctionalTests/tickets/protected/pages/Ticket586.page @@ -1,5 +1,4 @@ <com:TContent ID="Content">
-<h3>Needs manual testing</h3>
<com:TPanel DefaultButton="button2" Style="border:1px solid #ccc; padding:2em;">
<com:TTextBox ID="text1" />
diff --git a/tests/FunctionalTests/tickets/protected/pages/Ticket653/Layout.tpl b/tests/FunctionalTests/tickets/protected/pages/Ticket653/Layout.tpl index bf2f8fab..b245a50d 100755 --- a/tests/FunctionalTests/tickets/protected/pages/Ticket653/Layout.tpl +++ b/tests/FunctionalTests/tickets/protected/pages/Ticket653/Layout.tpl @@ -1,7 +1,7 @@ -<!DOCTYPE html PUBLIC
- "-//W3C//DTD XHTML 1.0 Strict//EN"
+<!DOCTYPE html PUBLIC
+ "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<com:THead Title="PRADO Functional Tests">
<meta http-equiv="Content-type" content="text/html; charset=UTF-8" />
@@ -30,7 +30,6 @@ <com:TContentPlaceHolder ID="Content" />
<hr style="margin-top: 2em" />
-<com:TJavascriptLogger />
</com:TForm>
<div class="w3c">
<a href="http://validator.w3.org/check?uri=referer">
@@ -38,7 +37,7 @@ </a>
<a href="?page=ViewSource&path=<%= str_replace('.','/', $this->Request->ServiceParameter) %>.page"
style="margin: 0 1em;"
- onclick="window.open(this.href); return false;"
+ onclick="window.open(this.href); return false;"
onkeypress="window.open(this.href); return false;">View Source</a>
</div>
</body>
diff --git a/tests/FunctionalTests/tickets/protected/pages/Ticket659.php b/tests/FunctionalTests/tickets/protected/pages/Ticket659.php index cb266fd7..85b87d55 100755 --- a/tests/FunctionalTests/tickets/protected/pages/Ticket659.php +++ b/tests/FunctionalTests/tickets/protected/pages/Ticket659.php @@ -1,12 +1,11 @@ <?php /** * - * + * * @author Christophe BOULAIN (Christophe.Boulain@ceram.fr) * @copyright Copyright © 2007, CERAM Sophia Antipolis * @license url nameoflicense - * @version $Id: Ticket659.php 2039 2007-06-28 08:41:57Z tof $ - * + * */ prado::using ('Application.pages.ExtendedToggleImageButton'); diff --git a/tests/FunctionalTests/tickets/protected/pages/Ticket691.page b/tests/FunctionalTests/tickets/protected/pages/Ticket691.page index e5c4d8f7..ce55715d 100755 --- a/tests/FunctionalTests/tickets/protected/pages/Ticket691.page +++ b/tests/FunctionalTests/tickets/protected/pages/Ticket691.page @@ -3,7 +3,7 @@ <com:TCallbackOptions ID="RatingOption"> <prop:ClientSide.OnComplete> - $('<%=$this->Title->ClientID%>').innerHTML = 'Thanks'; + $('#<%=$this->Title->ClientID%>').html('Thanks'); </prop:ClientSide.OnComplete> </com:TCallbackOptions> <com:TActiveLabel ID="Title" Text="Cast your vote:" /> @@ -16,7 +16,7 @@ <com:TListItem Value="5" Text="Five stars" /> <com:TListItem Value="6" Text="Six stars" /> </com:TActiveRatingList> -<com:TActiveLabel ID="Result"/> +<com:TActiveLabel ID="Result"/> </com:TContent>
\ No newline at end of file diff --git a/tests/FunctionalTests/tickets/protected/pages/Ticket703/Ticket703.php b/tests/FunctionalTests/tickets/protected/pages/Ticket703/Ticket703.php index adf71837..f254cf6d 100755 --- a/tests/FunctionalTests/tickets/protected/pages/Ticket703/Ticket703.php +++ b/tests/FunctionalTests/tickets/protected/pages/Ticket703/Ticket703.php @@ -6,24 +6,24 @@ class Ticket703 extends TPage { parent::onLoad($param); if (!$this->isPostBack && !$this->isCallback) { - $this->refreshLog(); + $this->clearLog(null, null); } } - + public function refreshLog () { $this->logBox->Text=file_get_contents(prado::getPathOfNameSpace('Ticket703.Logs.LogFile', '.txt')); } - + public function clearLog ($sender, $param) { $file=prado::getPathOfNameSpace('Ticket703.Logs.LogFile', '.txt'); file_put_contents($file, ''); $this->refreshLog(); } - + public function addLog($sender,$param) { - prado::log($this->logMessage->getText(), TLogger::DEBUG, "Tickets"); + prado::log($this->logMessage->getText(), TLogger::DEBUG, "Tickets"); } }
\ No newline at end of file diff --git a/tests/FunctionalTests/tickets/protected/pages/Ticket719.page b/tests/FunctionalTests/tickets/protected/pages/Ticket719.page index b36d2d66..3f2bc17b 100755 --- a/tests/FunctionalTests/tickets/protected/pages/Ticket719.page +++ b/tests/FunctionalTests/tickets/protected/pages/Ticket719.page @@ -1,5 +1,4 @@ <com:TContent id="Content"> -<h3>Needs manual testing</h3> <style> .autocomplete { @@ -45,7 +44,7 @@ ul.different OnSuggest="suggestCountries" Separator=", " OnSuggestionSelected="suggestion_selected" ResultPanel.CssClass="autocomplete" CausesValidation="false" /> - + </p> <p> <com:TButton OnClick="validForm" Text="Validate Form" /><br/> diff --git a/tests/FunctionalTests/tickets/protected/pages/Ticket785.page b/tests/FunctionalTests/tickets/protected/pages/Ticket785.page index 1b402a17..cd5a8783 100755 --- a/tests/FunctionalTests/tickets/protected/pages/Ticket785.page +++ b/tests/FunctionalTests/tickets/protected/pages/Ticket785.page @@ -1,20 +1,20 @@ -<com:TContent ID="Content">
-<com:TDatePicker Id="datePicker" InputMode="DropDownList"> +<com:TContent ID="Content"> +<com:TDatePicker Id="datePicker" InputMode="DropDownList"> <prop:ClientSide.OnDateChanged> - $('selDate').innerHTML=parameter; - </prop:ClientSide.OnDateChanged> + $('#selDate').html(parameter); + </prop:ClientSide.OnDateChanged> </com:TDatePicker> <p> Client Side Selected date : <span id="selDate"></span> </p> -<com:TDatePicker Id="datePicker2" InputMode="TextBox" DateFormat="MM/dd/yyyy" Date="12/01/20007" > +<com:TDatePicker Id="datePicker2" InputMode="TextBox" DateFormat="MM/dd/yyyy" Date="12/01/20007" > <prop:ClientSide.OnDateChanged> - $('selDate2').innerHTML=parameter; - </prop:ClientSide.OnDateChanged> + $('#selDate2').html(parameter); + </prop:ClientSide.OnDateChanged> </com:TDatePicker> <p> Client Side Selected date : <span id="selDate2"></span> -</p>
+</p> </com:TContent>
\ No newline at end of file diff --git a/tests/FunctionalTests/tickets/protected/pages/Ticket897.php b/tests/FunctionalTests/tickets/protected/pages/Ticket897.php index 358572bc..ec39d1b7 100755 --- a/tests/FunctionalTests/tickets/protected/pages/Ticket897.php +++ b/tests/FunctionalTests/tickets/protected/pages/Ticket897.php @@ -1,8 +1,8 @@ <?php class Ticket897 extends TPage { - + public function onButtonClicked($sender, $param) { $this->Output->Text = date('Y-m-d', $this->Date->TimeStamp); } - + } diff --git a/tests/FunctionalTests/tickets/protected/pages/ToggleTest.page b/tests/FunctionalTests/tickets/protected/pages/ToggleTest.page index 0d633657..0d633657 100644..100755 --- a/tests/FunctionalTests/tickets/protected/pages/ToggleTest.page +++ b/tests/FunctionalTests/tickets/protected/pages/ToggleTest.page diff --git a/tests/FunctionalTests/tickets/protected/pages/ToggleTest.php b/tests/FunctionalTests/tickets/protected/pages/ToggleTest.php index 73a2cc57..98492ffb 100644..100755 --- a/tests/FunctionalTests/tickets/protected/pages/ToggleTest.php +++ b/tests/FunctionalTests/tickets/protected/pages/ToggleTest.php @@ -1,12 +1,11 @@ <?php /** * - * + * * @author Christophe BOULAIN (Christophe.Boulain@ceram.fr) * @copyright Copyright © 2007, CERAM Sophia Antipolis * @license url nameoflicense - * @version $Id: ToggleTest.php 2039 2007-06-28 08:41:57Z tof $ - * + * */ prado::using ('Application.controls.ToggleImageButton'); @@ -15,5 +14,4 @@ class ToggleTest extends TPage { public function clickToggleButton ($sender, $param) { $this->lbl->Text=$sender->State; } -} -?>
\ No newline at end of file +}
\ No newline at end of file diff --git a/tests/FunctionalTests/tickets/tests/Issue120TestCase.php b/tests/FunctionalTests/tickets/tests/Issue120TestCase.php index 20a4096b..0c6945ba 100755 --- a/tests/FunctionalTests/tickets/tests/Issue120TestCase.php +++ b/tests/FunctionalTests/tickets/tests/Issue120TestCase.php @@ -1,16 +1,16 @@ <?php -class Issue120TestCase extends PradoGenericSeleniumTest +class Issue120TestCase extends PradoGenericSelenium2Test { function test() { - $this->open('tickets/index.php?page=Issue120'); - $this->assertTextPresent('TActiveDropDownList PromptValue Test'); - + $this->url('tickets/index.php?page=Issue120'); + $this->assertContains('TActiveDropDownList PromptValue Test', $this->source()); + $this->assertSelectedIndex("ctl0_Content_ddl1", 0); $this->assertSelectedValue("ctl0_Content_ddl1", 'PromptValue'); - - $this->click("ctl0_Content_btn1"); + + $this->byId("ctl0_Content_btn1")->click(); $this->pause(800); $this->assertSelectedIndex("ctl0_Content_ddl1", 0); diff --git a/tests/FunctionalTests/tickets/tests/Issue216TestCase.php b/tests/FunctionalTests/tickets/tests/Issue216TestCase.php index 375f90a7..d71db0e1 100755 --- a/tests/FunctionalTests/tickets/tests/Issue216TestCase.php +++ b/tests/FunctionalTests/tickets/tests/Issue216TestCase.php @@ -1,25 +1,25 @@ <?php -class Issue216TestCase extends PradoGenericSeleniumTest +class Issue216TestCase extends PradoGenericSelenium2Test { function test() { - $this->open('tickets/index.php?page=Issue216'); - $this->assertTextPresent('TTabPanel doesn\'t preserve active tab on callback request'); - + $this->url('tickets/index.php?page=Issue216'); + $this->assertContains('TTabPanel doesn\'t preserve active tab on callback request', $this->source()); + $this->assertVisible('ctl0_Content_tab1'); - $this->click("ctl0_Content_btn1"); + $this->byId("ctl0_Content_btn1")->click(); $this->pause(800); $this->assertText("ctl0_Content_result", "Tab ActiveIndex is : 0"); - $this->click("ctl0_Content_tab2_0"); + $this->byId("ctl0_Content_tab2_0")->click(); $this->pause(800); $this->assertVisible('ctl0_Content_tab2'); - $this->click("ctl0_Content_btn1"); + $this->byId("ctl0_Content_btn1")->click(); $this->pause(800); $this->assertText("ctl0_Content_result", "Tab ActiveIndex is : 1"); } diff --git a/tests/FunctionalTests/tickets/tests/Ticket121TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket121TestCase.php index 905a31a4..547ffb38 100755 --- a/tests/FunctionalTests/tickets/tests/Ticket121TestCase.php +++ b/tests/FunctionalTests/tickets/tests/Ticket121TestCase.php @@ -1,17 +1,17 @@ <?php -class Ticket121TestCase extends PradoGenericSeleniumTest +class Ticket121TestCase extends PradoGenericSelenium2Test { function test() { - $this->open('tickets/index.php?page=Ticket121'); + $this->url('tickets/index.php?page=Ticket121'); $this->type("ctl0\$Content\$FooTextBox", ""); - $this->verifyNotVisible('ctl0_Content_ctl1'); - $this->click("//input[@type='image' and @id='ctl0_Content_ctl0']", ""); - $this->verifyVisible('ctl0_Content_ctl1'); + $this->assertNotVisible('ctl0_Content_ctl1'); + $this->byXPath("//input[@type='image' and @id='ctl0_Content_ctl0']")->click(); + $this->assertVisible('ctl0_Content_ctl1'); $this->type("ctl0\$Content\$FooTextBox", "content"); - $this->clickAndWait("//input[@type='image' and @id='ctl0_Content_ctl0']", ""); - $this->verifyNotVisible('ctl0_Content_ctl1'); - $this->verifyTextPresent("clicked at", ""); + $this->byXPath("//input[@type='image' and @id='ctl0_Content_ctl0']")->click(); + $this->assertNotVisible('ctl0_Content_ctl1'); + $this->assertContains("clicked at", $this->source()); } } diff --git a/tests/FunctionalTests/tickets/tests/Ticket163TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket163TestCase.php index 1727ac40..20d9c645 100755 --- a/tests/FunctionalTests/tickets/tests/Ticket163TestCase.php +++ b/tests/FunctionalTests/tickets/tests/Ticket163TestCase.php @@ -1,12 +1,12 @@ <?php -class Ticket163TestCase extends PradoGenericSeleniumTest +class Ticket163TestCase extends PradoGenericSelenium2Test { function test() { - $this->open('tickets/index.php?page=Ticket163'); - $this->assertTextPresent('kr 100,00'); - $this->assertTextPresent('kr 0,00'); - $this->assertTextPresent('-kr 100,00'); + $this->url('tickets/index.php?page=Ticket163'); + $this->assertContains('kr 100,00', $this->source()); + $this->assertContains('kr 0,00', $this->source()); + $this->assertContains('-kr 100,00', $this->source()); } } diff --git a/tests/FunctionalTests/tickets/tests/Ticket169TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket169TestCase.php index 9889ea50..47bb380b 100755 --- a/tests/FunctionalTests/tickets/tests/Ticket169TestCase.php +++ b/tests/FunctionalTests/tickets/tests/Ticket169TestCase.php @@ -1,12 +1,12 @@ <?php -class Ticket169TestCase extends PradoGenericSeleniumTest +class Ticket169TestCase extends PradoGenericSelenium2Test { function test() { - $this->open('tickets/index.php?page=Ticket169'); + $this->url('tickets/index.php?page=Ticket169'); $this->assertNotVisible('ctl0_Content_validator1'); - $this->click('ctl0_Content_ctl0'); + $this->byId('ctl0_Content_ctl0')->click(); $this->assertVisible('ctl0_Content_validator1'); } } diff --git a/tests/FunctionalTests/tickets/tests/Ticket191TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket191TestCase.php index 88de08cc..c0bccaa9 100755 --- a/tests/FunctionalTests/tickets/tests/Ticket191TestCase.php +++ b/tests/FunctionalTests/tickets/tests/Ticket191TestCase.php @@ -1,14 +1,14 @@ <?php -class Ticket191TestCase extends PradoGenericSeleniumTest +class Ticket191TestCase extends PradoGenericSelenium2Test { function test() { - $this->open('tickets/index.php?page=Ticket191'); + $this->url('tickets/index.php?page=Ticket191'); $this->type("ctl0\$Content\$TextBox2", "test"); - $this->clickAndWait("name=ctl0\$Content\$ctl0"); + $this->byName("ctl0\$Content\$ctl0")->click(); $this->type("ctl0\$Content\$TextBox", "test"); - $this->clickAndWait("name=ctl0\$Content\$ctl1"); - $this->verifyNotVisible('ctl0_Content_ctl2'); + $this->byName("ctl0\$Content\$ctl1")->click(); + $this->assertNotVisible('ctl0_Content_ctl2'); } } diff --git a/tests/FunctionalTests/tickets/tests/Ticket205TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket205TestCase.php index 86768354..35274e6f 100755 --- a/tests/FunctionalTests/tickets/tests/Ticket205TestCase.php +++ b/tests/FunctionalTests/tickets/tests/Ticket205TestCase.php @@ -1,21 +1,29 @@ <?php -class Ticket205TestCase extends PradoGenericSeleniumTest +class Ticket205TestCase extends PradoGenericSelenium2Test { function test() { $base = 'ctl0_Content_'; - $this->open("tickets/index.php?page=Ticket205"); - $this->assertTitle("Verifying Ticket 205"); - $this->assertNotVisible("{$base}validator1"); + $this->url("tickets/index.php?page=Ticket205"); + $this->assertEquals($this->title(), "Verifying Ticket 205"); + + $validator=$this->byId("{$base}validator1"); + $this->assertFalse($validator->displayed()); $this->type("{$base}textbox1", "test"); - $this->click("{$base}button1"); - $this->assertAlert("error"); - $this->assertVisible("{$base}validator1"); + $this->byId("{$base}button1")->click(); + + $this->assertEquals("error", $this->alertText()); + $this->acceptAlert(); + + $this->assertTrue($validator->displayed()); + + // type() calls clear() that triggers a focus change and thus a second alert + $this->typeSpecial("{$base}textbox1", "Prado"); - $this->type("{$base}textbox1", "Prado"); - $this->clickAndWait("{$base}button1"); - $this->assertNotVisible("{$base}validator1"); + $this->byId("{$base}button1")->click(); + $validator=$this->byId("{$base}validator1"); + $this->assertFalse($validator->displayed()); } } diff --git a/tests/FunctionalTests/tickets/tests/Ticket207TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket207TestCase.php index cd618a5d..cc993192 100755 --- a/tests/FunctionalTests/tickets/tests/Ticket207TestCase.php +++ b/tests/FunctionalTests/tickets/tests/Ticket207TestCase.php @@ -1,25 +1,28 @@ <?php -class Ticket207TestCase extends PradoGenericSeleniumTest +class Ticket207TestCase extends PradoGenericSelenium2Test { function test() { $base = 'ctl0_Content_'; - $this->open('tickets/index.php?page=Ticket207'); - $this->assertTitle("Verifying Ticket 207"); + $this->url('tickets/index.php?page=Ticket207'); + $this->assertEquals($this->title(), "Verifying Ticket 207"); $this->assertNotVisible("{$base}validator1"); $this->assertNotVisible("{$base}validator2"); - - $this->click("{$base}button1"); - $this->assertAlert('error on text1 fired'); + + $this->byId("{$base}button1")->click(); + + $this->assertEquals('error on text1 fired', $this->alertText()); + $this->acceptAlert(); + $this->assertVisible("{$base}validator1"); $this->assertVisible("{$base}validator2"); - + $this->type("{$base}text1", 'test'); $this->assertVisible("{$base}validator1"); $this->assertVisible("{$base}validator2"); - $this->click("{$base}button1"); + $this->byId("{$base}button1")->click(); $this->assertNotVisible("{$base}validator1"); $this->assertVisible("{$base}validator2"); @@ -27,8 +30,11 @@ class Ticket207TestCase extends PradoGenericSeleniumTest $this->assertNotVisible("{$base}validator1"); $this->assertVisible("{$base}validator2"); - $this->click("{$base}button1"); - $this->assertAlert('error on text1 fired'); + $this->byId("{$base}button1")->click(); + + $this->assertEquals('error on text1 fired', $this->alertText()); + $this->acceptAlert(); + $this->assertVisible("{$base}validator1"); $this->assertVisible("{$base}validator2"); } diff --git a/tests/FunctionalTests/tickets/tests/Ticket21TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket21TestCase.php index 5e48ff2d..b9a0f0c9 100755 --- a/tests/FunctionalTests/tickets/tests/Ticket21TestCase.php +++ b/tests/FunctionalTests/tickets/tests/Ticket21TestCase.php @@ -1,14 +1,14 @@ <?php -class Ticket21TestCase extends PradoGenericSeleniumTest +class Ticket21TestCase extends PradoGenericSelenium2Test { function test() { - $this->open('tickets/index.php?page=Ticket21'); - $this->assertTitle("Verifying Ticket 21"); - $this->clickAndWait("ctl0_Content_button1"); - $this->verifyTextPresent("Radio button clicks: 1", ""); - $this->click("ctl0_Content_button1"); - $this->verifyTextPresent("Radio button clicks: 1", ""); + $this->url('tickets/index.php?page=Ticket21'); + $this->assertEquals($this->title(), "Verifying Ticket 21"); + $this->byId("ctl0_Content_button1")->click(); + $this->assertContains("Radio button clicks: 1", $this->source()); + $this->byId("ctl0_Content_button1")->click(); + $this->assertContains("Radio button clicks: 1", $this->source()); } } diff --git a/tests/FunctionalTests/tickets/tests/Ticket220TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket220TestCase.php index da5e8c15..3b31b23d 100755 --- a/tests/FunctionalTests/tickets/tests/Ticket220TestCase.php +++ b/tests/FunctionalTests/tickets/tests/Ticket220TestCase.php @@ -1,16 +1,16 @@ <?php -class Ticket220TestCase extends PradoGenericSeleniumTest +class Ticket220TestCase extends PradoGenericSelenium2Test { function test() { $base="ctl0_Content_"; - $this->open('tickets/index.php?page=Ticket220'); - $this->assertTextPresent('ClientScript Test'); + $this->url('tickets/index.php?page=Ticket220'); + $this->assertContains('ClientScript Test', $this->source()); $this->assertText("{$base}label1", "Label 1"); - - $this->click("button1"); - $this->assertText("{$base}label1", 'exact:Label 1: ["ok", "ok 3?", "ok 2!"]'); + + $this->byId("button1")->click(); + $this->assertText("{$base}label1", 'Label 1: ok; ok 3?; ok 2!'); $this->assertAlertNotPresent(); } } diff --git a/tests/FunctionalTests/tickets/tests/Ticket225TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket225TestCase.php index 3680eea1..74ad6505 100755 --- a/tests/FunctionalTests/tickets/tests/Ticket225TestCase.php +++ b/tests/FunctionalTests/tickets/tests/Ticket225TestCase.php @@ -1,22 +1,22 @@ <?php -class Ticket225TestCase extends PradoGenericSeleniumTest +class Ticket225TestCase extends PradoGenericSelenium2Test { function test() { $base="ctl0_Content_"; - $this->open('tickets/index.php?page=Ticket225'); - $this->assertTextPresent('RadioButton Group Tests'); + $this->url('tickets/index.php?page=Ticket225'); + $this->assertContains('RadioButton Group Tests', $this->source()); $this->assertText("{$base}label1", "Label 1"); $this->assertNotVisible("{$base}validator1"); - $this->click("{$base}button4"); + $this->byId("{$base}button4")->click(); $this->assertVisible("{$base}validator1"); - $this->click("{$base}button2"); - $this->clickAndWait("{$base}button4"); + $this->byId("{$base}button2")->click(); + $this->byId("{$base}button4")->click(); - $this->assertText("{$base}label1", 'exact:ctl0$Content$button1 ctl0$Content$button2 ctl0$Content$button3'); + $this->assertText("{$base}label1", 'ctl0$Content$button1 ctl0$Content$button2 ctl0$Content$button3'); $this->assertNotVisible("{$base}validator1"); } } diff --git a/tests/FunctionalTests/tickets/tests/Ticket227TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket227TestCase.php index 1f1c0fb9..3defa014 100755 --- a/tests/FunctionalTests/tickets/tests/Ticket227TestCase.php +++ b/tests/FunctionalTests/tickets/tests/Ticket227TestCase.php @@ -1,10 +1,10 @@ <?php -class Ticket227TestCase extends PradoGenericSeleniumTest +class Ticket227TestCase extends PradoGenericSelenium2Test { function test() { - $this->open('tickets/index.php?page=Ticket227'); - $this->assertTitle('Verifying Ticket 227'); + $this->url('tickets/index.php?page=Ticket227'); + $this->assertEquals($this->title(), 'Verifying Ticket 227'); } } diff --git a/tests/FunctionalTests/tickets/tests/Ticket239TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket239TestCase.php index 57251d23..e5595a13 100755 --- a/tests/FunctionalTests/tickets/tests/Ticket239TestCase.php +++ b/tests/FunctionalTests/tickets/tests/Ticket239TestCase.php @@ -1,53 +1,53 @@ <?php -class Ticket239TestCase extends PradoGenericSeleniumTest +class Ticket239TestCase extends PradoGenericSelenium2Test { function test() { - $this->open('tickets/index.php?page=Ticket239'); + $this->url('tickets/index.php?page=Ticket239'); // view1 - $this->verifyTextPresent('view1 is activated',''); - $this->verifyTextNotPresent('view1 is deactivated',''); - $this->verifyTextNotPresent('view2 is activated',''); - $this->verifyTextNotPresent('view2 is deactivated',''); - $this->verifyTextNotPresent('view3 is activated',''); - $this->verifyTextNotPresent('view3 is deactivated',''); + $this->assertContains('view1 is activated', $this->source()); + $this->assertNotContains('view1 is deactivated', $this->source()); + $this->assertNotContains('view2 is activated', $this->source()); + $this->assertNotContains('view2 is deactivated', $this->source()); + $this->assertNotContains('view3 is activated', $this->source()); + $this->assertNotContains('view3 is deactivated', $this->source()); // goto view2 - $this->clickAndWait('name=ctl0$Content$ctl1'); - $this->verifyTextNotPresent('view1 is activated',''); - $this->verifyTextPresent('view1 is deactivated',''); - $this->verifyTextPresent('view2 is activated',''); - $this->verifyTextNotPresent('view2 is deactivated',''); - $this->verifyTextNotPresent('view3 is activated',''); - $this->verifyTextNotPresent('view3 is deactivated',''); + $this->byName('ctl0$Content$ctl1')->click(); + $this->assertNotContains('view1 is activated', $this->source()); + $this->assertContains('view1 is deactivated', $this->source()); + $this->assertContains('view2 is activated', $this->source()); + $this->assertNotContains('view2 is deactivated', $this->source()); + $this->assertNotContains('view3 is activated', $this->source()); + $this->assertNotContains('view3 is deactivated', $this->source()); // goto view3 - $this->clickAndWait('name=ctl0$Content$ctl3'); - $this->verifyTextNotPresent('view1 is activated',''); - $this->verifyTextNotPresent('view1 is deactivated',''); - $this->verifyTextNotPresent('view2 is activated',''); - $this->verifyTextPresent('view2 is deactivated',''); - $this->verifyTextPresent('view3 is activated',''); - $this->verifyTextNotPresent('view3 is deactivated',''); + $this->byName('ctl0$Content$ctl3')->click(); + $this->assertNotContains('view1 is activated', $this->source()); + $this->assertNotContains('view1 is deactivated', $this->source()); + $this->assertNotContains('view2 is activated', $this->source()); + $this->assertContains('view2 is deactivated', $this->source()); + $this->assertContains('view3 is activated', $this->source()); + $this->assertNotContains('view3 is deactivated', $this->source()); // goto view2 - $this->clickAndWait('name=ctl0$Content$ctl4'); - $this->verifyTextNotPresent('view1 is activated',''); - $this->verifyTextNotPresent('view1 is deactivated',''); - $this->verifyTextPresent('view2 is activated',''); - $this->verifyTextNotPresent('view2 is deactivated',''); - $this->verifyTextNotPresent('view3 is activated',''); - $this->verifyTextPresent('view3 is deactivated',''); + $this->byName('ctl0$Content$ctl4')->click(); + $this->assertNotContains('view1 is activated', $this->source()); + $this->assertNotContains('view1 is deactivated', $this->source()); + $this->assertContains('view2 is activated', $this->source()); + $this->assertNotContains('view2 is deactivated', $this->source()); + $this->assertNotContains('view3 is activated', $this->source()); + $this->assertContains('view3 is deactivated', $this->source()); // goto view1 - $this->clickAndWait('name=ctl0$Content$ctl2'); - $this->verifyTextPresent('view1 is activated',''); - $this->verifyTextNotPresent('view1 is deactivated',''); - $this->verifyTextNotPresent('view2 is activated',''); - $this->verifyTextPresent('view2 is deactivated',''); - $this->verifyTextNotPresent('view3 is activated',''); - $this->verifyTextNotPresent('view3 is deactivated',''); + $this->byName('ctl0$Content$ctl2')->click(); + $this->assertContains('view1 is activated', $this->source()); + $this->assertNotContains('view1 is deactivated', $this->source()); + $this->assertNotContains('view2 is activated', $this->source()); + $this->assertContains('view2 is deactivated', $this->source()); + $this->assertNotContains('view3 is activated', $this->source()); + $this->assertNotContains('view3 is deactivated', $this->source()); } } diff --git a/tests/FunctionalTests/tickets/tests/Ticket246TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket246TestCase.php index bedd6e2c..7c4fe364 100755 --- a/tests/FunctionalTests/tickets/tests/Ticket246TestCase.php +++ b/tests/FunctionalTests/tickets/tests/Ticket246TestCase.php @@ -1,10 +1,10 @@ <?php -class Ticket246TestCase extends PradoGenericSeleniumTest +class Ticket246TestCase extends PradoGenericSelenium2Test { function test() { - $this->open('tickets/index.php?page=Ticket246'); - $this->assertTitle('Verifying Ticket 246'); + $this->url('tickets/index.php?page=Ticket246'); + $this->assertEquals($this->title(), 'Verifying Ticket 246'); } } diff --git a/tests/FunctionalTests/tickets/tests/Ticket274TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket274TestCase.php index b2b17de7..ebb60ca9 100755 --- a/tests/FunctionalTests/tickets/tests/Ticket274TestCase.php +++ b/tests/FunctionalTests/tickets/tests/Ticket274TestCase.php @@ -1,21 +1,21 @@ <?php -class Ticket274TestCase extends PradoGenericSeleniumTest +class Ticket274TestCase extends PradoGenericSelenium2Test { function test() { $base = 'ctl0_Content_'; - $this->open('tickets/index.php?page=Ticket274'); - $this->assertTitle('Verifying Ticket 274'); + $this->url('tickets/index.php?page=Ticket274'); + $this->assertEquals($this->title(), 'Verifying Ticket 274'); $this->assertNotVisible($base.'validator1'); $this->assertNotVisible($base.'validator2'); - $this->clickAndWait($base.'button1'); + $this->byId($base.'button1')->click(); $this->assertVisible($base.'validator1'); $this->assertNotVisible($base.'validator2'); $this->type($base.'MyDate', 'asd'); - $this->clickAndWait($base.'button1'); + $this->byId($base.'button1')->click(); $this->assertNotVisible($base.'validator1'); $this->assertVisible($base.'validator2'); } diff --git a/tests/FunctionalTests/tickets/tests/Ticket278TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket278TestCase.php index 4bfffede..ca11f626 100755 --- a/tests/FunctionalTests/tickets/tests/Ticket278TestCase.php +++ b/tests/FunctionalTests/tickets/tests/Ticket278TestCase.php @@ -1,28 +1,28 @@ <?php -class Ticket278TestCase extends PradoGenericSeleniumTest +class Ticket278TestCase extends PradoGenericSelenium2Test { function test() { $base = 'ctl0_Content_'; - $this->open('tickets/index.php?page=Ticket278'); - $this->assertTitle('Verifying Ticket 278'); + $this->url('tickets/index.php?page=Ticket278'); + $this->assertEquals($this->title(), 'Verifying Ticket 278'); $this->assertNotVisible($base.'validator1'); $this->assertNotVisible($base.'validator2'); $this->assertNotVisible($base.'panel1'); - $this->click($base.'button1'); + $this->byId($base.'button1')->click(); $this->assertVisible($base.'validator1'); $this->assertNotVisible($base.'validator2'); $this->type($base.'text1', 'asd'); - $this->clickAndWait($base.'button1'); + $this->byId($base.'button1')->click(); $this->assertNotVisible($base.'validator1'); $this->assertNotVisible($base.'validator2'); $this->assertNotVisible($base.'panel1'); - $this->click($base.'check1'); - $this->click($base.'button1'); + $this->byId($base.'check1')->click(); + $this->byId($base.'button1')->click(); $this->assertNotVisible($base.'validator1'); $this->assertVisible($base.'validator2'); $this->assertVisible($base.'panel1'); @@ -30,21 +30,21 @@ class Ticket278TestCase extends PradoGenericSeleniumTest $this->type($base.'text1', ''); $this->type($base.'text2', 'asd'); - $this->click($base.'button1'); + $this->byId($base.'button1')->click(); $this->assertVisible($base.'validator1'); $this->assertNotVisible($base.'validator2'); $this->assertVisible($base.'panel1'); $this->type($base.'text1', 'asd'); - $this->clickAndWait($base.'button1'); + $this->byId($base.'button1')->click(); $this->assertNotVisible($base.'validator1'); $this->assertNotVisible($base.'validator2'); $this->assertVisible($base.'panel1'); $this->type($base.'text1', ''); $this->type($base.'text2', ''); - $this->click($base.'button1'); + $this->byId($base.'button1')->click(); $this->assertVisible($base.'validator1'); $this->assertVisible($base.'validator2'); $this->assertVisible($base.'panel1'); diff --git a/tests/FunctionalTests/tickets/tests/Ticket27TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket27TestCase.php index 7defd7ae..bc478895 100755 --- a/tests/FunctionalTests/tickets/tests/Ticket27TestCase.php +++ b/tests/FunctionalTests/tickets/tests/Ticket27TestCase.php @@ -1,16 +1,16 @@ <?php -class Ticket27TestCase extends PradoGenericSeleniumTest +class Ticket27TestCase extends PradoGenericSelenium2Test { function test() { - $this->open('tickets/index.php?page=Ticket27'); - $this->verifyTitle("Verifying Ticket 27", ""); - $this->click("//input[@value='Agree']", ""); - $this->assertVisible("ctl0_Content_validator1", ""); + $this->url('tickets/index.php?page=Ticket27'); + $this->assertEquals("Verifying Ticket 27", $this->title()); + $this->byXPath("//input[@value='Agree']")->click(); + $this->assertVisible("ctl0_Content_validator1"); $this->type("ctl0_Content_TextBox", "122"); - $this->assertNotVisible("ctl0_Content_validator1", ""); - $this->clickAndWait("//input[@value='Disagree']", ""); - $this->assertNotVisible("ctl0_Content_validator1", ""); + $this->assertNotVisible("ctl0_Content_validator1"); + $this->byXPath("//input[@value='Disagree']")->click(); + $this->assertNotVisible("ctl0_Content_validator1"); } } diff --git a/tests/FunctionalTests/tickets/tests/Ticket284TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket284TestCase.php index d28ea771..b4a32c19 100755 --- a/tests/FunctionalTests/tickets/tests/Ticket284TestCase.php +++ b/tests/FunctionalTests/tickets/tests/Ticket284TestCase.php @@ -1,12 +1,12 @@ <?php -class Ticket284TestCase extends PradoGenericSeleniumTest +class Ticket284TestCase extends PradoGenericSelenium2Test { function test() { - $this->open('tickets/index.php?page=Ticket284'); - $this->assertTextPresent('Verifying Ticket 284'); - $this->click('ctl0_Content_ctl1'); - + $this->url('tickets/index.php?page=Ticket284'); + $this->assertContains('Verifying Ticket 284', $this->source()); + $this->byId('ctl0_Content_ctl1')->click(); + } } diff --git a/tests/FunctionalTests/tickets/tests/Ticket285TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket285TestCase.php index 8b996964..04a451df 100755 --- a/tests/FunctionalTests/tickets/tests/Ticket285TestCase.php +++ b/tests/FunctionalTests/tickets/tests/Ticket285TestCase.php @@ -1,11 +1,11 @@ <?php -class Ticket285TestCase extends PradoGenericSeleniumTest +class Ticket285TestCase extends PradoGenericSelenium2Test { function test() { - $this->open('tickets/index.php?page=Ticket285'); - $this->assertTextPresent('350.00'); - $this->assertTextPresent('349.99'); + $this->url('tickets/index.php?page=Ticket285'); + $this->assertContains('350.00', $this->source()); + $this->assertContains('349.99', $this->source()); } }
\ No newline at end of file diff --git a/tests/FunctionalTests/tickets/tests/Ticket28TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket28TestCase.php index 1f64b3f9..92bf1eb9 100755 --- a/tests/FunctionalTests/tickets/tests/Ticket28TestCase.php +++ b/tests/FunctionalTests/tickets/tests/Ticket28TestCase.php @@ -1,13 +1,13 @@ <?php -class Ticket28TestCase extends PradoGenericSeleniumTest +class Ticket28TestCase extends PradoGenericSelenium2Test { - + function test() { - $this->open('tickets/index.php?page=Ticket28'); - $this->assertTextPresent('Label 1'); - $this->clickAndWait('link=Click Me'); - $this->assertTextPresent('Link Button 1 Clicked!'); + $this->url('tickets/index.php?page=Ticket28'); + $this->assertContains('Label 1', $this->source()); + $this->byLinkText("Click Me")->click(); + $this->assertContains('Link Button 1 Clicked!', $this->source()); } } diff --git a/tests/FunctionalTests/tickets/tests/Ticket290TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket290TestCase.php index f541d63d..8116e753 100755 --- a/tests/FunctionalTests/tickets/tests/Ticket290TestCase.php +++ b/tests/FunctionalTests/tickets/tests/Ticket290TestCase.php @@ -1,28 +1,27 @@ <?php /** -* +* */ -class Ticket290TestCase extends PradoGenericSeleniumTest +class Ticket290TestCase extends PradoGenericSelenium2Test { function test() { $base = 'ctl0_Content_'; - $this->open('tickets/index.php?page=Ticket290'); - $this->assertTitle("Verifying Ticket 290"); - + $this->url('tickets/index.php?page=Ticket290'); + $this->assertEquals($this->title(), "Verifying Ticket 290"); + $this->assertText("{$base}label1", "Label 1"); $this->assertText("{$base}label2", "Label 2"); $this->type("{$base}textbox1", "test"); - // bad hack to simulate enter key.. - $this->submit('ctl0_ctl1'); + + $this->byId("{$base}textbox1")->click(); + $this->keys(PHPUnit_Extensions_Selenium2TestCase_Keys::ENTER); $this->pause(800); - - $this->assertText("{$base}label1", "Doing Validation"); - // this can't work properly without manual testing - //$this->assertText("{$base}label2", "Button 2 (default) Clicked!"); + $this->assertText("{$base}label1", "Doing Validation"); + $this->assertText("{$base}label2", "Button 2 (default) Clicked!"); } } diff --git a/tests/FunctionalTests/tickets/tests/Ticket433TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket433TestCase.php index b8462988..aae4ee21 100755 --- a/tests/FunctionalTests/tickets/tests/Ticket433TestCase.php +++ b/tests/FunctionalTests/tickets/tests/Ticket433TestCase.php @@ -1,15 +1,15 @@ <?php -class Ticket433TestCase extends PradoGenericSeleniumTest +class Ticket433TestCase extends PradoGenericSelenium2Test { function test() { $base = 'ctl0_Content_'; - $this->open('tickets/index.php?page=Ticket433'); - $this->assertTitle("Verifying Ticket 433"); + $this->url('tickets/index.php?page=Ticket433'); + $this->assertEquals($this->title(), "Verifying Ticket 433"); $this->assertText("{$base}VoteClick", "BEFORE click"); - $this->click("{$base}VoteClick"); + $this->byId("{$base}VoteClick")->click(); $this->pause(800); $this->assertText("{$base}VoteClick", "AFTER click CALLBACK DONE"); } diff --git a/tests/FunctionalTests/tickets/tests/Ticket439TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket439TestCase.php index c393de91..f586a6c9 100755 --- a/tests/FunctionalTests/tickets/tests/Ticket439TestCase.php +++ b/tests/FunctionalTests/tickets/tests/Ticket439TestCase.php @@ -1,15 +1,14 @@ <?php -class Ticket439TestCase extends PradoGenericSeleniumTest +class Ticket439TestCase extends PradoGenericSelenium2Test { function test() { $base = 'ctl0_Content_'; - $this->open('tickets/index.php?page=Ticket439'); - $this->assertTitle("Verifying Ticket 439"); - $this->click("{$base}button1"); - $this->waitForPageToLoad(3000); + $this->url('tickets/index.php?page=Ticket439'); + $this->assertEquals($this->title(), "Verifying Ticket 439"); + $this->byId("{$base}button1")->click(); $this->pause(800); - $this->assertTitle("Verifying Home"); + $this->assertEquals($this->title(), "Verifying Home"); } }
\ No newline at end of file diff --git a/tests/FunctionalTests/tickets/tests/Ticket463TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket463TestCase.php index 34ffb8fd..14f00970 100755 --- a/tests/FunctionalTests/tickets/tests/Ticket463TestCase.php +++ b/tests/FunctionalTests/tickets/tests/Ticket463TestCase.php @@ -1,11 +1,11 @@ <?php -class Ticket463TestCase extends PradoGenericSeleniumTest +class Ticket463TestCase extends PradoGenericSelenium2Test { function test() { - $this->open('tickets/index.php?page=Ticket463'); - $this->verifyTitle("Verifying Ticket 463", ""); - $this->assertTextPresent('May 1, 2005 12:00:00 AM'); + $this->url('tickets/index.php?page=Ticket463'); + $this->assertEquals("Verifying Ticket 463", $this->title()); + $this->assertContains('May 1, 2005 12:00:00 AM', $this->source()); } } diff --git a/tests/FunctionalTests/tickets/tests/Ticket470TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket470TestCase.php index 4a2804ea..a3e25e85 100755 --- a/tests/FunctionalTests/tickets/tests/Ticket470TestCase.php +++ b/tests/FunctionalTests/tickets/tests/Ticket470TestCase.php @@ -1,31 +1,31 @@ <?php -class Ticket470TestCase extends PradoGenericSeleniumTest +class Ticket470TestCase extends PradoGenericSelenium2Test { function test() { $base = 'ctl0_Content_'; - $this->open('tickets/index.php?page=Ticket470'); - $this->verifyTitle("Verifying Ticket 470"); + $this->url('tickets/index.php?page=Ticket470'); + $this->assertEquals("Verifying Ticket 470", $this->title()); $this->assertText("{$base}counter", "0"); $this->assertText("{$base}Results", ""); $this->assertNotVisible("{$base}validator1"); - $this->click("{$base}button1"); + $this->byId("{$base}button1")->click(); $this->pause(800); $this->assertText("{$base}counter", "0"); $this->assertText("{$base}Results", ""); $this->assertVisible("{$base}validator1"); $this->type("{$base}TextBox", "hello"); - $this->click("{$base}button1"); + $this->byId("{$base}button1")->click(); $this->pause(800); $this->assertText("{$base}counter", "0"); $this->assertText("{$base}Results", "OK!!!"); $this->assertNotVisible("{$base}validator1"); //reload - $this->click("{$base}reloadButton"); + $this->byId("{$base}reloadButton")->click(); $this->pause(800); $this->assertValue("{$base}TextBox", "hello"); $this->assertText("{$base}counter", "1"); @@ -33,14 +33,14 @@ class Ticket470TestCase extends PradoGenericSeleniumTest $this->assertNotVisible("{$base}validator1"); $this->type("{$base}TextBox", ""); - $this->click("{$base}button1"); + $this->byId("{$base}button1")->click(); $this->pause(800); $this->assertText("{$base}counter", "1"); $this->assertText("{$base}Results", ""); $this->assertVisible("{$base}validator1"); - + $this->type("{$base}TextBox", "test"); - $this->click("{$base}button1"); + $this->byId("{$base}button1")->click(); $this->pause(800); $this->assertText("{$base}counter", "1"); $this->assertText("{$base}Results", "OK!!!"); diff --git a/tests/FunctionalTests/tickets/tests/Ticket477TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket477TestCase.php index 16ebc56e..7f9bc58c 100755 --- a/tests/FunctionalTests/tickets/tests/Ticket477TestCase.php +++ b/tests/FunctionalTests/tickets/tests/Ticket477TestCase.php @@ -1,21 +1,21 @@ <?php -class Ticket477TestCase extends PradoGenericSeleniumTest +class Ticket477TestCase extends PradoGenericSelenium2Test { function test() { $base = 'ctl0_Content_'; - $this->open('tickets/index.php?page=Ticket477'); - $this->assertTitle("Verifying Ticket 477"); + $this->url('tickets/index.php?page=Ticket477'); + $this->assertEquals($this->title(), "Verifying Ticket 477"); $this->assertNotVisible("{$base}validator1"); $this->assertNotVisible("{$base}validator2"); - $this->clickAndWait("{$base}list1_c1"); + $this->byId("{$base}list1_c1")->click(); $this->assertVisible("{$base}validator1"); $this->assertNotVisible("{$base}validator2"); - $this->clickAndWait("{$base}list2_c1"); + $this->byId("{$base}list2_c1")->click(); $this->assertNotVisible("{$base}validator1"); $this->assertVisible("{$base}validator2"); } diff --git a/tests/FunctionalTests/tickets/tests/Ticket488TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket488TestCase.php index c3b2f43f..e4b72aaf 100755 --- a/tests/FunctionalTests/tickets/tests/Ticket488TestCase.php +++ b/tests/FunctionalTests/tickets/tests/Ticket488TestCase.php @@ -1,40 +1,41 @@ <?php -class Ticket488TestCase extends PradoGenericSeleniumTest +class Ticket488TestCase extends PradoGenericSelenium2Test { function test() { - $this->open('active-controls/index.php?page=CustomValidatorByPass'); - $this->assertTextPresent('Custom Login'); + $base='ctl0_Content_'; + $this->url('active-controls/index.php?page=CustomValidatorByPass'); + $this->assertContains('Custom Login', $this->source()); $this->assertNotVisible('loginBox'); - $this->click("showLogin"); + $this->byId("showLogin")->click(); $this->assertVisible("loginBox"); - $this->assertNotVisible("validator1"); - $this->assertNotVisible("validator2"); + $this->assertNotVisible("{$base}validator1"); + $this->assertNotVisible("{$base}validator2"); - $this->click("checkLogin"); + $this->byId("{$base}checkLogin")->click(); $this->pause(800); - $this->assertVisible("validator1"); - $this->assertNotVisible("validator2"); + $this->assertVisible("{$base}validator1"); + $this->assertNotVisible("{$base}validator2"); - $this->type('Username', 'tea'); - $this->type('Password', 'mmama'); + $this->type("{$base}Username", 'tea'); + $this->type("{$base}Password", 'mmama'); - $this->click("checkLogin"); + $this->byId("{$base}checkLogin")->click(); $this->pause(800); - $this->assertNotVisible("validator1"); - $this->assertVisible("validator2"); + $this->assertNotVisible("{$base}validator1"); + $this->assertVisible("{$base}validator2"); - $this->type('Password', 'test'); - $this->click("checkLogin"); + $this->type("{$base}Password", 'test'); + $this->byId("{$base}checkLogin")->click(); $this->pause(800); - $this->assertNotVisible("validator1"); - $this->assertNotVisible("validator2"); + $this->assertNotVisible("{$base}validator1"); + $this->assertNotVisible("{$base}validator2"); } function test_more() { - $this->open('tickets/index.php?page=Ticket488'); + $this->url('tickets/index.php?page=Ticket488'); //add test assertions here. } } diff --git a/tests/FunctionalTests/tickets/tests/Ticket504TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket504TestCase.php index 63ecfe2f..f3bdd0a9 100755 --- a/tests/FunctionalTests/tickets/tests/Ticket504TestCase.php +++ b/tests/FunctionalTests/tickets/tests/Ticket504TestCase.php @@ -1,12 +1,12 @@ <?php -class Ticket504TestCase extends PradoGenericSeleniumTest +class Ticket504TestCase extends PradoGenericSelenium2Test { function test() { $base = 'ctl0_Content_'; - $this->open('tickets/index.php?page=Ticket504'); - $this->verifyTitle("Verifying Ticket 504", ""); + $this->url('tickets/index.php?page=Ticket504'); + $this->assertEquals("Verifying Ticket 504", $this->title()); $this->assertText("status", ""); @@ -15,7 +15,7 @@ class Ticket504TestCase extends PradoGenericSeleniumTest $this->assertVisible("{$base}panelC"); $this->assertVisible("{$base}panelD"); - $this->click("{$base}linka"); + $this->byId("{$base}linka")->click(); $this->pause(800); $this->assertVisible("{$base}panelA"); $this->assertNotVisible("{$base}panelB"); @@ -23,7 +23,7 @@ class Ticket504TestCase extends PradoGenericSeleniumTest $this->assertNotVisible("{$base}panelD"); $this->assertText("status", "panelA updated"); - $this->click("{$base}linkb"); + $this->byId("{$base}linkb")->click(); $this->pause(800); $this->assertNotVisible("{$base}panelA"); $this->assertVisible("{$base}panelB"); @@ -31,7 +31,7 @@ class Ticket504TestCase extends PradoGenericSeleniumTest $this->assertNotVisible("{$base}panelD"); $this->assertText("status", "panelB updated"); - $this->click("{$base}linkc"); + $this->byId("{$base}linkc")->click(); $this->pause(800); $this->assertNotVisible("{$base}panelA"); $this->assertNotVisible("{$base}panelB"); @@ -39,7 +39,7 @@ class Ticket504TestCase extends PradoGenericSeleniumTest $this->assertNotVisible("{$base}panelD"); $this->assertText("status", "panelC updated"); - $this->click("{$base}linkd"); + $this->byId("{$base}linkd")->click(); $this->pause(800); $this->assertNotVisible("{$base}panelA"); $this->assertNotVisible("{$base}panelB"); diff --git a/tests/FunctionalTests/tickets/tests/Ticket507TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket507TestCase.php index 19d54e9b..68c94b03 100755 --- a/tests/FunctionalTests/tickets/tests/Ticket507TestCase.php +++ b/tests/FunctionalTests/tickets/tests/Ticket507TestCase.php @@ -1,16 +1,16 @@ <?php -class Ticket507TestCase extends PradoGenericSeleniumTest +class Ticket507TestCase extends PradoGenericSelenium2Test { function test() { $base='ctl0_Content_'; - $this->open('tickets/index.php?page=Ticket507'); - $this->verifyTitle("Verifying Ticket 507", ""); + $this->url('tickets/index.php?page=Ticket507'); + $this->assertEquals("Verifying Ticket 507", $this->title()); $this->assertText("{$base}label1", "Label 1"); - $this->click("{$base}button1"); + $this->byId("{$base}button1")->click(); $this->pause(800); $this->select("{$base}list1", "item 1"); diff --git a/tests/FunctionalTests/tickets/tests/Ticket521TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket521TestCase.php index 2df88612..71457b58 100755 --- a/tests/FunctionalTests/tickets/tests/Ticket521TestCase.php +++ b/tests/FunctionalTests/tickets/tests/Ticket521TestCase.php @@ -1,15 +1,15 @@ <?php -class Ticket521TestCase extends PradoGenericSeleniumTest +class Ticket521TestCase extends PradoGenericSelenium2Test { function test() { $base = 'ctl0_Content_'; - $this->open("tickets/index.php?page=Ticket521"); - $this->assertTitle("Verifying Ticket 521"); + $this->url("tickets/index.php?page=Ticket521"); + $this->assertEquals($this->title(), "Verifying Ticket 521"); $this->assertText("{$base}label1", "Label 1"); - $this->click("{$base}button1"); + $this->byId("{$base}button1")->click(); $this->pause(1200); $this->assertText("{$base}label1", "Button 1 was clicked on callback"); diff --git a/tests/FunctionalTests/tickets/tests/Ticket526TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket526TestCase.php index 7476db69..c8659002 100755 --- a/tests/FunctionalTests/tickets/tests/Ticket526TestCase.php +++ b/tests/FunctionalTests/tickets/tests/Ticket526TestCase.php @@ -1,16 +1,16 @@ <?php -class Ticket526TestCase extends PradoGenericSeleniumTest +class Ticket526TestCase extends PradoGenericSelenium2Test { function test() { $base="ctl0_Content_"; - $this->open('tickets/index.php?page=Ticket526'); - $this->verifyTitle("Verifying Ticket 526", ""); + $this->url('tickets/index.php?page=Ticket526'); + $this->assertEquals("Verifying Ticket 526", $this->title()); $this->assertElementNotPresent("{$base}dpbutton"); - $this->click("{$base}btn"); + $this->byId("{$base}btn")->click(); $this->pause(800); $this->assertElementPresent("{$base}dpbutton"); } diff --git a/tests/FunctionalTests/tickets/tests/Ticket528TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket528TestCase.php index 3903000a..7fb24d04 100755 --- a/tests/FunctionalTests/tickets/tests/Ticket528TestCase.php +++ b/tests/FunctionalTests/tickets/tests/Ticket528TestCase.php @@ -1,12 +1,12 @@ <?php -class Ticket528TestCase extends PradoGenericSeleniumTest +class Ticket528TestCase extends PradoGenericSelenium2Test { function test() { $base = 'ctl0_Content_'; - $this->open('tickets/index.php?page=Ticket528'); - $this->assertTitle("Verifying Ticket 528"); + $this->url('tickets/index.php?page=Ticket528'); + $this->assertEquals($this->title(), "Verifying Ticket 528"); $this->select("{$base}DDropTurno", "Tarde"); $this->pause(800); diff --git a/tests/FunctionalTests/tickets/tests/Ticket535TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket535TestCase.php index 26f5a7d7..eebd2336 100755 --- a/tests/FunctionalTests/tickets/tests/Ticket535TestCase.php +++ b/tests/FunctionalTests/tickets/tests/Ticket535TestCase.php @@ -1,34 +1,34 @@ <?php -class Ticket535TestCase extends PradoGenericSeleniumTest +class Ticket535TestCase extends PradoGenericSelenium2Test { function test() { $base = 'ctl0_Content_'; - $this->open('tickets/index.php?page=Ticket535'); - $this->assertTitle("Verifying Ticket 535"); + $this->url('tickets/index.php?page=Ticket535'); + $this->assertEquals($this->title(), "Verifying Ticket 535"); $this->assertText("{$base}label1", "Label 1"); - $this->click("{$base}radio1"); - $this->click("{$base}button1"); + $this->byId("{$base}radio1")->click(); + $this->byId("{$base}button1")->click(); $this->pause(800); - $this->assertText("{$base}label1", 'exact:radio1 checked:{1} radio2 checked:{}'); + $this->assertText("{$base}label1", 'radio1 checked:{1} radio2 checked:{}'); - $this->click("{$base}radio2"); - $this->click("{$base}button1"); + $this->byId("{$base}radio2")->click(); + $this->byId("{$base}button1")->click(); $this->pause(800); - $this->assertText("{$base}label1", 'exact:radio1 checked:{1} radio2 checked:{1}'); + $this->assertText("{$base}label1", 'radio1 checked:{1} radio2 checked:{1}'); - $this->click("{$base}bad_radio1"); - $this->click("{$base}button2"); + $this->byId("{$base}bad_radio1")->click(); + $this->byId("{$base}button2")->click(); $this->pause(800); - $this->assertText("{$base}label1", 'exact:bad_radio1 checked:{1} bad_radio2 checked:{}'); + $this->assertText("{$base}label1", 'bad_radio1 checked:{1} bad_radio2 checked:{}'); - $this->click("{$base}bad_radio2"); - $this->click("{$base}button2"); + $this->byId("{$base}bad_radio2")->click(); + $this->byId("{$base}button2")->click(); $this->pause(800); - $this->assertText("{$base}label1", 'exact:bad_radio1 checked:{} bad_radio2 checked:{1}'); + $this->assertText("{$base}label1", 'bad_radio1 checked:{} bad_radio2 checked:{1}'); } } diff --git a/tests/FunctionalTests/tickets/tests/Ticket538TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket538TestCase.php index 16b0f863..2970837f 100755 --- a/tests/FunctionalTests/tickets/tests/Ticket538TestCase.php +++ b/tests/FunctionalTests/tickets/tests/Ticket538TestCase.php @@ -1,17 +1,17 @@ <?php -class Ticket538TestCase extends PradoGenericSeleniumTest +class Ticket538TestCase extends PradoGenericSelenium2Test { function test() { $base="ctl0_Content_"; - $this->open('tickets/index.php?page=Ticket538'); - $this->verifyTitle("Verifying Ticket 538", ""); + $this->url('tickets/index.php?page=Ticket538'); + $this->assertEquals("Verifying Ticket 538", $this->title()); $this->assertText("{$base}ALLog", 'waiting for response...'); $this->select("{$base}DataViewer", "empty :("); - $this->click("{$base}selectBtn"); + $this->byId("{$base}selectBtn")->click(); $this->pause(800); $this->assertText("{$base}ALLog", '0,'); @@ -21,7 +21,7 @@ class Ticket538TestCase extends PradoGenericSeleniumTest $this->select("{$base}DataViewer", "G1: Steven=>10"); $this->addSelection("{$base}DataViewer", "G2: Kevin=>65"); - $this->click("{$base}selectBtn"); + $this->byId("{$base}selectBtn")->click(); $this->pause(800); $this->assertText("{$base}ALLog", '4- "test1", 10- "test2",'); } diff --git a/tests/FunctionalTests/tickets/tests/Ticket54TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket54TestCase.php index f8e5a469..cf1433b6 100755 --- a/tests/FunctionalTests/tickets/tests/Ticket54TestCase.php +++ b/tests/FunctionalTests/tickets/tests/Ticket54TestCase.php @@ -1,10 +1,10 @@ <?php -class Ticket54TestCase extends PradoGenericSeleniumTest +class Ticket54TestCase extends PradoGenericSelenium2Test { function test() { - $this->open('tickets/index.php?page=Ticket54'); - $this->verifyTextPresent("|A|a|B|b|C|", ""); + $this->url('tickets/index.php?page=Ticket54'); + $this->assertContains("|A|a|B|b|C|", $this->source()); } } diff --git a/tests/FunctionalTests/tickets/tests/Ticket573TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket573TestCase.php index 996d72e9..cccdbaf3 100755 --- a/tests/FunctionalTests/tickets/tests/Ticket573TestCase.php +++ b/tests/FunctionalTests/tickets/tests/Ticket573TestCase.php @@ -1,11 +1,11 @@ <?php -class Ticket573TestCase extends PradoGenericSeleniumTest +class Ticket573TestCase extends PradoGenericSelenium2Test { function test() { - $this->open('tickets/index.php?page=Ticket573'); - $this->verifyTitle("Verifying Ticket 573", ""); + $this->url('tickets/index.php?page=Ticket573'); + $this->assertEquals("Verifying Ticket 573", $this->title()); $this->assertText('test1', '10.00'); } diff --git a/tests/FunctionalTests/tickets/tests/Ticket578TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket578TestCase.php index 47330326..948d8642 100755 --- a/tests/FunctionalTests/tickets/tests/Ticket578TestCase.php +++ b/tests/FunctionalTests/tickets/tests/Ticket578TestCase.php @@ -1,22 +1,27 @@ <?php -class Ticket578TestCase extends PradoGenericSeleniumTest +class Ticket578TestCase extends PradoGenericSelenium2Test { function test() { $base = 'ctl0_Content_'; - $this->open('tickets/index.php?page=Ticket578'); - $this->verifyTitle("Verifying Ticket 578", ""); + $this->url('tickets/index.php?page=Ticket578'); + $this->assertEquals("Verifying Ticket 578", $this->title()); $this->assertText("{$base}label1", "Label 1"); - $this->click("{$base}button1", ""); + $this->byId("{$base}button1")->click(); $this->pause(800); - $this->assertText("{$base}label1", "Button 1 was clicked : "); + $this->assertText("{$base}label1", "Button 1 was clicked :"); $text="helloworld"; - $this->runScript("tinyMCE.get('{$base}text1').setContent('{$text}')"); - $this->click("{$base}button1", ""); + + $this->execute(array( + 'script' => "tinyMCE.get('{$base}text1').setContent('{$text}')", + 'args' => array() + )); + + $this->byId("{$base}button1")->click(); $this->pause(800); - $this->assertText("{$base}label1", "exact:Button 1 was clicked : <p>{$text}</p>"); + $this->assertText("{$base}label1", "Button 1 was clicked : <p>{$text}</p>"); } } diff --git a/tests/FunctionalTests/tickets/tests/Ticket585TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket585TestCase.php index 8b2d36b3..58b42c33 100755 --- a/tests/FunctionalTests/tickets/tests/Ticket585TestCase.php +++ b/tests/FunctionalTests/tickets/tests/Ticket585TestCase.php @@ -1,23 +1,23 @@ <?php -class Ticket585TestCase extends PradoGenericSeleniumTest +class Ticket585TestCase extends PradoGenericSelenium2Test { function test() { $base = 'ctl0_Content_'; - $this->open('tickets/index.php?page=Ticket585'); - $this->verifyTitle("Verifying Ticket 585", ""); + $this->url('tickets/index.php?page=Ticket585'); + $this->assertEquals("Verifying Ticket 585", $this->title()); $this->assertText("error", ""); $this->assertNotVisible("{$base}validator1"); - $this->click("{$base}button1"); + $this->byId("{$base}button1")->click(); $this->pause(800); $this->assertText("error", "Success"); $this->assertNotVisible("{$base}validator1"); $this->type("{$base}test", "15-03-2007"); - $this->click("{$base}button1"); + $this->byId("{$base}button1")->click(); $this->pause(800); $this->assertText("error", "Error"); $this->assertVisible("{$base}validator1"); diff --git a/tests/FunctionalTests/tickets/tests/Ticket586TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket586TestCase.php index 612c086a..5fd47f86 100755 --- a/tests/FunctionalTests/tickets/tests/Ticket586TestCase.php +++ b/tests/FunctionalTests/tickets/tests/Ticket586TestCase.php @@ -1,15 +1,15 @@ <?php -class Ticket586TestCase extends PradoGenericSeleniumTest +class Ticket586TestCase extends PradoGenericSelenium2Test { function test() { $base = 'ctl0_Content_'; - $this->open('tickets/index.php?page=Ticket586'); - $this->verifyTitle("Verifying Ticket 586", ""); + $this->url('tickets/index.php?page=Ticket586'); + $this->assertEquals("Verifying Ticket 586", $this->title()); $this->assertText("{$base}label1", "Status"); - $this->clickAndWait("{$base}button1"); + $this->byId("{$base}button1")->click(); $this->assertText("{$base}label1", "Button 1 Clicked!"); $this->type("{$base}text1", "testing"); diff --git a/tests/FunctionalTests/tickets/tests/Ticket587TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket587TestCase.php index d5064c1e..cb42c343 100755 --- a/tests/FunctionalTests/tickets/tests/Ticket587TestCase.php +++ b/tests/FunctionalTests/tickets/tests/Ticket587TestCase.php @@ -1,12 +1,12 @@ <?php -class Ticket587TestCase extends PradoGenericSeleniumTest +class Ticket587TestCase extends PradoGenericSelenium2Test { function testKeyPress() { $base = 'ctl0_Content_'; - $this->open('tickets/index.php?page=Ticket587_reopened'); - $this->assertTitle("Verifying Ticket 587_reopened"); + $this->url('tickets/index.php?page=Ticket587_reopened'); + $this->assertEquals($this->title(), "Verifying Ticket 587_reopened"); $this->assertText($base."label1", "Label 1"); $this->select($base."list1", "item 3"); @@ -16,7 +16,6 @@ class Ticket587TestCase extends PradoGenericSeleniumTest $this->assertText($base."label1", "Selection 2: value 3 - item 4"); $this->type($base.'text1', 't'); - $this->runScript("Prado.Registry.get('{$base}text1').onKeyPress({})"); $this->pause(800); $this->select($base."list2", "asd 3 - item 2"); $this->pause(800); @@ -26,8 +25,8 @@ class Ticket587TestCase extends PradoGenericSeleniumTest function testButtonClick() { $base = 'ctl0_Content_'; - $this->open('tickets/index.php?page=Ticket587_reopened'); - $this->assertTitle("Verifying Ticket 587_reopened"); + $this->url('tickets/index.php?page=Ticket587_reopened'); + $this->assertEquals($this->title(), "Verifying Ticket 587_reopened"); $this->assertText($base."label1", "Label 1"); $this->select($base."list1", "item 3"); @@ -36,7 +35,7 @@ class Ticket587TestCase extends PradoGenericSeleniumTest $this->pause(800); $this->assertText($base."label1", "Selection 2: value 3 - item 4"); - $this->click($base.'button6'); + $this->byId($base.'button6')->click(); $this->pause(800); $this->select($base."list2", "asd 3 - item 2"); $this->pause(800); diff --git a/tests/FunctionalTests/tickets/tests/Ticket592TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket592TestCase.php index ec8d2284..692e2451 100755 --- a/tests/FunctionalTests/tickets/tests/Ticket592TestCase.php +++ b/tests/FunctionalTests/tickets/tests/Ticket592TestCase.php @@ -1,45 +1,45 @@ <?php -class Ticket592TestCase extends PradoGenericSeleniumTest +class Ticket592TestCase extends PradoGenericSelenium2Test { function test() { $base = 'ctl0_Content_'; - $this->open('tickets/index.php?page=Ticket592'); - $this->assertTitle("Verifying Ticket 592"); + $this->url('tickets/index.php?page=Ticket592'); + $this->assertEquals($this->title(), "Verifying Ticket 592"); $this->assertText("{$base}label1", "Label 1"); - $this->click("{$base}radio1"); - $this->click("{$base}button1"); + $this->byId("{$base}radio1")->click(); + $this->byId("{$base}button1")->click(); $this->pause(800); - $this->assertText("{$base}label1", 'exact:radio1 checked:{1} radio2 checked:{}'); + $this->assertText("{$base}label1", 'radio1 checked:{1} radio2 checked:{}'); - $this->click("{$base}radio2"); - $this->click("{$base}button1"); + $this->byId("{$base}radio2")->click(); + $this->byId("{$base}button1")->click(); $this->pause(800); - $this->assertText("{$base}label1", 'exact:radio1 checked:{1} radio2 checked:{1}'); + $this->assertText("{$base}label1", 'radio1 checked:{1} radio2 checked:{1}'); - $this->click("{$base}bad_radio1"); - $this->click("{$base}button2"); + $this->byId("{$base}bad_radio1")->click(); + $this->byId("{$base}button2")->click(); $this->pause(800); - $this->assertText("{$base}label1", 'exact:bad_radio1 checked:{1} bad_radio2 checked:{}'); + $this->assertText("{$base}label1", 'bad_radio1 checked:{1} bad_radio2 checked:{}'); - $this->click("{$base}bad_radio2"); - $this->click("{$base}button2"); + $this->byId("{$base}bad_radio2")->click(); + $this->byId("{$base}button2")->click(); $this->pause(800); - $this->assertText("{$base}label1", 'exact:bad_radio1 checked:{} bad_radio2 checked:{1}'); - - $this->click("{$base}bad_radio3"); - $this->click("{$base}button3"); + $this->assertText("{$base}label1", 'bad_radio1 checked:{} bad_radio2 checked:{1}'); + + $this->byId("{$base}bad_radio3")->click(); + $this->byId("{$base}button3")->click(); $this->pause(800); - $this->assertText("{$base}label1", 'exact:bad_radio3 checked:{1} bad_radio4 checked:{}'); + $this->assertText("{$base}label1", 'bad_radio3 checked:{1} bad_radio4 checked:{}'); - $this->click("{$base}bad_radio4"); - $this->click("{$base}button3"); + $this->byId("{$base}bad_radio4")->click(); + $this->byId("{$base}button3")->click(); $this->pause(800); - $this->assertText("{$base}label1", 'exact:bad_radio3 checked:{} bad_radio4 checked:{1}'); - + $this->assertText("{$base}label1", 'bad_radio3 checked:{} bad_radio4 checked:{1}'); + } } diff --git a/tests/FunctionalTests/tickets/tests/Ticket595TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket595TestCase.php index 14b2f985..27d57a91 100755 --- a/tests/FunctionalTests/tickets/tests/Ticket595TestCase.php +++ b/tests/FunctionalTests/tickets/tests/Ticket595TestCase.php @@ -1,36 +1,36 @@ <?php -class Ticket595TestCase extends PradoGenericSeleniumTest +class Ticket595TestCase extends PradoGenericSelenium2Test { function test() { $base="ctl0_Content_"; - $this->open('tickets/index.php?page=Ticket595'); - $this->assertTitle("Verifying Ticket 595"); - - $this->click($base.'ctl2'); + $this->url('tickets/index.php?page=Ticket595'); + $this->assertEquals($this->title(), "Verifying Ticket 595"); + + $this->byId($base.'ctl2')->click(); $this->assertAttribute($base.'A@class','errorclassA'); - + $this->type($base.'A', 'Prado'); - $this->click($base.'ctl2'); + $this->byId($base.'ctl2')->click(); $this->assertAttribute($base.'A@class','errorclassA'); - + $this->type($base.'A', 'test@pradosoft.com'); - $this->click($base.'ctl2'); + $this->byId($base.'ctl2')->click(); $this->pause(800); $this->assertAttribute($base.'A@class',''); - $this->click($base.'ctl5'); + $this->byId($base.'ctl5')->click(); $this->pause(800); - $this->assertAttribute($base.'B@class','exact: errorclassB'); - + $this->assertAttribute($base.'B@class',' errorclassB'); + $this->type($base.'B', 'Prado'); - $this->click($base.'ctl5'); + $this->byId($base.'ctl5')->click(); $this->pause(800); - $this->assertAttribute($base.'B@class','exact: errorclassB'); - + $this->assertAttribute($base.'B@class',' errorclassB'); + $this->type($base.'B', 'test@pradosoft.com'); - $this->click($base.'ctl5'); + $this->byId($base.'ctl5')->click(); $this->pause(800); $this->assertAttribute($base.'B@class',''); } diff --git a/tests/FunctionalTests/tickets/tests/Ticket622TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket622TestCase.php index 0d0fe3d2..b51f55d3 100755 --- a/tests/FunctionalTests/tickets/tests/Ticket622TestCase.php +++ b/tests/FunctionalTests/tickets/tests/Ticket622TestCase.php @@ -1,17 +1,18 @@ <?php -class Ticket622TestCase extends PradoGenericSeleniumTest +class Ticket622TestCase extends PradoGenericSelenium2Test { function test() { $base="ctl0_Content_"; - $this->open('tickets/index.php?page=Ticket622'); - $this->assertTitle("Verifying Ticket 622"); - - $this->click($base.'ctl0'); + $this->url('tickets/index.php?page=Ticket622'); + $this->assertEquals($this->title(), "Verifying Ticket 622"); + + $this->byId($base.'ctl0')->click(); $this->pause(800); - $this->assertAttribute($base.'ALB@style',';'); - $this->assertAttribute('css=span#acb span@style', ';'); - $this->assertAttribute('css=span#arb span@style', ';'); + + $this->assertEquals('', $this->byId($base.'ALB')->attribute('style')); + $this->assertEquals('', $this->byCssSelector('span#acb span')->attribute('style')); + $this->assertEquals('', $this->byCssSelector('span#arb span')->attribute('style')); } } diff --git a/tests/FunctionalTests/tickets/tests/Ticket653TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket653TestCase.php index ec5eceb4..09987387 100755 --- a/tests/FunctionalTests/tickets/tests/Ticket653TestCase.php +++ b/tests/FunctionalTests/tickets/tests/Ticket653TestCase.php @@ -1,12 +1,12 @@ <?php -class Ticket653TestCase extends PradoGenericSeleniumTest +class Ticket653TestCase extends PradoGenericSelenium2Test { function test() { // Open with 'Friendly URL' - $this->open('tickets/index.php/ticket653'); - $this->verifyTitle("Verifying Ticket 653", ""); + $this->url('tickets/index.php/ticket653'); + $this->assertEquals("Verifying Ticket 653", $this->title()); $this->assertText('textspan', 'This is the page for Ticket653'); } diff --git a/tests/FunctionalTests/tickets/tests/Ticket656TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket656TestCase.php index ff167b0e..174b096b 100755 --- a/tests/FunctionalTests/tickets/tests/Ticket656TestCase.php +++ b/tests/FunctionalTests/tickets/tests/Ticket656TestCase.php @@ -1,24 +1,25 @@ <?php -class Ticket656TestCase extends PradoGenericSeleniumTest +class Ticket656TestCase extends PradoGenericSelenium2Test { function test() { $base = 'ctl0_Content_'; - $this->open('tickets/index.php?page=Ticket656'); - $this->assertTitle("Verifying Ticket 656"); - + $this->url('tickets/index.php?page=Ticket656'); + $this->assertEquals($this->title(), "Verifying Ticket 656"); + // First test, current date - $this->click($base."btnUpdate"); + $this->byId($base."btnUpdate")->click(); $this->pause(800); $this->assertText($base."lblStatus",date("d-m-Y")); - + // Then, set another date + $year=date('Y')-2; $this->select($base."datePicker_day",20); $this->select($base."datePicker_month", 10); - $this->select($base."datePicker_year", 2008); - $this->click($base."btnUpdate"); + $this->select($base."datePicker_year", $year); + $this->byId($base."btnUpdate")->click(); $this->pause(800); - $this->assertText($base."lblStatus",date("d-m-Y", mktime(0,0,0,10,20,2008))); + $this->assertText($base."lblStatus",date("d-m-Y", mktime(0,0,0,10,20,$year))); } }
\ No newline at end of file diff --git a/tests/FunctionalTests/tickets/tests/Ticket659TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket659TestCase.php index 91326e9d..d5d73bc8 100755 --- a/tests/FunctionalTests/tickets/tests/Ticket659TestCase.php +++ b/tests/FunctionalTests/tickets/tests/Ticket659TestCase.php @@ -1,20 +1,20 @@ <?php -class Ticket659TestCase extends PradoGenericSeleniumTest +class Ticket659TestCase extends PradoGenericSelenium2Test { function test() { $base = 'ctl0_Content_'; // Normal component (working) - $this->open('tickets/index.php?page=ToggleTest'); + $this->url('tickets/index.php?page=ToggleTest'); $this->assertText("${base}lbl", "Down"); - $this->click("${base}btn", ""); + $this->byId("${base}btn")->click(); $this->pause(800); $this->assertText("${base}lbl", "Up"); // Extended component (not working) - $this->open('tickets/index.php?page=Ticket659'); + $this->url('tickets/index.php?page=Ticket659'); $this->assertText("${base}lbl", "Down"); - $this->click("${base}btn", ""); + $this->byId("${base}btn")->click(); $this->pause(800); $this->assertText("${base}lbl", "Up"); } diff --git a/tests/FunctionalTests/tickets/tests/Ticket660TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket660TestCase.php index e0c97e53..86f03442 100755 --- a/tests/FunctionalTests/tickets/tests/Ticket660TestCase.php +++ b/tests/FunctionalTests/tickets/tests/Ticket660TestCase.php @@ -1,24 +1,24 @@ <?php -class Ticket660TestCase extends PradoGenericSeleniumTest +class Ticket660TestCase extends PradoGenericSelenium2Test { function test() { $base = 'ctl0_Content_'; - $this->open('tickets/index.php?page=Ticket660'); - $this->assertTitle("Verifying Ticket 660"); - - $this->click($base.'PB'); + $this->url('tickets/index.php?page=Ticket660'); + $this->assertEquals($this->title(), "Verifying Ticket 660"); + + $this->byId($base.'PB')->click(); $this->pause(800); $this->assertText($base.'A','ÄÖÜ äöü'); $this->type($base.'T', 'äää'); - $this->click($base.'PB'); + $this->byId($base.'PB')->click(); $this->pause(800); $this->assertText($base.'A','äääÄÖÜ äöü'); /* // CALLBACK CURRENTLY CAN'T WORK ON NON-UTF8 strings $this->type($base.'T', 'ööö'); - $this->click($base.'CB'); + $this->byId($base.'CB')->click(); $this->pause(800); $this->assertText($base.'A','öööÄÖÜ äöü'); */ diff --git a/tests/FunctionalTests/tickets/tests/Ticket669TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket669TestCase.php index b6931808..8b5a0166 100755 --- a/tests/FunctionalTests/tickets/tests/Ticket669TestCase.php +++ b/tests/FunctionalTests/tickets/tests/Ticket669TestCase.php @@ -1,47 +1,47 @@ <?php -class Ticket669TestCase extends PradoGenericSeleniumTest +class Ticket669TestCase extends PradoGenericSelenium2Test { function test() { $base = 'ctl0_Content_'; - $this->open('tickets/index.php?page=Ticket669'); - $this->assertTitle("Verifying Ticket 669"); - - $this->assertTextPresent('1 - Test without callback'); - $this->assertValue($base.'tb1', 'exact:ActiveTextBox'); - $this->assertValue($base.'tb2', 'exact:TextBox in ActivePanel'); - - $this->click($base.'ctl4'); + $this->url('tickets/index.php?page=Ticket669'); + $this->assertEquals($this->title(), "Verifying Ticket 669"); + + $this->assertContains('1 - Test without callback', $this->source()); + $this->assertValue($base.'tb1', 'ActiveTextBox'); + $this->assertValue($base.'tb2', 'TextBox in ActivePanel'); + + $this->byId($base.'ctl4')->click(); $this->pause(800); - $this->assertValue($base.'tb1', 'exact:ActiveTextBox +1'); - $this->assertValue($base.'tb2', 'exact:TextBox in ActivePanel +1'); - - $this->click($base.'ctl1'); + $this->assertValue($base.'tb1', 'ActiveTextBox +1'); + $this->assertValue($base.'tb2', 'TextBox in ActivePanel +1'); + + $this->byId($base.'ctl1')->click(); $this->pause(800); - $this->assertTextPresent('2 - Test callback with 2nd ActivePanel'); - $this->assertValue($base.'tb3', 'exact:ActiveTextBox'); - $this->assertValue($base.'tb4', 'exact:TextBox in ActivePanel'); - $this->assertValue($base.'tb5', 'exact:TextBox in ActivePanel'); - - $this->click($base.'ctl6'); + $this->assertContains('2 - Test callback with 2nd ActivePanel', $this->source()); + $this->assertValue($base.'tb3', 'ActiveTextBox'); + $this->assertValue($base.'tb4', 'TextBox in ActivePanel'); + $this->assertValue($base.'tb5', 'TextBox in ActivePanel'); + + $this->byId($base.'ctl6')->click(); $this->pause(800); - - $this->assertValue($base.'tb3', 'exact:ActiveTextBox +1'); - $this->assertValue($base.'tb4', 'exact:TextBox in ActivePanel +1'); - $this->assertValue($base.'tb5', 'exact:TextBox in ActivePanel +1'); - - $this->click($base.'ctl2'); + + $this->assertValue($base.'tb3', 'ActiveTextBox +1'); + $this->assertValue($base.'tb4', 'TextBox in ActivePanel +1'); + $this->assertValue($base.'tb5', 'TextBox in ActivePanel +1'); + + $this->byId($base.'ctl2')->click(); $this->pause(800); - $this->assertTextPresent('3 - Test callback without 2nd ActivePanel'); - $this->assertValue($base.'tb6', 'exact:ActiveTextBox'); - $this->assertValue($base.'tb7', 'exact:TextBox in Panel'); - - $this->click($base.'ctl8'); + $this->assertContains('3 - Test callback without 2nd ActivePanel', $this->source()); + $this->assertValue($base.'tb6', 'ActiveTextBox'); + $this->assertValue($base.'tb7', 'TextBox in Panel'); + + $this->byId($base.'ctl8')->click(); $this->pause(800); - - $this->assertValue($base.'tb6', 'exact:ActiveTextBox +1'); - $this->assertValue($base.'tb7', 'exact:TextBox in Panel +1'); - + + $this->assertValue($base.'tb6', 'ActiveTextBox +1'); + $this->assertValue($base.'tb7', 'TextBox in Panel +1'); + } }
\ No newline at end of file diff --git a/tests/FunctionalTests/tickets/tests/Ticket670TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket670TestCase.php index 33e45b49..a88b689c 100755 --- a/tests/FunctionalTests/tickets/tests/Ticket670TestCase.php +++ b/tests/FunctionalTests/tickets/tests/Ticket670TestCase.php @@ -1,21 +1,21 @@ <?php -class Ticket670TestCase extends PradoGenericSeleniumTest +class Ticket670TestCase extends PradoGenericSelenium2Test { function test() { $base = 'ctl0_Content_'; - $this->open('tickets/index.php?page=Ticket670'); - $this->assertTitle("Verifying Ticket 670"); - + $this->url('tickets/index.php?page=Ticket670'); + $this->assertEquals($this->title(), "Verifying Ticket 670"); + $this->type($base."datePicker", '07-07-2003'); $this->pause(800); //$this->assertText($base."datePicker",'07-07-2003'); - $this->click($base."datePickerbutton"); + $this->byId($base."datePickerbutton")->click(); $this->pause(800); - $this->click($base."ok"); + $this->byId($base."ok")->click(); $this->pause(800); $this->assertText($base."lbl",'07-07-2007'); - + } }
\ No newline at end of file diff --git a/tests/FunctionalTests/tickets/tests/Ticket671TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket671TestCase.php index 031dc991..4e6409af 100755 --- a/tests/FunctionalTests/tickets/tests/Ticket671TestCase.php +++ b/tests/FunctionalTests/tickets/tests/Ticket671TestCase.php @@ -1,41 +1,41 @@ <?php -class Ticket671TestCase extends PradoGenericSeleniumTest +class Ticket671TestCase extends PradoGenericSelenium2Test { function test() { $base = 'ctl0_Content_'; - $this->open('tickets/index.php?page=Ticket671'); - $this->assertTitle("Verifying Ticket 671"); - - $this->verifyNotVisible($base.'ctl0'); + $this->url('tickets/index.php?page=Ticket671'); + $this->assertEquals($this->title(), "Verifying Ticket 671"); + + $this->assertNotVisible($base.'ctl0'); // Click submit - $this->click($base.'ctl1'); + $this->byId($base.'ctl1')->click(); $this->pause(800); - $this->verifyText($base.'ctl0', 'Please Select Test 3'); - $this->verifyVisible($base.'ctl0'); + $this->assertText($base.'ctl0', 'Please Select Test 3'); + $this->assertVisible($base.'ctl0'); $this->select($base.'addl', 'Test 2'); $this->pause(800); - $this->verifyVisible($base.'ctl0'); - $this->verifyText($base."lblResult", "You have selected 'Test 2'. But this is not valid !"); + $this->assertVisible($base.'ctl0'); + $this->assertText($base."lblResult", "You have selected 'Test 2'. But this is not valid !"); $this->select($base.'addl', 'Test 3'); $this->pause(800); - $this->verifyNotVisible($base.'ctl0'); - $this->verifyText($base."lblResult", "You have selected 'Test 3'."); - $this->click($base.'ctl1'); + $this->assertNotVisible($base.'ctl0'); + $this->assertText($base."lblResult", "You have selected 'Test 3'."); + $this->byId($base.'ctl1')->click(); $this->pause(800); - $this->verifyText($base."lblResult", "You have successfully validated the form"); - + $this->assertText($base."lblResult", "You have successfully validated the form"); + $this->type($base.'testTextBox', 'test'); $this->pause(800); - $this->click($base.'ctl3'); + $this->byId($base.'ctl3')->click(); $this->pause(800); - $this->verifyVisible($base.'ctl2'); + $this->assertVisible($base.'ctl2'); $this->type($base.'testTextBox',"Prado"); $this->pause(800); - $this->click($base.'ctl3'); + $this->byId($base.'ctl3')->click(); $this->pause(800); - $this->verifyNotVisible($base.'ctl2'); - $this->verifyText($base.'lblResult2', 'Thanks !'); + $this->assertNotVisible($base.'ctl2'); + $this->assertText($base.'lblResult2', 'Thanks !'); } }
\ No newline at end of file diff --git a/tests/FunctionalTests/tickets/tests/Ticket671_reopenedTestCase.php b/tests/FunctionalTests/tickets/tests/Ticket671_reopenedTestCase.php index 7ba24dcc..a3394bca 100755 --- a/tests/FunctionalTests/tickets/tests/Ticket671_reopenedTestCase.php +++ b/tests/FunctionalTests/tickets/tests/Ticket671_reopenedTestCase.php @@ -1,46 +1,46 @@ <?php -class Ticket671_reopenedTestCase extends PradoGenericSeleniumTest +class Ticket671_reopenedTestCase extends PradoGenericSelenium2Test { function test() { $base="ctl0_Content_"; - $this->open('tickets/index.php?page=Ticket671_reopened'); - $this->assertTitle("Verifying Ticket 671_reopened"); + $this->url('tickets/index.php?page=Ticket671_reopened'); + $this->assertEquals($this->title(), "Verifying Ticket 671_reopened"); // Type wrong value $this->type($base.'testField', 'abcd'); - $this->click($base.'ctl4'); + $this->byId($base.'ctl4')->click(); $this->pause(800); $this->assertVisible($base.'ctl2'); - $this->assertText($base.'Result', 'exact:Check callback called (1) --- Save callback called DATA NOK'); - + $this->assertText($base.'Result', 'Check callback called (1) --- Save callback called DATA NOK'); + // Reclick, should not have any callback - $this->click($base.'ctl4'); + $this->byId($base.'ctl4')->click(); $this->pause(800); $this->assertVisible($base.'ctl2'); - $this->assertText($base.'Result', 'exact:Check callback called (2) --- Save callback called DATA NOK'); - + $this->assertText($base.'Result', 'Check callback called (2) --- Save callback called DATA NOK'); + // Type right value $this->type($base.'testField', 'Test'); - $this->click($base.'ctl4'); + $this->byId($base.'ctl4')->click(); $this->pause(800); $this->assertNotVisible($base.'ctl2'); - $this->assertText($base.'Result', 'exact:Check callback called (3) --- Save callback called DATA OK'); - + $this->assertText($base.'Result', 'Check callback called (3) --- Save callback called DATA OK'); + // Type empty value $this->type($base.'testField', ''); - $this->click($base.'ctl4'); + $this->byId($base.'ctl4')->click(); $this->pause(800); $this->assertVisible($base.'ctl1'); $this->assertNotVisible($base.'ctl2'); - $this->assertText($base.'Result', 'exact:Check callback called (3) --- Save callback called DATA OK'); - + $this->assertText($base.'Result', 'Check callback called (3) --- Save callback called DATA OK'); + // Type right value $this->type($base.'testField', 'Test'); - $this->click($base.'ctl4'); + $this->byId($base.'ctl4')->click(); $this->pause(800); $this->assertNotVisible($base.'ctl1'); $this->assertNotVisible($base.'ctl2'); - $this->assertText($base.'Result', 'exact:Check callback called (4) --- Save callback called DATA OK'); + $this->assertText($base.'Result', 'Check callback called (4) --- Save callback called DATA OK'); } }
\ No newline at end of file diff --git a/tests/FunctionalTests/tickets/tests/Ticket679TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket679TestCase.php index 4ee22c20..2891a386 100755 --- a/tests/FunctionalTests/tickets/tests/Ticket679TestCase.php +++ b/tests/FunctionalTests/tickets/tests/Ticket679TestCase.php @@ -1,35 +1,35 @@ <?php -class Ticket679TestCase extends PradoGenericSeleniumTest +class Ticket679TestCase extends PradoGenericSelenium2Test { function test() { $base = 'ctl0_Content_'; - $this->open('tickets/index.php?page=Ticket679'); - $this->assertTitle("Verifying Ticket 679"); - + $this->url('tickets/index.php?page=Ticket679'); + $this->assertEquals($this->title(), "Verifying Ticket 679"); + // First part of ticket : Repeater bug - $this->click($base."ctl0"); + $this->byId($base."ctl0")->click(); $this->pause(800); $this->assertText($base."myLabel",'outside'); - $this->verifyVisible($base."myLabel"); - + $this->assertVisible($base."myLabel"); + // Reload completly the page $this->refresh(); $this->pause(800); - $this->click($base."Repeater_ctl0_ctl0"); + $this->byId($base."Repeater_ctl0_ctl0")->click(); $this->pause(800); $this->assertText($base."myLabel",'inside'); - $this->verifyVisible($base."myLabel"); - + $this->assertVisible($base."myLabel"); + // Second part of ticket : ARB bug - $this->verifyNotChecked($base."myRadioButton"); - $this->click($base."ctl1"); + $this->assertFalse($this->byId("{$base}myRadioButton")->selected()); + $this->byId($base."ctl1")->click(); $this->pause(800); - $this->verifyChecked($base."myRadioButton"); - $this->click($base."ctl2"); + $this->assertTrue($this->byId("{$base}myRadioButton")->selected()); + $this->byId($base."ctl2")->click(); $this->pause(800); - $this->verifyNotChecked($base."myRadioButton"); + $this->assertFalse($this->byId("{$base}myRadioButton")->selected()); $this->pause(800); } diff --git a/tests/FunctionalTests/tickets/tests/Ticket691TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket691TestCase.php index a441f82c..d014f2f4 100755 --- a/tests/FunctionalTests/tickets/tests/Ticket691TestCase.php +++ b/tests/FunctionalTests/tickets/tests/Ticket691TestCase.php @@ -1,16 +1,16 @@ <?php -class Ticket691TestCase extends PradoGenericSeleniumTest +class Ticket691TestCase extends PradoGenericSelenium2Test { function test() { $base = 'ctl0_Content_'; - $this->open('tickets/index.php?page=Ticket691'); - $this->assertTitle("Verifying Ticket 691"); - - $this->click($base."List_c2"); + $this->url('tickets/index.php?page=Ticket691'); + $this->assertEquals($this->title(), "Verifying Ticket 691"); + + $this->byXPath("//input[@id='{$base}List_c2']/../..")->click(); $this->pause(800); - $this->assertText($base."Title", "Thanks"); - $this->assertText($base."Result", "You vote 3"); + $this->assertText("{$base}Title", "Thanks"); + $this->assertText("{$base}Result", "You vote 3"); } }
\ No newline at end of file diff --git a/tests/FunctionalTests/tickets/tests/Ticket698TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket698TestCase.php index 8f58a320..8aa9cb4e 100755 --- a/tests/FunctionalTests/tickets/tests/Ticket698TestCase.php +++ b/tests/FunctionalTests/tickets/tests/Ticket698TestCase.php @@ -1,17 +1,17 @@ <?php -class Ticket698TestCase extends PradoGenericSeleniumTest +class Ticket698TestCase extends PradoGenericSelenium2Test { function test() { $base = 'ctl0_Content_'; - $this->open('tickets/index.php?page=Ticket698'); - $this->assertTitle("Verifying Ticket 698"); - - $this->click($base."switchContentTypeButton"); + $this->url('tickets/index.php?page=Ticket698'); + $this->assertEquals($this->title(), "Verifying Ticket 698"); + + $this->byId($base."switchContentTypeButton")->click(); $this->pause(800); $this->assertVisible($base."EditHtmlTextBox"); $this->pause(800); - $this->click($base."switchContentTypeButton"); + $this->byId($base."switchContentTypeButton")->click(); $this->pause(1000); $this->assertNotVisible($base."EditHtmlTextBox"); } diff --git a/tests/FunctionalTests/tickets/tests/Ticket700TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket700TestCase.php index 0366c2fc..d10529ce 100755 --- a/tests/FunctionalTests/tickets/tests/Ticket700TestCase.php +++ b/tests/FunctionalTests/tickets/tests/Ticket700TestCase.php @@ -1,71 +1,71 @@ <?php -class Ticket700TestCase extends PradoGenericSeleniumTest +class Ticket700TestCase extends PradoGenericSelenium2Test { function test() { // page: Home - $this->open('tickets/index700.php'); - $this->clickAndWait('ctl0_Logout'); - $this->clickAndWait('pageHome'); - $this->assertTitle("Home"); - $this->assertTextPresent('|Param1: Set at app config|'); - $this->assertTextPresent('|Param2: Set at root|'); - $this->assertTextPresent('|Param3: default 3|'); - $this->assertTextPresent('|Param4: default 4|'); - $this->assertTextPresent('|Param5: Set at root|'); + $this->url('tickets/index700.php'); + $this->byId('ctl0_Logout')->click(); + $this->byId('pageHome')->click(); + $this->assertEquals($this->title(), "Home"); + $this->assertContains('|Param1: Set at app config|', $this->source()); + $this->assertContains('|Param2: Set at root|', $this->source()); + $this->assertContains('|Param3: default 3|', $this->source()); + $this->assertContains('|Param4: default 4|', $this->source()); + $this->assertContains('|Param5: Set at root|', $this->source()); // page: admin.Home - $this->clickAndWait('pageAdminHome'); - $this->assertTitle('UserLogin'); + $this->byId('pageAdminHome')->click(); + $this->assertEquals($this->title(), 'UserLogin'); $this->type('ctl0_Main_Username','AdminUser'); $this->type('ctl0_Main_Password','demo'); - $this->clickAndWait('ctl0_Main_LoginButton'); - $this->clickAndWait('pageAdminHome'); - $this->assertTitle('admin.Home'); - $this->assertTextPresent('|Param1: Set at app config|'); - $this->assertTextPresent('|Param2: Set at admin|'); - $this->assertTextPresent('|Param3: Set at admin|'); - $this->assertTextPresent('|Param4: Set at app config|'); - $this->assertTextPresent('|Param5: Set at app config|'); + $this->byId('ctl0_Main_LoginButton')->click(); + $this->byId('pageAdminHome')->click(); + $this->assertEquals($this->title(), 'admin.Home'); + $this->assertContains('|Param1: Set at app config|', $this->source()); + $this->assertContains('|Param2: Set at admin|', $this->source()); + $this->assertContains('|Param3: Set at admin|', $this->source()); + $this->assertContains('|Param4: Set at app config|', $this->source()); + $this->assertContains('|Param5: Set at app config|', $this->source()); // page: admin.Home2 - $this->clickAndWait('pageAdminHome2'); - $this->assertTitle('admin.Home2'); - $this->clickAndWait('ctl0_Logout'); - $this->clickAndWait('pageAdminHome2'); - $this->assertTitle('admin.Home2'); + $this->byId('pageAdminHome2')->click(); + $this->assertEquals($this->title(), 'admin.Home2'); + $this->byId('ctl0_Logout')->click(); + $this->byId('pageAdminHome2')->click(); + $this->assertEquals($this->title(), 'admin.Home2'); // page: admin.users.Home - $this->clickAndWait('pageAdminUsersHome'); - $this->assertTitle('UserLogin'); + $this->byId('pageAdminUsersHome')->click(); + $this->assertEquals($this->title(), 'UserLogin'); $this->type('ctl0_Main_Username','NormalUser'); $this->type('ctl0_Main_Password','demo'); - $this->clickAndWait('ctl0_Main_LoginButton'); - $this->clickAndWait('pageAdminUsersHome'); - $this->assertTitle('UserLogin'); + $this->byId('ctl0_Main_LoginButton')->click(); + $this->byId('pageAdminUsersHome')->click(); + $this->assertEquals($this->title(), 'UserLogin'); $this->type('ctl0_Main_Username','AdminUser'); $this->type('ctl0_Main_Password','demo'); - $this->clickAndWait('ctl0_Main_LoginButton'); - $this->clickAndWait('pageAdminUsersHome'); - $this->assertTitle('admin.users.Home'); - $this->assertTextPresent('|Param1: Set at admin|'); - $this->assertTextPresent('|Param2: Set at admin.users|'); - $this->assertTextPresent('|Param3: default 3|'); - $this->assertTextPresent('|Param4: Set at admin|'); - $this->assertTextPresent('|Param5: Set at app config|'); + $this->byId('ctl0_Main_LoginButton')->click(); + $this->byId('pageAdminUsersHome')->click(); + $this->assertEquals($this->title(), 'admin.users.Home'); + $this->assertContains('|Param1: Set at admin|', $this->source()); + $this->assertContains('|Param2: Set at admin.users|', $this->source()); + $this->assertContains('|Param3: default 3|', $this->source()); + $this->assertContains('|Param4: Set at admin|', $this->source()); + $this->assertContains('|Param5: Set at app config|', $this->source()); // page: admin.users.Home2 - $this->clickAndWait('pageAdminUsersHome2'); - $this->assertTitle('admin.users.Home2'); + $this->byId('pageAdminUsersHome2')->click(); + $this->assertEquals($this->title(), 'admin.users.Home2'); // page: content.Home - $this->clickAndWait('pageContentHome'); - $this->assertTitle('content.Home'); - $this->assertTextPresent('|Param1: Set at app config|'); - $this->assertTextPresent('|Param2: Set at root|'); - $this->assertTextPresent('|Param3: default 3|'); - $this->assertTextPresent('|Param4: default 4|'); - $this->assertTextPresent('|Param5: Set at app config|'); - $this->clickAndWait('ctl0_Logout'); + $this->byId('pageContentHome')->click(); + $this->assertEquals($this->title(), 'content.Home'); + $this->assertContains('|Param1: Set at app config|', $this->source()); + $this->assertContains('|Param2: Set at root|', $this->source()); + $this->assertContains('|Param3: default 3|', $this->source()); + $this->assertContains('|Param4: default 4|', $this->source()); + $this->assertContains('|Param5: Set at app config|', $this->source()); + $this->byId('ctl0_Logout')->click(); } }
\ No newline at end of file diff --git a/tests/FunctionalTests/tickets/tests/Ticket703TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket703TestCase.php index dedb491f..46c240b1 100755 --- a/tests/FunctionalTests/tickets/tests/Ticket703TestCase.php +++ b/tests/FunctionalTests/tickets/tests/Ticket703TestCase.php @@ -1,25 +1,26 @@ <?php -class Ticket703TestCase extends PradoGenericSeleniumTest +class Ticket703TestCase extends PradoGenericSelenium2Test { function test() { $base = 'ctl0_Content_'; - $this->open('tickets/index.php?page=Ticket703.Ticket703'); - $this->assertTitle("Verifying Ticket703.Ticket703 703.703"); + $this->url('tickets/index.php?page=Ticket703.Ticket703'); + $this->assertEquals($this->title(), "Verifying Ticket703.Ticket703 703.703"); // Start with an empty log - $this->click($base.'ctl2'); + $this->byId($base.'ctl2')->click(); // Wait for callback to be lanched $this->pause(1000); $this->assertText($base.'logBox', ""); $this->type($base.'logMessage', "Test of prado logging system"); - $this->click($base.'ctl0'); + $this->byId($base.'ctl0')->click(); $this->pause(800); - $this->click($base.'ctl1'); - $this->assertTextPresent($base.'logBox', "Test of prado logging system"); + $this->byId($base.'ctl1')->click(); + $this->pause(1000); + $this->assertContains("Test of prado logging system", $this->byId($base.'logBox')->value()); // Clean log for next run - $this->click($base.'ctl2'); + $this->byId($base.'ctl2')->click(); // Wait for callback to be lanched $this->pause(1000); $this->assertText($base.'logBox', ""); diff --git a/tests/FunctionalTests/tickets/tests/Ticket708TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket708TestCase.php index 87509b29..ab8780f6 100755 --- a/tests/FunctionalTests/tickets/tests/Ticket708TestCase.php +++ b/tests/FunctionalTests/tickets/tests/Ticket708TestCase.php @@ -1,25 +1,25 @@ <?php -class Ticket708TestCase extends PradoGenericSeleniumTest +class Ticket708TestCase extends PradoGenericSelenium2Test { function test() { $base = 'ctl0_Content_'; - $this->open('tickets/index.php?page=Ticket708'); - $this->assertTitle("Verifying Ticket 708"); - - $this->click($base."grid_ctl1_RadioButton"); + $this->url('tickets/index.php?page=Ticket708'); + $this->assertEquals($this->title(), "Verifying Ticket 708"); + + $this->byId($base."grid_ctl1_RadioButton")->click(); $this->pause(800); $this->assertText($base."Result", "You have selected Radio Button #1"); - - $this->click($base."grid_ctl2_RadioButton"); + + $this->byId($base."grid_ctl2_RadioButton")->click(); $this->pause(800); $this->assertText($base."Result", "You have selected Radio Button #2"); - - $this->click($base."grid_ctl3_RadioButton"); + + $this->byId($base."grid_ctl3_RadioButton")->click(); $this->pause(800); $this->assertText($base."Result", "You have selected Radio Button #3"); - - $this->click($base."grid_ctl4_RadioButton"); + + $this->byId($base."grid_ctl4_RadioButton")->click(); $this->pause(800); $this->assertText($base."Result", "You have selected Radio Button #4"); } diff --git a/tests/FunctionalTests/tickets/tests/Ticket719TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket719TestCase.php index c71cb0a8..7c4a1d67 100755 --- a/tests/FunctionalTests/tickets/tests/Ticket719TestCase.php +++ b/tests/FunctionalTests/tickets/tests/Ticket719TestCase.php @@ -1,42 +1,45 @@ <?php -class Ticket719TestCase extends PradoGenericSeleniumTest +class Ticket719TestCase extends PradoGenericSelenium2Test { function test() { - $this->open("tickets/index.php?page=Ticket719"); - $this->verifyTextPresent("Verifying Ticket 719"); - + $this->url("tickets/index.php?page=Ticket719"); + $this->assertContains("Verifying Ticket 719", $this->source()); + $base="ctl0_Content_"; - - $this->click("${base}ctl2"); + + $this->byId("${base}ctl2")->click(); $this->pause(800); $this->assertVisible("${base}ctl0", 'Required'); $this->assertVisible("${base}ctl1", 'Required'); - - $this->type("${base}autocomplete", 'f'); - $this->runScript("Prado.Registry.get('${base}autocomplete').onKeyPress({})"); + + $this->byId("${base}autocomplete")->click(); + + $this->keys('f'); $this->pause(500); - $this->verifyTextPresent('Finland'); + $this->assertContains('Finland', $this->source()); - $this->type("${base}autocomplete", 'fr'); - $this->runScript("Prado.Registry.get('${base}autocomplete').onKeyPress({})"); + $this->keys('r'); $this->pause(500); - $this->verifyTextPresent('French'); + $this->assertContains('French', $this->source()); - $this->type("${base}autocomplete", 'fra'); - $this->runScript("Prado.Registry.get('${base}autocomplete').onKeyPress({})"); + $this->keys('a'); $this->pause(500); - $this->verifyTextPresent('France'); - - $this->click("css=#${base}autocomplete_result ul li"); + $this->assertContains('France', $this->source()); + + $this->byCssSelector("#${base}autocomplete_result ul li")->click(); $this->pause(800); $this->assertNotVisible("${base}ctl1"); - $this->type("${base}textbox", "Prado"); + $this->byId("${base}textbox")->clear(); + $this->byId("${base}textbox")->value('Prado'); + // trigger onblur() event + $this->byCssSelector('body')->click(); + $this->assertNotVisible("${base}ctl0"); - - $this->click("${base}ctl2"); + + $this->byId("${base}ctl2")->click(); $this->pause(800); $this->assertText("${base}Result", "TextBox Content : Prado -- Autocomplete Content :France"); } diff --git a/tests/FunctionalTests/tickets/tests/Ticket722TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket722TestCase.php index 90711162..dfa93089 100755 --- a/tests/FunctionalTests/tickets/tests/Ticket722TestCase.php +++ b/tests/FunctionalTests/tickets/tests/Ticket722TestCase.php @@ -1,28 +1,32 @@ <?php -class Ticket722TestCase extends PradoGenericSeleniumTest +class Ticket722TestCase extends PradoGenericSelenium2Test { function test() { $base = 'ctl0_Content_'; - $this->open('tickets/index.php?page=Ticket722'); - $this->assertTitle("Verifying Ticket 722"); - - $this->assertText($base.'InPlaceTextBox__label', 'Editable Text'); - $this->click($base.'InPlaceTextBox__label'); + $this->url('tickets/index.php?page=Ticket722'); + $this->assertEquals($this->title(), "Verifying Ticket 722"); + + $label = $this->byID("{$base}InPlaceTextBox__label"); + $this->assertEquals('Editable Text', $label->text()); + $label->click(); $this->pause(800); - $this->assertVisible($base.'InPlaceTextBox'); + + $textbox = $this->byID("{$base}InPlaceTextBox"); + $this->assertTrue($textbox->displayed()); + $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->assertFalse($textbox->displayed()); + $this->assertEquals('Prado', $label->text()); + + $this->byId("{$base}ctl0")->click(); $this->pause(800); - $this->assertText($base.'InPlaceTextBox__label', 'exact:Prado [Read Only]'); - $this->click($base.'InPlaceTextBox__label'); + $this->assertEquals('Prado [Read Only]', $label->text()); + + $label->click(); $this->pause(800); - $this->assertNotVisible($base.'InPlaceTextBox'); - + $this->assertFalse($textbox->displayed()); } }
\ No newline at end of file diff --git a/tests/FunctionalTests/tickets/tests/Ticket72TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket72TestCase.php index 111b7583..91fc9420 100755 --- a/tests/FunctionalTests/tickets/tests/Ticket72TestCase.php +++ b/tests/FunctionalTests/tickets/tests/Ticket72TestCase.php @@ -1,14 +1,14 @@ <?php -class Ticket72TestCase extends PradoGenericSeleniumTest +class Ticket72TestCase extends PradoGenericSelenium2Test { function test() { - $this->open('tickets/index.php?page=Ticket72'); + $this->url('tickets/index.php?page=Ticket72'); $this->type("ctl0\$Content\$K1", "abc"); $this->type("ctl0\$Content\$K2", "efg"); - $this->clickAndWait("//input[@type='submit' and @value='Send']", ""); - $this->verifyTextPresent("efg", ""); - $this->verifyTextNotPresent("abcefg", ""); + $this->byXPath("//input[@type='submit' and @value='Send']")->click(); + $this->assertContains("efg", $this->source()); + $this->assertNotContains("abcefg", $this->source()); } } diff --git a/tests/FunctionalTests/tickets/tests/Ticket745TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket745TestCase.php index f822e37f..690df8a1 100755 --- a/tests/FunctionalTests/tickets/tests/Ticket745TestCase.php +++ b/tests/FunctionalTests/tickets/tests/Ticket745TestCase.php @@ -1,17 +1,16 @@ <?php -class Ticket745TestCase extends PradoGenericSeleniumTest +class Ticket745TestCase extends PradoGenericSelenium2Test { function test() { $base = 'ctl0_Content_'; - $this->open('tickets/index.php?page=Ticket745'); - $this->assertTitle("Verifying Ticket 745"); - + $this->url('tickets/index.php?page=Ticket745'); + $this->assertEquals($this->title(), "Verifying Ticket 745"); + $this->select($base.'Wizard1_DropDownList1', 'Green'); - $this->click($base.'Wizard1_ctl4_ctl1'); + $this->byId($base.'Wizard1_ctl4_ctl1')->click(); $this->pause(800); - $this->assertTextPresent ('Step 3 of 3'); - + $this->assertContains('Step 3 of 3', $this->source()); } }
\ No newline at end of file diff --git a/tests/FunctionalTests/tickets/tests/Ticket769TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket769TestCase.php index 468342a5..03816667 100755 --- a/tests/FunctionalTests/tickets/tests/Ticket769TestCase.php +++ b/tests/FunctionalTests/tickets/tests/Ticket769TestCase.php @@ -1,36 +1,35 @@ <?php -class Ticket769TestCase extends PradoGenericSeleniumTest +class Ticket769TestCase extends PradoGenericSelenium2Test { function test() { $base="ctl0_Content_"; - $this->open('tickets/index.php?page=Ticket769'); - $this->assertTitle("Verifying Ticket 769"); - - $this->click($base.'ctl0'); + $this->url('tickets/index.php?page=Ticket769'); + $this->assertEquals($this->title(), "Verifying Ticket 769"); + + $this->byId($base.'ctl0')->click(); $this->assertVisible($base.'ctl1'); - + $this->type($base.'T1', 'Prado'); - $this->click($base.'ctl0'); + $this->byId($base.'ctl0')->click(); $this->pause(800); $this->assertNotVisible($base.'ctl1'); - $this->verifyTextPresent($base.'ctl0', 'T1 clicked' ); - - $this->click($base.'ctl2'); + $this->assertValue($base.'ctl0', 'T1 clicked' ); + + $this->byId($base.'ctl2')->click(); $this->pause(800); - $this->verifyTextPresent($base.'B', 'This is B'); - $this->click($base.'ctl3'); + $this->assertText($base.'B', 'This is B'); + $this->byId($base.'ctl3')->click(); $this->pause(800); - + $this->type($base.'T1', ''); - $this->click($base.'ctl0'); + $this->byId($base.'ctl0')->click(); $this->assertVisible($base.'ctl1'); $this->type($base.'T1', 'Prado'); - $this->click($base.'ctl0'); + $this->byId($base.'ctl0')->click(); $this->pause(800); $this->assertNotVisible($base.'ctl1'); - $this->verifyTextPresent($base.'ctl0', 'T1 clicked clicked' ); - + $this->assertValue($base.'ctl0', 'T1 clicked clicked' ); } }
\ No newline at end of file diff --git a/tests/FunctionalTests/tickets/tests/Ticket785TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket785TestCase.php index 229a68eb..c20f29a3 100755 --- a/tests/FunctionalTests/tickets/tests/Ticket785TestCase.php +++ b/tests/FunctionalTests/tickets/tests/Ticket785TestCase.php @@ -1,33 +1,33 @@ <?php -class Ticket785TestCase extends PradoGenericSeleniumTest +class Ticket785TestCase extends PradoGenericSelenium2Test { function test() { $year=date('Y')-1; $base = 'ctl0_Content_'; - $this->open('tickets/index.php?page=Ticket785'); - $this->assertTitle("Verifying Ticket 785"); - + $this->url('tickets/index.php?page=Ticket785'); + $this->assertEquals($this->title(), "Verifying Ticket 785"); + $this->assertText('selDate', ''); $this->select($base."datePicker_year", $year); $this->pause(800); $expectedDate=date("d-m").'-'.$year; $this->assertText('selDate', $expectedDate); - - $this->click($base."datePickerbutton"); + + $this->byId($base."datePickerbutton")->click(); $this->pause(800); - $this->click("css=input.todayButton"); + $this->byCssSelector("input.todayButton")->click(); $this->pause(800); - $this->clickAt("css=body","0,0"); // Hide calendar + $this->byCssSelector("body")->click(); // Hide calendar $expectedDate=date("d-m-Y"); $this->assertText('selDate', $expectedDate); - + $this->assertText('selDate2', ''); $this->type($base.'datePicker2', '12/05/2006'); $this->pause(800); - $this->clickAt("css=body","0,0"); - $this->assertText('selDate2', '12/05/2006'); - + $this->byCssSelector("body")->click(); + $this->assertText('selDate2', '12/05/2006'); + } }
\ No newline at end of file diff --git a/tests/FunctionalTests/tickets/tests/Ticket823TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket823TestCase.php index 11e363ba..163eb541 100755 --- a/tests/FunctionalTests/tickets/tests/Ticket823TestCase.php +++ b/tests/FunctionalTests/tickets/tests/Ticket823TestCase.php @@ -1,12 +1,12 @@ <?php -class Ticket823TestCase extends PradoGenericSeleniumTest { +class Ticket823TestCase extends PradoGenericSelenium2Test { public function test() { - $this->open('tickets/index.php?page=Ticket823'); - $this->assertTitle("Verifying Ticket 823"); + $this->url('tickets/index.php?page=Ticket823'); + $this->assertEquals($this->title(), "Verifying Ticket 823"); $base = 'ctl0_Content_'; - $this->assertElementPresent('xpath=//option[@value="Choose..."]'); + $this->assertElementPresent('//option[@value="Choose..."]'); } } diff --git a/tests/FunctionalTests/tickets/tests/Ticket828TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket828TestCase.php index bbe185ad..9a44a5ec 100755 --- a/tests/FunctionalTests/tickets/tests/Ticket828TestCase.php +++ b/tests/FunctionalTests/tickets/tests/Ticket828TestCase.php @@ -1,34 +1,34 @@ <?php -class Ticket828TestCase extends PradoGenericSeleniumTest +class Ticket828TestCase extends PradoGenericSelenium2Test { function test() { $base = "ctl0_Content_"; - $this->open("tickets/index.php?page=Ticket828"); - $this->click("{$base}submit1"); + $this->url("tickets/index.php?page=Ticket828"); + $this->byId("{$base}submit1")->click(); $this->assertVisible("{$base}validator1"); $this->assertVisible("{$base}validator2"); $this->assertVisible("{$base}validator3"); - $this->click("{$base}list1_c0"); - $this->addSelection("{$base}list2", "label=One"); - $this->addSelection("{$base}list2", "label=Two"); - $this->click("{$base}list3_c3"); - $this->clickAndWait("{$base}submit1"); + $this->byId("{$base}list1_c0")->click(); + $this->addSelection("{$base}list2", "One"); + $this->addSelection("{$base}list2", "Two"); + $this->byId("{$base}list3_c3")->click(); + $this->byId("{$base}submit1")->click(); $this->assertNotVisible("{$base}validator1"); $this->assertNotVisible("{$base}validator2"); $this->assertNotVisible("{$base}validator3"); - $this->click("{$base}list1_c1"); - $this->click("{$base}list1_c2"); - $this->click("{$base}list1_c3"); - $this->addSelection("{$base}list2", "label=Two"); - $this->click("{$base}list1_c3"); - $this->clickAndWait("{$base}submit1"); + $this->byId("{$base}list1_c1")->click(); + $this->byId("{$base}list1_c2")->click(); + $this->byId("{$base}list1_c3")->click(); + $this->addSelection("{$base}list2", "Two"); + $this->byId("{$base}list1_c3")->click(); + $this->byId("{$base}submit1")->click(); $this->assertNotVisible("{$base}validator1"); $this->assertNotVisible("{$base}validator2"); $this->assertNotVisible("{$base}validator3"); - $this->click("{$base}list3_c3"); - $this->clickAndWait("{$base}submit1"); + $this->byId("{$base}list3_c3")->click(); + $this->byId("{$base}submit1")->click(); $this->pause(200); $this->assertNotVisible("{$base}validator1"); $this->assertNotVisible("{$base}validator2"); diff --git a/tests/FunctionalTests/tickets/tests/Ticket849TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket849TestCase.php index fef9ac31..e354b126 100755 --- a/tests/FunctionalTests/tickets/tests/Ticket849TestCase.php +++ b/tests/FunctionalTests/tickets/tests/Ticket849TestCase.php @@ -1,15 +1,15 @@ <?php -class Ticket849TestCase extends PradoGenericSeleniumTest +class Ticket849TestCase extends PradoGenericSelenium2Test { function test() { - $this->open('tickets/index.php?page=Ticket849'); - $this->assertTitle("Verifying Ticket 849"); + $this->url('tickets/index.php?page=Ticket849'); + $this->assertEquals($this->title(), "Verifying Ticket 849"); $base='ctl0_Content_'; - $this->click($base.'ctl0'); + $this->byId($base.'ctl0')->click(); $this->pause(800); - $this->click('css=td.date.today.selected'); + $this->byCssSelector('td.date.today.selected')->click(); $this->pause(1000); $this->assertValue($base.'ctl0', date('m-d-Y')); } diff --git a/tests/FunctionalTests/tickets/tests/Ticket876TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket876TestCase.php index 8006dd09..361235fc 100755 --- a/tests/FunctionalTests/tickets/tests/Ticket876TestCase.php +++ b/tests/FunctionalTests/tickets/tests/Ticket876TestCase.php @@ -1,22 +1,22 @@ <?php -class Ticket876TestCase extends PradoGenericSeleniumTest { +class Ticket876TestCase extends PradoGenericSelenium2Test { public function test() { - $this->open('tickets/index.php?page=Ticket876'); - $this->assertTitle("Verifying Ticket 876"); + $this->url('tickets/index.php?page=Ticket876'); + $this->assertEquals($this->title(), "Verifying Ticket 876"); $base = 'ctl0_Content_'; - - $this->assertElementPresent('xpath=//link[@rel="stylesheet"]'); - $this->clickAndWait($base.'Button'); - $this->assertElementNotPresent('xpath=//link[@rel="stylesheet"]'); - + + $this->assertElementPresent('//link[@rel="stylesheet"]'); + $this->byId($base.'Button')->click(); + $this->assertElementNotPresent('//link[@rel="stylesheet"]'); + /*$this->select($base.'Date_month', 10); $this->select($base.'Date_day', 22); - - $this->clickAndWait($base.'SendButton'); - $this->assertTextPresent('2008-10-22');*/ + + $this->byId($base.'SendButton')->click(); + $this->assertContains('2008-10-22', $this->source());*/ } - + } diff --git a/tests/FunctionalTests/tickets/tests/Ticket886TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket886TestCase.php index 99990ebf..7f9c23f3 100755 --- a/tests/FunctionalTests/tickets/tests/Ticket886TestCase.php +++ b/tests/FunctionalTests/tickets/tests/Ticket886TestCase.php @@ -1,14 +1,14 @@ <?php -class Ticket886TestCase extends PradoGenericSeleniumTest +class Ticket886TestCase extends PradoGenericSelenium2Test { function test() { - $this->open('tickets/index.php?page=Ticket886'); - $this->assertTitle("Verifying Ticket 886"); + $this->url('tickets/index.php?page=Ticket886'); + $this->assertEquals($this->title(), "Verifying Ticket 886"); $base = 'ctl0_Content_'; - $this->clickAndWait($base.'SendButton'); - $this->assertTextPresent(date('Y').'-01-01'); + $this->byId($base.'SendButton')->click(); + $this->assertContains(date('Y').'-01-01', $this->source()); } } diff --git a/tests/FunctionalTests/tickets/tests/Ticket897TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket897TestCase.php index 67d1f1f2..e3bac037 100755 --- a/tests/FunctionalTests/tickets/tests/Ticket897TestCase.php +++ b/tests/FunctionalTests/tickets/tests/Ticket897TestCase.php @@ -1,18 +1,18 @@ <?php -class Ticket897TestCase extends PradoGenericSeleniumTest +class Ticket897TestCase extends PradoGenericSelenium2Test { function test() { - $this->open('tickets/index.php?page=Ticket897'); - $this->assertTitle("Verifying Ticket 897"); + $this->url('tickets/index.php?page=Ticket897'); + $this->assertEquals($this->title(), "Verifying Ticket 897"); $base = 'ctl0_Content_'; - + $this->select($base.'Date_month', 10); $this->select($base.'Date_day', 22); - - $this->clickAndWait($base.'SendButton'); - $this->assertTextPresent(date('Y').'-10-22'); + + $this->byId($base.'SendButton')->click(); + $this->assertContains(date('Y').'-10-22', $this->source()); } } diff --git a/tests/FunctionalTests/tickets/tests/Ticket900TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket900TestCase.php index 3ec69873..fc0bcc01 100755 --- a/tests/FunctionalTests/tickets/tests/Ticket900TestCase.php +++ b/tests/FunctionalTests/tickets/tests/Ticket900TestCase.php @@ -1,17 +1,17 @@ <?php -class Ticket900TestCase extends PradoGenericSeleniumTest +class Ticket900TestCase extends PradoGenericSelenium2Test { function test() { - $this->open('tickets/index.php?page=Ticket900'); - $this->assertTitle("Verifying Ticket 900"); + $this->url('tickets/index.php?page=Ticket900'); + $this->assertEquals($this->title(), "Verifying Ticket 900"); $base = 'ctl0_Content_'; - - $this->clickAndWait('ctl0$Content$DataGrid$ctl1$ctl3'); + + $this->byName('ctl0$Content$DataGrid$ctl1$ctl3')->click(); $this->type($base.'DataGrid_ctl1_TextBox', ''); - $this->click($base.'DataGrid_ctl1_ctl3'); - $this->clickAndWait('ctl0$Content$DataGrid$ctl1$ctl4'); + $this->byId($base.'DataGrid_ctl1_ctl3')->click(); + $this->byName('ctl0$Content$DataGrid$ctl1$ctl4')->click(); $this->assertText($base.'CommandName', 'cancel'); } } diff --git a/tests/FunctionalTests/tickets/tests/Ticket922TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket922TestCase.php index 208bd1d0..f03f980e 100755 --- a/tests/FunctionalTests/tickets/tests/Ticket922TestCase.php +++ b/tests/FunctionalTests/tickets/tests/Ticket922TestCase.php @@ -1,15 +1,15 @@ <?php -class Ticket922TestCase extends PradoGenericSeleniumTest +class Ticket922TestCase extends PradoGenericSelenium2Test { function test() { - $this->open('tickets/index.php?page=Ticket922'); - $this->assertTitle("Verifying Ticket 922"); + $this->url('tickets/index.php?page=Ticket922'); + $this->assertEquals($this->title(), "Verifying Ticket 922"); $base = 'ctl0_Content_'; - + $this->type($base.'Text', 'two words'); - $this->clickAndWait('ctl0$Content$ctl0'); + $this->byName('ctl0$Content$ctl0')->click(); $this->assertText($base.'Result','two words'); } diff --git a/tests/FunctionalTests/tickets/tests/Ticket93TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket93TestCase.php index a56925a8..538860d4 100755 --- a/tests/FunctionalTests/tickets/tests/Ticket93TestCase.php +++ b/tests/FunctionalTests/tickets/tests/Ticket93TestCase.php @@ -4,12 +4,12 @@ * */ -class Ticket93TestCase extends PradoGenericSeleniumTest +class Ticket93TestCase extends PradoGenericSelenium2Test { function test() { - $this->open('tickets/index.php?page=Ticket93'); - $this->verifyTextPresent("ValidationGroups without any inputs with grouping"); + $this->url('tickets/index.php?page=Ticket93'); + $this->assertContains("ValidationGroups without any inputs with grouping", $this->source()); } - + } diff --git a/tests/FunctionalTests/validators/protected/pages/ConditionalValidation.page b/tests/FunctionalTests/validators/protected/pages/ConditionalValidation.page index ad43135b..582fff59 100755 --- a/tests/FunctionalTests/validators/protected/pages/ConditionalValidation.page +++ b/tests/FunctionalTests/validators/protected/pages/ConditionalValidation.page @@ -16,7 +16,7 @@ ErrorMessage="*"
ControlCssClass="required">
<prop:ClientSide.OnValidate>
- sender.enabled = $('<%= $this->check1->ClientID %>').checked;
+ sender.enabled = $('#<%= $this->check1->ClientID %>').get(0).checked;
</prop:ClientSide.OnValidate>
</com:TRequiredFieldValidator>
diff --git a/tests/FunctionalTests/validators/protected/pages/CustomValidator.page b/tests/FunctionalTests/validators/protected/pages/CustomValidator.page index 2d0d490b..47238e48 100755 --- a/tests/FunctionalTests/validators/protected/pages/CustomValidator.page +++ b/tests/FunctionalTests/validators/protected/pages/CustomValidator.page @@ -2,7 +2,7 @@ <h1>Prado CustomValidator Tests</h1>
<script type="text/javascript">
-var MyCustomValidator =
+var MyCustomValidator =
{
validate : function(sender, value)
{
@@ -17,7 +17,7 @@ var MyCustomValidator = ControlToValidate="text1"
ErrorMessage="Enter 'Prado'"
ControlCssClass="required"
- ClientValidationFunction="MyCustomValidator.validate"
+ ClientValidationFunction="MyCustomValidator.validate"
OnServerValidate="CustomValidation"
/>
<com:TButton ID="submit1" Text="Test" />
diff --git a/tests/FunctionalTests/validators/protected/pages/Layout.tpl b/tests/FunctionalTests/validators/protected/pages/Layout.tpl index 25dbea09..47591ef3 100755 --- a/tests/FunctionalTests/validators/protected/pages/Layout.tpl +++ b/tests/FunctionalTests/validators/protected/pages/Layout.tpl @@ -33,7 +33,6 @@ <com:TForm>
<com:TContentPlaceHolder ID="Content" />
<hr style="margin-top: 2em" />
-<com:TJavascriptLogger />
</com:TForm>
</body>
</html>
\ No newline at end of file diff --git a/tests/FunctionalTests/validators/protected/pages/ListControl.page b/tests/FunctionalTests/validators/protected/pages/ListControl.page index 1429e184..a75dc3ff 100755 --- a/tests/FunctionalTests/validators/protected/pages/ListControl.page +++ b/tests/FunctionalTests/validators/protected/pages/ListControl.page @@ -1,58 +1,58 @@ <com:TContent ID="Content">
- <h1>List Control Required Field Validation Test</h1>
+ <h1>List Control Required Field Validation Test</h1>
<com:TCheckBoxList ID="list1">
<com:TListItem Text="Select a color below" Value="" />
<com:TListItem Text="Red" />
<com:TListItem Text="Blue" />
<com:TListItem Text="Green" />
</com:TCheckBoxList>
-
+
<com:TRequiredFieldValidator ID="validator1"
ControlToValidate="list1"
InitialValue="Select a color below"
ErrorMessage="*" />
-
+
<hr />
-
+
<com:TDropDownList ID="list2">
<com:TListItem Text="--- Select a color ---" />
<com:TListItem Text="Red" />
<com:TListItem Text="Blue" />
<com:TListItem Text="Green" />
</com:TDropDownList>
-
+
<com:TRequiredFieldValidator ID="validator2"
ControlToValidate="list2"
InitialValue="--- Select a color ---"
ErrorMessage="*" />
-
+
<hr />
-
+
<com:TListBox ID="list3">
- <com:TListItem Text="Don't select this one" />
+ <com:TListItem Text="Dont select this one" />
<com:TListItem Text="Red" />
<com:TListItem Text="Blue" />
<com:TListItem Text="Green" />
</com:TListBox>
-
+
<com:TRequiredFieldValidator ID="validator3"
ControlToValidate="list3"
- InitialValue="Don't select this one"
+ InitialValue="Dont select this one"
ErrorMessage="*" />
-
+
<hr />
-
+
<com:TRadioButtonList ID="list4">
<com:TListItem Text="Select something else" />
<com:TListItem Text="Red" />
<com:TListItem Text="Blue" />
<com:TListItem Text="Green" />
</com:TRadioButtonList>
-
+
<com:TRequiredFieldValidator ID="validator4"
ControlToValidate="list4"
InitialValue="Select something else"
ErrorMessage="*" />
-
+
<com:TButton ID="submit1" Text="Submit!" />
</com:TContent>
\ No newline at end of file diff --git a/tests/FunctionalTests/validators/tests/ButtonTestCase.php b/tests/FunctionalTests/validators/tests/ButtonTestCase.php index 58001322..90265156 100755 --- a/tests/FunctionalTests/validators/tests/ButtonTestCase.php +++ b/tests/FunctionalTests/validators/tests/ButtonTestCase.php @@ -1,63 +1,63 @@ <?php -class ButtonTestCase extends PradoGenericSeleniumTest +class ButtonTestCase extends PradoGenericSelenium2Test { function test() { - $this->open('validators/index.php?page=Button'); + $this->url('validators/index.php?page=Button'); // verify all error messages are invisible - $this->verifyNotVisible('ctl0_Content_ctl0'); - $this->verifyNotVisible('ctl0_Content_ctl2'); - $this->verifyNotVisible('ctl0_Content_ctl4'); + $this->assertNotVisible('ctl0_Content_ctl0'); + $this->assertNotVisible('ctl0_Content_ctl2'); + $this->assertNotVisible('ctl0_Content_ctl4'); // verify the first validator shows the error - $this->click("ctl0_Content_ctl1"); - $this->verifyVisible('ctl0_Content_ctl0'); - $this->verifyNotVisible('ctl0_Content_ctl2'); - $this->verifyNotVisible('ctl0_Content_ctl4'); + $this->byId("ctl0_Content_ctl1")->click(); + $this->assertVisible('ctl0_Content_ctl0'); + $this->assertNotVisible('ctl0_Content_ctl2'); + $this->assertNotVisible('ctl0_Content_ctl4'); // verify the first validation is passed $this->pause(500); - $this->verifyTextNotPresent('Button1 is clicked'); + $this->assertNotContains('Button1 is clicked', $this->source()); $this->type("ctl0_Content_TextBox1", "test"); - $this->clickAndWait("ctl0_Content_ctl1"); - $this->verifyNotVisible('ctl0_Content_ctl0'); - $this->verifyNotVisible('ctl0_Content_ctl2'); - $this->verifyNotVisible('ctl0_Content_ctl4'); - $this->verifyTextPresent('Button1 is clicked and valid'); + $this->byId("ctl0_Content_ctl1")->click(); + $this->assertNotVisible('ctl0_Content_ctl0'); + $this->assertNotVisible('ctl0_Content_ctl2'); + $this->assertNotVisible('ctl0_Content_ctl4'); + $this->assertContains('Button1 is clicked and valid', $this->source()); // verify the second validator shows the error - $this->click("ctl0_Content_ctl3"); - $this->verifyNotVisible('ctl0_Content_ctl0'); - $this->verifyVisible('ctl0_Content_ctl2'); - $this->verifyNotVisible('ctl0_Content_ctl4'); + $this->byId("ctl0_Content_ctl3")->click(); + $this->assertNotVisible('ctl0_Content_ctl0'); + $this->assertVisible('ctl0_Content_ctl2'); + $this->assertNotVisible('ctl0_Content_ctl4'); // verify the second validation is passed $this->pause(500); - $this->verifyTextNotPresent('Button2 is clicked'); + $this->assertNotContains('Button2 is clicked', $this->source()); $this->type("ctl0_Content_TextBox2", "test"); - $this->clickAndWait("ctl0_Content_ctl3"); - $this->verifyNotVisible('ctl0_Content_ctl0'); - $this->verifyNotVisible('ctl0_Content_ctl2'); - $this->verifyNotVisible('ctl0_Content_ctl4'); - $this->verifyTextPresent('Button2 is clicked and valid'); + $this->byId("ctl0_Content_ctl3")->click(); + $this->assertNotVisible('ctl0_Content_ctl0'); + $this->assertNotVisible('ctl0_Content_ctl2'); + $this->assertNotVisible('ctl0_Content_ctl4'); + $this->assertContains('Button2 is clicked and valid', $this->source()); // verify the third validator shows the error - $this->clickAndWait("ctl0_Content_ctl5"); - $this->verifyNotVisible('ctl0_Content_ctl0'); - $this->verifyNotVisible('ctl0_Content_ctl2'); - $this->verifyVisible('ctl0_Content_ctl4'); + $this->byId("ctl0_Content_ctl5")->click(); + $this->assertNotVisible('ctl0_Content_ctl0'); + $this->assertNotVisible('ctl0_Content_ctl2'); + $this->assertVisible('ctl0_Content_ctl4'); // verify the third validation is passed - $this->verifyTextPresent('Button3 is clicked'); - $this->verifyTextNotPresent('Button3 is clicked and valid'); + $this->assertContains('Button3 is clicked', $this->source()); + $this->assertNotContains('Button3 is clicked and valid', $this->source()); $this->type("ctl0_Content_TextBox3", "test"); - $this->clickAndWait("ctl0_Content_ctl5"); - $this->verifyNotVisible('ctl0_Content_ctl0'); - $this->verifyNotVisible('ctl0_Content_ctl2'); - $this->verifyNotVisible('ctl0_Content_ctl4'); - $this->verifyTextPresent('Button3 is clicked and valid'); + $this->byId("ctl0_Content_ctl5")->click(); + $this->assertNotVisible('ctl0_Content_ctl0'); + $this->assertNotVisible('ctl0_Content_ctl2'); + $this->assertNotVisible('ctl0_Content_ctl4'); + $this->assertContains('Button3 is clicked and valid', $this->source()); } } diff --git a/tests/FunctionalTests/validators/tests/CheckBoxTestCase.php b/tests/FunctionalTests/validators/tests/CheckBoxTestCase.php index 847cbc9a..8e6e1583 100755 --- a/tests/FunctionalTests/validators/tests/CheckBoxTestCase.php +++ b/tests/FunctionalTests/validators/tests/CheckBoxTestCase.php @@ -1,65 +1,65 @@ <?php -class CheckBoxTestCase extends PradoGenericSeleniumTest +class CheckBoxTestCase extends PradoGenericSelenium2Test { function test() { - $this->open('validators/index.php?page=CheckBox'); + $this->url('validators/index.php?page=CheckBox'); // verify all error messages are invisible - $this->verifyNotVisible('ctl0_Content_ctl0'); - $this->verifyNotVisible('ctl0_Content_ctl2'); - $this->verifyNotVisible('ctl0_Content_ctl4'); + $this->assertNotVisible('ctl0_Content_ctl0'); + $this->assertNotVisible('ctl0_Content_ctl2'); + $this->assertNotVisible('ctl0_Content_ctl4'); // verify the first validator shows the error - $this->click("ctl0_Content_ctl1"); - $this->verifyVisible('ctl0_Content_ctl0'); - $this->verifyNotVisible('ctl0_Content_ctl2'); - $this->verifyNotVisible('ctl0_Content_ctl4'); + $this->byId("ctl0_Content_ctl1")->click(); + $this->assertVisible('ctl0_Content_ctl0'); + $this->assertNotVisible('ctl0_Content_ctl2'); + $this->assertNotVisible('ctl0_Content_ctl4'); // verify the first validation is passed $this->pause(500); - $this->verifyTextNotPresent('Button1 is clicked'); + $this->assertNotContains('Button1 is clicked', $this->source()); $this->type("ctl0_Content_TextBox1", "test"); - $this->clickAndWait("ctl0_Content_ctl1"); - $this->clickAndWait("ctl0_Content_ctl1"); - $this->verifyNotVisible('ctl0_Content_ctl0'); - $this->verifyNotVisible('ctl0_Content_ctl2'); - $this->verifyNotVisible('ctl0_Content_ctl4'); - $this->verifyTextPresent('Button1 is clicked and valid'); + $this->byId("ctl0_Content_ctl1")->click(); + $this->byId("ctl0_Content_ctl1")->click(); + $this->assertNotVisible('ctl0_Content_ctl0'); + $this->assertNotVisible('ctl0_Content_ctl2'); + $this->assertNotVisible('ctl0_Content_ctl4'); + $this->assertContains('Button1 is clicked and valid', $this->source()); // verify the second validator shows the error - $this->click("ctl0_Content_ctl3"); - $this->verifyNotVisible('ctl0_Content_ctl0'); - $this->verifyVisible('ctl0_Content_ctl2'); - $this->verifyNotVisible('ctl0_Content_ctl4'); + $this->byId("ctl0_Content_ctl3")->click(); + $this->assertNotVisible('ctl0_Content_ctl0'); + $this->assertVisible('ctl0_Content_ctl2'); + $this->assertNotVisible('ctl0_Content_ctl4'); // verify the second validation is passed $this->pause(500); - $this->verifyTextNotPresent('Button2 is clicked'); + $this->assertNotContains('Button2 is clicked', $this->source()); $this->type("ctl0_Content_TextBox2", "test"); - $this->clickAndWait("ctl0_Content_ctl3"); - $this->clickAndWait("ctl0_Content_ctl3"); - $this->verifyNotVisible('ctl0_Content_ctl0'); - $this->verifyNotVisible('ctl0_Content_ctl2'); - $this->verifyNotVisible('ctl0_Content_ctl4'); - $this->verifyTextPresent('Button2 is clicked and valid'); + $this->byId("ctl0_Content_ctl3")->click(); + $this->byId("ctl0_Content_ctl3")->click(); + $this->assertNotVisible('ctl0_Content_ctl0'); + $this->assertNotVisible('ctl0_Content_ctl2'); + $this->assertNotVisible('ctl0_Content_ctl4'); + $this->assertContains('Button2 is clicked and valid', $this->source()); // verify the third validator shows the error - $this->clickAndWait("ctl0_Content_ctl5"); - $this->verifyNotVisible('ctl0_Content_ctl0'); - $this->verifyNotVisible('ctl0_Content_ctl2'); - $this->verifyVisible('ctl0_Content_ctl4'); + $this->byId("ctl0_Content_ctl5")->click(); + $this->assertNotVisible('ctl0_Content_ctl0'); + $this->assertNotVisible('ctl0_Content_ctl2'); + $this->assertVisible('ctl0_Content_ctl4'); // verify the third validation is passed - $this->verifyTextPresent('Button3 is clicked'); - $this->verifyTextNotPresent('Button3 is clicked and valid'); + $this->assertContains('Button3 is clicked', $this->source()); + $this->assertNotContains('Button3 is clicked and valid', $this->source()); $this->type("ctl0_Content_TextBox3", "test"); - $this->clickAndWait("ctl0_Content_ctl5"); - $this->verifyNotVisible('ctl0_Content_ctl0'); - $this->verifyNotVisible('ctl0_Content_ctl2'); - $this->verifyNotVisible('ctl0_Content_ctl4'); - $this->verifyTextPresent('Button3 is clicked and valid'); + $this->byId("ctl0_Content_ctl5")->click(); + $this->assertNotVisible('ctl0_Content_ctl0'); + $this->assertNotVisible('ctl0_Content_ctl2'); + $this->assertNotVisible('ctl0_Content_ctl4'); + $this->assertContains('Button3 is clicked and valid', $this->source()); } } diff --git a/tests/FunctionalTests/validators/tests/CompareValidatorTestCase.php b/tests/FunctionalTests/validators/tests/CompareValidatorTestCase.php index 187351c1..f9652e76 100755 --- a/tests/FunctionalTests/validators/tests/CompareValidatorTestCase.php +++ b/tests/FunctionalTests/validators/tests/CompareValidatorTestCase.php @@ -1,42 +1,43 @@ <?php //New Test -class CompareValidatorTestCase extends PradoGenericSeleniumTest +class CompareValidatorTestCase extends PradoGenericSelenium2Test { function test() { $base = "ctl0_Content_"; - - $this->open("validators/index.php?page=CompareValidator", ""); - $this->verifyTextPresent("Prado CompareValidator Tests", ""); + + $this->url("validators/index.php?page=CompareValidator"); + $this->assertContains("Prado CompareValidator Tests", $this->source()); $this->type("{$base}text1", "qwe"); $this->assertNotVisible("{$base}validator1"); $this->assertNotVisible("{$base}validator2"); - - $this->click("//input[@type='submit' and @value='Test']", ""); + + $this->byXPath("//input[@type='submit' and @value='Test']")->click(); $this->type("{$base}text2", "1234"); - $this->click("//input[@type='submit' and @value='Test']", ""); + $this->byXPath("//input[@type='submit' and @value='Test']")->click(); $this->assertVisible("{$base}validator1"); $this->type("{$base}text2", "qwe"); - $this->clickAndWait("//input[@type='submit' and @value='Test']", ""); + $this->byXPath("//input[@type='submit' and @value='Test']")->click(); $this->assertNotVisible("{$base}validator1"); $this->assertNotVisible("{$base}validator2"); - + $this->type("{$base}text3", "12312"); - $this->click("//input[@type='submit' and @value='Test']", ""); + $this->byXPath("//input[@type='submit' and @value='Test']")->click(); + $this->pause(500); $this->assertVisible("{$base}validator2"); - + $this->type("{$base}text3", "13/1/2005"); $this->assertVisible("{$base}validator2"); - + $this->type("{$base}text3", "12/1/2005"); - $this->clickAndWait("//input[@type='submit' and @value='Test']", ""); - + $this->byXPath("//input[@type='submit' and @value='Test']")->click(); + $this->assertNotVisible("{$base}validator1"); $this->assertNotVisible("{$base}validator2"); diff --git a/tests/FunctionalTests/validators/tests/ConditionalValidationTestCase.php b/tests/FunctionalTests/validators/tests/ConditionalValidationTestCase.php index 02b174ef..32e79a90 100755 --- a/tests/FunctionalTests/validators/tests/ConditionalValidationTestCase.php +++ b/tests/FunctionalTests/validators/tests/ConditionalValidationTestCase.php @@ -1,52 +1,52 @@ <?php -class ConditionalValidationTestCase extends PradoGenericSeleniumTest +class ConditionalValidationTestCase extends PradoGenericSelenium2Test { function test() { $base = "ctl0_Content_"; - $this->open("validators/index.php?page=ConditionalValidation", ""); - $this->verifyTextPresent("Conditional Validation (clientside + server side)", ""); - $this->assertNotVisible("{$base}validator1", ""); - $this->assertNotVisible("{$base}validator2", ""); + $this->url("validators/index.php?page=ConditionalValidation"); + $this->assertContains("Conditional Validation (clientside + server side)", $this->source()); + $this->assertNotVisible("{$base}validator1"); + $this->assertNotVisible("{$base}validator2"); - $this->click("{$base}submit1"); - $this->assertVisible("{$base}validator1", ""); - $this->assertNotVisible("{$base}validator2", ""); + $this->byId("{$base}submit1")->click(); + $this->assertVisible("{$base}validator1"); + $this->assertNotVisible("{$base}validator2"); - $this->click("{$base}check1"); - $this->click("{$base}submit1"); - $this->assertVisible("{$base}validator1", ""); - $this->assertVisible("{$base}validator2", ""); + $this->byId("{$base}check1")->click(); + $this->byId("{$base}submit1")->click(); + $this->assertVisible("{$base}validator1"); + $this->assertVisible("{$base}validator2"); - $this->click("{$base}check1"); - $this->click("{$base}submit1"); - $this->assertVisible("{$base}validator1", ""); - $this->assertNotVisible("{$base}validator2", ""); + $this->byId("{$base}check1")->click(); + $this->byId("{$base}submit1")->click(); + $this->assertVisible("{$base}validator1"); + $this->assertNotVisible("{$base}validator2"); $this->type("{$base}text1", "testing"); - $this->clickAndWait("{$base}submit1"); - $this->assertNotVisible("{$base}validator1", ""); - $this->assertNotVisible("{$base}validator2", ""); + $this->byId("{$base}submit1")->click(); + $this->assertNotVisible("{$base}validator1"); + $this->assertNotVisible("{$base}validator2"); $this->type("{$base}text1" ,""); - $this->click("{$base}check1"); - $this->click("{$base}submit1"); - $this->assertVisible("{$base}validator1", ""); - $this->assertVisible("{$base}validator2", ""); + $this->byId("{$base}check1")->click(); + $this->byId("{$base}submit1")->click(); + $this->assertVisible("{$base}validator1"); + $this->assertVisible("{$base}validator2"); $this->type("{$base}text1", "test"); $this->type("{$base}text2", "123"); - $this->clickAndWait("{$base}submit1"); - $this->assertNotVisible("{$base}validator1", ""); - $this->assertNotVisible("{$base}validator2", ""); + $this->byId("{$base}submit1")->click(); + $this->assertNotVisible("{$base}validator1"); + $this->assertNotVisible("{$base}validator2"); - $this->click("{$base}check1"); + $this->byId("{$base}check1")->click(); $this->type("{$base}text1", ""); $this->type("{$base}text2", ""); - $this->click("{$base}submit1"); - $this->assertVisible("{$base}validator1", ""); - $this->assertNotVisible("{$base}validator2", ""); + $this->byId("{$base}submit1")->click(); + $this->assertVisible("{$base}validator1"); + $this->assertNotVisible("{$base}validator2"); } diff --git a/tests/FunctionalTests/validators/tests/CustomValidatorTestCase.php b/tests/FunctionalTests/validators/tests/CustomValidatorTestCase.php index 106f7a00..ca48a453 100755 --- a/tests/FunctionalTests/validators/tests/CustomValidatorTestCase.php +++ b/tests/FunctionalTests/validators/tests/CustomValidatorTestCase.php @@ -1,18 +1,18 @@ <?php //New Test -class CustomValidatorTestCase extends PradoGenericSeleniumTest +class CustomValidatorTestCase extends PradoGenericSelenium2Test { function test() { $base = "ctl0_Content_"; - $this->open("validators/index.php?page=CustomValidator", ""); - $this->assertTextPresent("Prado CustomValidator Tests", ""); + $this->url("validators/index.php?page=CustomValidator"); + $this->assertContains("Prado CustomValidator Tests", $this->source()); $this->assertNotVisible("{$base}validator1"); - $this->click("//input[@type='submit' and @value='Test']", ""); + $this->byXPath("//input[@type='submit' and @value='Test']")->click(); $this->assertVisible("{$base}validator1"); - + $this->type("{$base}text1", "Prado"); $this->pause(250); $this->assertNotVisible("{$base}validator1"); @@ -22,7 +22,7 @@ class CustomValidatorTestCase extends PradoGenericSeleniumTest $this->type("{$base}text1", "Prado"); $this->pause(250); $this->assertNotVisible("{$base}validator1"); - $this->clickAndWait("//input[@type='submit' and @value='Test']", ""); + $this->byXPath("//input[@type='submit' and @value='Test']")->click(); $this->assertNotVisible("{$base}validator1"); } diff --git a/tests/FunctionalTests/validators/tests/DataTypeValidatorTestCase.php b/tests/FunctionalTests/validators/tests/DataTypeValidatorTestCase.php index 7ec220f0..3b5ebfcb 100755 --- a/tests/FunctionalTests/validators/tests/DataTypeValidatorTestCase.php +++ b/tests/FunctionalTests/validators/tests/DataTypeValidatorTestCase.php @@ -3,16 +3,16 @@ * Created on 25/04/2006 */ -class DataTypeValidatorTestCase extends PradoGenericSeleniumTest +class DataTypeValidatorTestCase extends PradoGenericSelenium2Test { function test() { - $this->setSpeed(500); $base = "ctl0_Content_"; - $this->open("validators/index.php?page=DataTypeValidator", ""); - $this->verifyTextPresent("Data Type Validator Tests", ""); - $this->click("//input[@type='submit' and @value='submit!']", ""); - + $this->url("validators/index.php?page=DataTypeValidator"); + $this->assertContains("Data Type Validator Tests", $this->source()); + $this->byXPath("//input[@type='submit' and @value='submit!']")->click(); + $this->pause(500); + $this->assertNotVisible("{$base}validator1"); $this->assertNotVisible("{$base}validator2"); $this->assertNotVisible("{$base}validator3"); @@ -20,31 +20,32 @@ class DataTypeValidatorTestCase extends PradoGenericSeleniumTest $this->type("{$base}textbox1", "a"); $this->type("{$base}textbox2", "b"); $this->type("{$base}textbox3", "c"); - $this->click("//input[@type='submit' and @value='submit!']", ""); + $this->byXPath("//input[@type='submit' and @value='submit!']")->click(); + $this->pause(500); $this->assertVisible("{$base}validator1"); $this->assertVisible("{$base}validator2"); $this->assertVisible("{$base}validator3"); - + $this->type("{$base}textbox1", "12"); $this->type("{$base}textbox2", "12.5"); $this->type("{$base}textbox3", "2/10/2005"); - $this->clickAndWait("//input[@type='submit' and @value='submit!']", ""); - + $this->byXPath("//input[@type='submit' and @value='submit!']")->click(); + $this->assertNotVisible("{$base}validator1"); $this->assertNotVisible("{$base}validator2"); $this->assertNotVisible("{$base}validator3"); - + $this->type("{$base}textbox1", "12.2"); $this->type("{$base}textbox2", "-12.5"); $this->type("{$base}textbox3", "2/13/2005"); - $this->click("//input[@type='submit' and @value='submit!']", ""); - + $this->byXPath("//input[@type='submit' and @value='submit!']")->click(); + $this->pause(500); + $this->assertVisible("{$base}validator1"); $this->assertNotVisible("{$base}validator2"); $this->assertVisible("{$base}validator3"); - $this->setSpeed(0); } - -} + +} diff --git a/tests/FunctionalTests/validators/tests/DatePickerTestCase.php b/tests/FunctionalTests/validators/tests/DatePickerTestCase.php index e7425a33..953c2f16 100755 --- a/tests/FunctionalTests/validators/tests/DatePickerTestCase.php +++ b/tests/FunctionalTests/validators/tests/DatePickerTestCase.php @@ -1,70 +1,69 @@ <?php -class DatePickerTestCase extends PradoGenericSeleniumTest +class DatePickerTestCase extends PradoGenericSelenium2Test { function test() { $year=2012; $year2=2013; $base = "ctl0_Content_"; - $this->open("validators/index.php?page=DatePicker", ""); - $this->verifyTextPresent("Date Picker validation Test", ""); - $this->assertNotVisible("{$base}validator1", ""); - $this->assertNotVisible("{$base}validator2", ""); - $this->assertNotVisible("{$base}validator4", ""); - $this->assertNotVisible("{$base}validator5", ""); - $this->assertNotVisible("{$base}validator6", ""); - $this->assertNotVisible("{$base}validator8", ""); + $this->url("validators/index.php?page=DatePicker"); + $this->assertContains("Date Picker validation Test", $this->source()); + $this->assertNotVisible("{$base}validator1"); + $this->assertNotVisible("{$base}validator2"); + $this->assertNotVisible("{$base}validator4"); + $this->assertNotVisible("{$base}validator5"); + $this->assertNotVisible("{$base}validator6"); + $this->assertNotVisible("{$base}validator8"); - $this->click("{$base}submit1"); - $this->assertVisible("{$base}validator1", ""); - $this->assertNotVisible("{$base}validator2", ""); + $this->byId("{$base}submit1")->click(); + $this->pause(500); + $this->assertVisible("{$base}validator1"); + $this->assertNotVisible("{$base}validator2"); //the range validator is visible because the date is a drop down list //thus has default value != "" - $this->assertVisible("{$base}validator4", ""); - $this->assertVisible("{$base}validator5", ""); - $this->assertNotVisible("{$base}validator6", ""); - $this->assertVisible("{$base}validator8", ""); + $this->assertVisible("{$base}validator4"); + $this->assertVisible("{$base}validator5"); + $this->assertNotVisible("{$base}validator6"); + $this->assertVisible("{$base}validator8"); - $this->click("{$base}submit1"); - $this->pause(250); $this->type("{$base}picker1", "13/4/$year"); - $this->select("{$base}picker2_month", "label=9"); - $this->select("{$base}picker2_day", "label=10"); - $this->select("{$base}picker2_year", "label=$year"); + $this->select("{$base}picker2_month", "9"); + $this->select("{$base}picker2_day", "10"); + $this->select("{$base}picker2_year", "$year"); $this->pause(250); $this->type("{$base}picker3", "14/4/$year"); $this->pause(250); $this->type("{$base}picker4", "7/4/$year"); - $this->select("{$base}picker5_day", "label=6"); - $this->select("{$base}picker5_month", "label=3"); - $this->select("{$base}picker5_year", "label=$year2"); - $this->select("{$base}picker6_month", "label=3"); - $this->select("{$base}picker6_year", "label=$year2"); - $this->select("{$base}picker6_day", "label=5"); - - $this->click("{$base}submit1"); + $this->select("{$base}picker5_day", "6"); + $this->select("{$base}picker5_month", "3"); + $this->select("{$base}picker5_year", "$year2"); + $this->select("{$base}picker6_month", "3"); + $this->select("{$base}picker6_year", "$year2"); + $this->select("{$base}picker6_day", "5"); + $this->byId("{$base}submit1")->click(); + $this->pause(500); - $this->assertNotVisible("{$base}validator1", ""); - $this->assertVisible("{$base}validator2", ""); - $this->assertNotVisible("{$base}validator4", ""); - $this->assertNotVisible("{$base}validator5", ""); - $this->assertVisible("{$base}validator6", ""); - $this->assertVisible("{$base}validator8", ""); + $this->assertNotVisible("{$base}validator1"); + $this->assertVisible("{$base}validator2"); + $this->assertNotVisible("{$base}validator4"); + $this->assertNotVisible("{$base}validator5"); + $this->assertVisible("{$base}validator6"); + $this->assertVisible("{$base}validator8"); $this->type("{$base}picker1", "20/4/$year2"); $this->type("{$base}picker4", "29/4/$year"); - $this->select("{$base}picker6_day", "label=10"); + $this->select("{$base}picker6_day", "10"); - $this->clickAndWait("{$base}submit1"); + $this->byId("{$base}submit1")->click(); - $this->assertNotVisible("{$base}validator1", ""); - $this->assertNotVisible("{$base}validator2", ""); - $this->assertNotVisible("{$base}validator4", ""); - $this->assertNotVisible("{$base}validator5", ""); - $this->assertNotVisible("{$base}validator6", ""); - $this->assertNotVisible("{$base}validator8", ""); + $this->assertNotVisible("{$base}validator1"); + $this->assertNotVisible("{$base}validator2"); + $this->assertNotVisible("{$base}validator4"); + $this->assertNotVisible("{$base}validator5"); + $this->assertNotVisible("{$base}validator6"); + $this->assertNotVisible("{$base}validator8"); } } diff --git a/tests/FunctionalTests/validators/tests/ImageButtonTestCase.php b/tests/FunctionalTests/validators/tests/ImageButtonTestCase.php index e6b5d6d8..800e36ff 100755 --- a/tests/FunctionalTests/validators/tests/ImageButtonTestCase.php +++ b/tests/FunctionalTests/validators/tests/ImageButtonTestCase.php @@ -1,63 +1,63 @@ <?php -class ImageButtonTestCase extends PradoGenericSeleniumTest +class ImageButtonTestCase extends PradoGenericSelenium2Test { function test() { - $this->open('validators/index.php?page=ImageButton'); + $this->url('validators/index.php?page=ImageButton'); // verify all error messages are invisible - $this->verifyNotVisible('ctl0_Content_ctl0'); - $this->verifyNotVisible('ctl0_Content_ctl2'); - $this->verifyNotVisible('ctl0_Content_ctl4'); + $this->assertNotVisible('ctl0_Content_ctl0'); + $this->assertNotVisible('ctl0_Content_ctl2'); + $this->assertNotVisible('ctl0_Content_ctl4'); // verify the first validator shows the error - $this->click("ctl0_Content_ctl1"); - $this->verifyVisible('ctl0_Content_ctl0'); - $this->verifyNotVisible('ctl0_Content_ctl2'); - $this->verifyNotVisible('ctl0_Content_ctl4'); + $this->byId("ctl0_Content_ctl1")->click(); + $this->assertVisible('ctl0_Content_ctl0'); + $this->assertNotVisible('ctl0_Content_ctl2'); + $this->assertNotVisible('ctl0_Content_ctl4'); // verify the first validation is passed $this->pause(500); - $this->verifyTextNotPresent('Button1 is clicked'); + $this->assertNotContains('Button1 is clicked', $this->source()); $this->type("ctl0_Content_TextBox1", "test"); - $this->clickAndWait("ctl0_Content_ctl1"); - $this->verifyNotVisible('ctl0_Content_ctl0'); - $this->verifyNotVisible('ctl0_Content_ctl2'); - $this->verifyNotVisible('ctl0_Content_ctl4'); - $this->verifyTextPresent('Button1 is clicked and valid'); + $this->byId("ctl0_Content_ctl1")->click(); + $this->assertNotVisible('ctl0_Content_ctl0'); + $this->assertNotVisible('ctl0_Content_ctl2'); + $this->assertNotVisible('ctl0_Content_ctl4'); + $this->assertContains('Button1 is clicked and valid', $this->source()); // verify the second validator shows the error - $this->click("ctl0_Content_ctl3"); - $this->verifyNotVisible('ctl0_Content_ctl0'); - $this->verifyVisible('ctl0_Content_ctl2'); - $this->verifyNotVisible('ctl0_Content_ctl4'); + $this->byId("ctl0_Content_ctl3")->click(); + $this->assertNotVisible('ctl0_Content_ctl0'); + $this->assertVisible('ctl0_Content_ctl2'); + $this->assertNotVisible('ctl0_Content_ctl4'); // verify the second validation is passed $this->pause(500); - $this->verifyTextNotPresent('Button2 is clicked'); + $this->assertNotContains('Button2 is clicked', $this->source()); $this->type("ctl0_Content_TextBox2", "test"); - $this->clickAndWait("ctl0_Content_ctl3"); - $this->verifyNotVisible('ctl0_Content_ctl0'); - $this->verifyNotVisible('ctl0_Content_ctl2'); - $this->verifyNotVisible('ctl0_Content_ctl4'); - $this->verifyTextPresent('Button2 is clicked and valid'); + $this->byId("ctl0_Content_ctl3")->click(); + $this->assertNotVisible('ctl0_Content_ctl0'); + $this->assertNotVisible('ctl0_Content_ctl2'); + $this->assertNotVisible('ctl0_Content_ctl4'); + $this->assertContains('Button2 is clicked and valid', $this->source()); // verify the third validator shows the error - $this->clickAndWait("ctl0_Content_ctl5"); - $this->verifyNotVisible('ctl0_Content_ctl0'); - $this->verifyNotVisible('ctl0_Content_ctl2'); - $this->verifyVisible('ctl0_Content_ctl4'); + $this->byId("ctl0_Content_ctl5")->click(); + $this->assertNotVisible('ctl0_Content_ctl0'); + $this->assertNotVisible('ctl0_Content_ctl2'); + $this->assertVisible('ctl0_Content_ctl4'); // verify the third validation is passed - $this->verifyTextPresent('Button3 is clicked'); - $this->verifyTextNotPresent('Button3 is clicked and valid'); + $this->assertContains('Button3 is clicked', $this->source()); + $this->assertNotContains('Button3 is clicked and valid', $this->source()); $this->type("ctl0_Content_TextBox3", "test"); - $this->clickAndWait("ctl0_Content_ctl5"); - $this->verifyNotVisible('ctl0_Content_ctl0'); - $this->verifyNotVisible('ctl0_Content_ctl2'); - $this->verifyNotVisible('ctl0_Content_ctl4'); - $this->verifyTextPresent('Button3 is clicked and valid'); + $this->byId("ctl0_Content_ctl5")->click(); + $this->assertNotVisible('ctl0_Content_ctl0'); + $this->assertNotVisible('ctl0_Content_ctl2'); + $this->assertNotVisible('ctl0_Content_ctl4'); + $this->assertContains('Button3 is clicked and valid', $this->source()); } } diff --git a/tests/FunctionalTests/validators/tests/LinkButtonTestCase.php b/tests/FunctionalTests/validators/tests/LinkButtonTestCase.php index b523452c..394556e9 100755 --- a/tests/FunctionalTests/validators/tests/LinkButtonTestCase.php +++ b/tests/FunctionalTests/validators/tests/LinkButtonTestCase.php @@ -1,62 +1,62 @@ <?php -class LinkButtonTestCase extends PradoGenericSeleniumTest +class LinkButtonTestCase extends PradoGenericSelenium2Test { function test() { - $this->open('validators/index.php?page=LinkButton'); + $this->url('validators/index.php?page=LinkButton'); // verify all error messages are invisible - $this->verifyNotVisible('ctl0_Content_ctl0'); - $this->verifyNotVisible('ctl0_Content_ctl2'); - $this->verifyNotVisible('ctl0_Content_ctl4'); + $this->assertNotVisible('ctl0_Content_ctl0'); + $this->assertNotVisible('ctl0_Content_ctl2'); + $this->assertNotVisible('ctl0_Content_ctl4'); // verify the first validator shows the error - $this->click("ctl0_Content_ctl1"); - $this->verifyVisible('ctl0_Content_ctl0'); - $this->verifyNotVisible('ctl0_Content_ctl2'); - $this->verifyNotVisible('ctl0_Content_ctl4'); + $this->byId("ctl0_Content_ctl1")->click(); + $this->assertVisible('ctl0_Content_ctl0'); + $this->assertNotVisible('ctl0_Content_ctl2'); + $this->assertNotVisible('ctl0_Content_ctl4'); // verify the first validation is passed $this->pause(500); - $this->verifyTextNotPresent('Button1 is clicked'); + $this->assertNotContains('Button1 is clicked', $this->source()); $this->type("ctl0_Content_TextBox1", "test"); - $this->clickAndWait("ctl0_Content_ctl1"); - $this->verifyNotVisible('ctl0_Content_ctl0'); - $this->verifyNotVisible('ctl0_Content_ctl2'); - $this->verifyNotVisible('ctl0_Content_ctl4'); - $this->verifyTextPresent('Button1 is clicked and valid'); + $this->byId("ctl0_Content_ctl1")->click(); + $this->assertNotVisible('ctl0_Content_ctl0'); + $this->assertNotVisible('ctl0_Content_ctl2'); + $this->assertNotVisible('ctl0_Content_ctl4'); + $this->assertContains('Button1 is clicked and valid', $this->source()); // verify the second validator shows the error - $this->click("ctl0_Content_ctl3"); - $this->verifyNotVisible('ctl0_Content_ctl0'); - $this->verifyVisible('ctl0_Content_ctl2'); - $this->verifyNotVisible('ctl0_Content_ctl4'); + $this->byId("ctl0_Content_ctl3")->click(); + $this->assertNotVisible('ctl0_Content_ctl0'); + $this->assertVisible('ctl0_Content_ctl2'); + $this->assertNotVisible('ctl0_Content_ctl4'); // verify the second validation is passed $this->pause(500); - $this->verifyTextNotPresent('Button2 is clicked'); + $this->assertNotContains('Button2 is clicked', $this->source()); $this->type("ctl0_Content_TextBox2", "test"); - $this->clickAndWait("ctl0_Content_ctl3"); - $this->verifyNotVisible('ctl0_Content_ctl0'); - $this->verifyNotVisible('ctl0_Content_ctl2'); - $this->verifyNotVisible('ctl0_Content_ctl4'); - $this->verifyTextPresent('Button2 is clicked and valid'); + $this->byId("ctl0_Content_ctl3")->click(); + $this->assertNotVisible('ctl0_Content_ctl0'); + $this->assertNotVisible('ctl0_Content_ctl2'); + $this->assertNotVisible('ctl0_Content_ctl4'); + $this->assertContains('Button2 is clicked and valid', $this->source()); // verify the third validator shows the error - $this->clickAndWait("ctl0_Content_ctl5"); - $this->verifyNotVisible('ctl0_Content_ctl0'); - $this->verifyNotVisible('ctl0_Content_ctl2'); - $this->verifyVisible('ctl0_Content_ctl4'); + $this->byId("ctl0_Content_ctl5")->click(); + $this->assertNotVisible('ctl0_Content_ctl0'); + $this->assertNotVisible('ctl0_Content_ctl2'); + $this->assertVisible('ctl0_Content_ctl4'); // verify the third validation is passed - $this->verifyTextPresent('Button3 is clicked'); - $this->verifyTextNotPresent('Button3 is clicked and valid'); + $this->assertContains('Button3 is clicked', $this->source()); + $this->assertNotContains('Button3 is clicked and valid', $this->source()); $this->type("ctl0_Content_TextBox3", "test"); - $this->clickAndWait("ctl0_Content_ctl5"); - $this->verifyNotVisible('ctl0_Content_ctl0'); - $this->verifyNotVisible('ctl0_Content_ctl2'); - $this->verifyNotVisible('ctl0_Content_ctl4'); - $this->verifyTextPresent('Button3 is clicked and valid'); + $this->byId("ctl0_Content_ctl5")->click(); + $this->assertNotVisible('ctl0_Content_ctl0'); + $this->assertNotVisible('ctl0_Content_ctl2'); + $this->assertNotVisible('ctl0_Content_ctl4'); + $this->assertContains('Button3 is clicked and valid', $this->source()); } } diff --git a/tests/FunctionalTests/validators/tests/ListControlTestCase.php b/tests/FunctionalTests/validators/tests/ListControlTestCase.php index 68feee84..55e370c5 100755 --- a/tests/FunctionalTests/validators/tests/ListControlTestCase.php +++ b/tests/FunctionalTests/validators/tests/ListControlTestCase.php @@ -3,38 +3,39 @@ * Created on 24/04/2006 */ -class ListControlTestCase extends PradoGenericSeleniumTest +class ListControlTestCase extends PradoGenericSelenium2Test { function test() { $base = "ctl0_Content_"; - $this->open("validators/index.php?page=ListControl", ""); - $this->verifyTextPresent("List Control Required Field Validation Test", ""); - $this->click("//input[@type='submit' and @value='Submit!']", ""); + $this->url("validators/index.php?page=ListControl"); + $this->assertContains("List Control Required Field Validation Test", $this->source()); + $this->byXPath("//input[@type='submit' and @value='Submit!']")->click(); $this->assertVisible("{$base}validator1"); $this->assertVisible("{$base}validator2"); $this->assertVisible("{$base}validator3"); $this->assertVisible("{$base}validator4"); - $this->click("//input[@id='{$base}list1_c1' and @value='Red']", ""); - $this->select("{$base}list2", "label=Red"); - $this->select("{$base}list3", "label=Blue"); - $this->click("{$base}list4_c3", ""); - $this->clickAndWait("//input[@type='submit' and @value='Submit!']", ""); + $this->byXPath("//input[@id='{$base}list1_c1' and @value='Red']")->click(); + $this->select("{$base}list2", "Red"); + $this->select("{$base}list3", "Blue"); + $this->byId("{$base}list4_c3")->click(); + $this->byXPath("//input[@type='submit' and @value='Submit!']")->click(); $this->assertNotVisible("{$base}validator1"); $this->assertNotVisible("{$base}validator2"); $this->assertNotVisible("{$base}validator3"); $this->assertNotVisible("{$base}validator4"); - $this->select("{$base}list3", "label=Don't select this one"); - $this->click("{$base}list4_c0"); - $this->select("{$base}list2", "label=--- Select a color ---"); - $this->click("//input[@type='submit' and @value='Submit!']", ""); - $this->click("//input[@id='{$base}list1_c1' and @value='Red']", ""); - $this->click("//input[@id='{$base}list1_c0' and @value='Select a color below']", ""); - $this->click("//input[@type='submit' and @value='Submit!']", ""); + //invalid selector: Unable to locate an element with the xpath expression .//option[.='Don\'t select this one'] because of the following error: SyntaxError: Failed to execute 'evaluate' on 'Document': The string './/option[.='Don\'t select this one']' is not a valid XPath expression. + $this->select("{$base}list3", "Dont select this one"); + $this->byId("{$base}list4_c0")->click(); + $this->select("{$base}list2", "--- Select a color ---"); + $this->byXPath("//input[@type='submit' and @value='Submit!']")->click(); + $this->byXPath("//input[@id='{$base}list1_c1' and @value='Red']")->click(); + $this->byXPath("//input[@id='{$base}list1_c0' and @value='Select a color below']")->click(); + $this->byXPath("//input[@type='submit' and @value='Submit!']")->click(); $this->assertVisible("{$base}validator1"); $this->assertVisible("{$base}validator2"); diff --git a/tests/FunctionalTests/validators/tests/RangeValidatorTestCase.php b/tests/FunctionalTests/validators/tests/RangeValidatorTestCase.php index 022ee7f6..485c6a24 100755 --- a/tests/FunctionalTests/validators/tests/RangeValidatorTestCase.php +++ b/tests/FunctionalTests/validators/tests/RangeValidatorTestCase.php @@ -1,166 +1,166 @@ <?php //New Test -class RangeValidatorTestCase extends PradoGenericSeleniumTest +class RangeValidatorTestCase extends PradoGenericSelenium2Test { function testIntegerRange() { $base = "ctl0_Content_"; - $this->open("validators/index.php?page=RangeValidatorInteger", ""); - $this->verifyTextPresent("Prado RangeValidator Tests Integer", ""); - + $this->url("validators/index.php?page=RangeValidatorInteger"); + $this->assertContains("Prado RangeValidator Tests Integer", $this->source()); + //between 1 and 4 $this->type("{$base}text1", "ad"); - $this->assertNotVisible("{$base}validator1", ""); - $this->click("//input[@type='submit' and @value='Test']", ""); - $this->assertVisible("{$base}validator1", ""); + $this->assertNotVisible("{$base}validator1"); + $this->byXPath("//input[@type='submit' and @value='Test']")->click(); + $this->assertVisible("{$base}validator1"); $this->type("{$base}text1", "12"); - $this->click("//input[@type='submit' and @value='Test']", ""); - $this->assertVisible("{$base}validator1", ""); + $this->byXPath("//input[@type='submit' and @value='Test']")->click(); + $this->assertVisible("{$base}validator1"); $this->type("{$base}text1", "2"); - $this->assertNotVisible("{$base}validator1", ""); - $this->clickAndWait("//input[@type='submit' and @value='Test']", ""); - $this->assertNotVisible("{$base}validator1", ""); - - + $this->assertNotVisible("{$base}validator1"); + $this->byXPath("//input[@type='submit' and @value='Test']")->click(); + $this->assertNotVisible("{$base}validator1"); + + // >= 2 - $this->assertNotVisible("{$base}validator2", ""); + $this->assertNotVisible("{$base}validator2"); $this->type("{$base}text2", "1"); - $this->click("//input[@type='submit' and @value='Test']", ""); - $this->assertVisible("{$base}validator2", ""); + $this->byXPath("//input[@type='submit' and @value='Test']")->click(); + $this->assertVisible("{$base}validator2"); $this->type("{$base}text2", "10"); - $this->clickAndWait("//input[@type='submit' and @value='Test']", ""); - $this->assertNotVisible("{$base}validator2", ""); + $this->byXPath("//input[@type='submit' and @value='Test']")->click(); + $this->assertNotVisible("{$base}validator2"); // <= 20 - $this->assertNotVisible("{$base}validator3", ""); + $this->assertNotVisible("{$base}validator3"); $this->type("{$base}text3", "100"); - $this->click("//input[@type='submit' and @value='Test']", ""); - $this->assertVisible("{$base}validator3", ""); + $this->byXPath("//input[@type='submit' and @value='Test']")->click(); + $this->assertVisible("{$base}validator3"); $this->type("{$base}text3", "10"); - $this->clickAndWait("//input[@type='submit' and @value='Test']", ""); - $this->assertNotVisible("{$base}validator3", ""); + $this->byXPath("//input[@type='submit' and @value='Test']")->click(); + $this->assertNotVisible("{$base}validator3"); } - + function testFloatRange() { $base = "ctl0_Content_"; - $this->open("validators/index.php?page=RangeValidatorFloat", ""); - $this->verifyTextPresent("Prado RangeValidator Tests Float", ""); - + $this->url("validators/index.php?page=RangeValidatorFloat"); + $this->assertContains("Prado RangeValidator Tests Float", $this->source()); + //between 1 and 4 $this->type("{$base}text1", "ad"); - $this->assertNotVisible("{$base}validator1", ""); - $this->click("//input[@type='submit' and @value='Test']", ""); - $this->assertVisible("{$base}validator1", ""); + $this->assertNotVisible("{$base}validator1"); + $this->byXPath("//input[@type='submit' and @value='Test']")->click(); + $this->assertVisible("{$base}validator1"); $this->type("{$base}text1", "12"); - $this->click("//input[@type='submit' and @value='Test']", ""); - $this->assertVisible("{$base}validator1", ""); + $this->byXPath("//input[@type='submit' and @value='Test']")->click(); + $this->assertVisible("{$base}validator1"); $this->type("{$base}text1", "2"); - $this->assertNotVisible("{$base}validator1", ""); - $this->clickAndWait("//input[@type='submit' and @value='Test']", ""); - $this->assertNotVisible("{$base}validator1", ""); - - + $this->assertNotVisible("{$base}validator1"); + $this->byXPath("//input[@type='submit' and @value='Test']")->click(); + $this->assertNotVisible("{$base}validator1"); + + // >= 2 - $this->assertNotVisible("{$base}validator2", ""); + $this->assertNotVisible("{$base}validator2"); $this->type("{$base}text2", "1"); - $this->click("//input[@type='submit' and @value='Test']", ""); - $this->assertVisible("{$base}validator2", ""); + $this->byXPath("//input[@type='submit' and @value='Test']")->click(); + $this->assertVisible("{$base}validator2"); $this->type("{$base}text2", "10"); - $this->clickAndWait("//input[@type='submit' and @value='Test']", ""); - $this->assertNotVisible("{$base}validator2", ""); + $this->byXPath("//input[@type='submit' and @value='Test']")->click(); + $this->assertNotVisible("{$base}validator2"); // <= 20 - $this->assertNotVisible("{$base}validator3", ""); + $this->assertNotVisible("{$base}validator3"); $this->type("{$base}text3", "100"); - $this->click("//input[@type='submit' and @value='Test']", ""); - $this->assertVisible("{$base}validator3", ""); + $this->byXPath("//input[@type='submit' and @value='Test']")->click(); + $this->assertVisible("{$base}validator3"); $this->type("{$base}text3", "10"); - $this->clickAndWait("//input[@type='submit' and @value='Test']", ""); - $this->assertNotVisible("{$base}validator3", ""); + $this->byXPath("//input[@type='submit' and @value='Test']")->click(); + $this->assertNotVisible("{$base}validator3"); } - + function testDateRange() { $base = "ctl0_Content_"; - $this->open("validators/index.php?page=RangeValidatorDate", ""); - $this->verifyTextPresent("Prado RangeValidator Tests Date", ""); - + $this->url("validators/index.php?page=RangeValidatorDate"); + $this->assertContains("Prado RangeValidator Tests Date", $this->source()); + //between 22/1/2005 and 3/2/2005 $this->type("{$base}text1", "ad"); - $this->assertNotVisible("{$base}validator1", ""); - $this->click("//input[@type='submit' and @value='Test']", ""); - $this->assertVisible("{$base}validator1", ""); + $this->assertNotVisible("{$base}validator1"); + $this->byXPath("//input[@type='submit' and @value='Test']")->click(); + $this->assertVisible("{$base}validator1"); $this->type("{$base}text1", "27/2/2005"); - $this->click("//input[@type='submit' and @value='Test']", ""); - $this->assertVisible("{$base}validator1", ""); + $this->byXPath("//input[@type='submit' and @value='Test']")->click(); + $this->assertVisible("{$base}validator1"); $this->type("{$base}text1", "1/2/2005"); - $this->clickAndWait("//input[@type='submit' and @value='Test']", ""); - $this->assertNotVisible("{$base}validator1", ""); - $this->clickAndWait("//input[@type='submit' and @value='Test']", ""); - $this->assertNotVisible("{$base}validator1", ""); - - + $this->byXPath("//input[@type='submit' and @value='Test']")->click(); + $this->assertNotVisible("{$base}validator1"); + $this->byXPath("//input[@type='submit' and @value='Test']")->click(); + $this->assertNotVisible("{$base}validator1"); + + // >= 22/1/2005 - $this->assertNotVisible("{$base}validator2", ""); + $this->assertNotVisible("{$base}validator2"); $this->type("{$base}text2", "1/1/2005"); - $this->click("//input[@type='submit' and @value='Test']", ""); + $this->byXPath("//input[@type='submit' and @value='Test']")->click(); $this->pause(250); - $this->assertVisible("{$base}validator2", ""); + $this->assertVisible("{$base}validator2"); $this->type("{$base}text2", "1/4/2005"); - $this->clickAndWait("//input[@type='submit' and @value='Test']", ""); - $this->assertNotVisible("{$base}validator2", ""); + $this->byXPath("//input[@type='submit' and @value='Test']")->click(); + $this->assertNotVisible("{$base}validator2"); // <= 3/2/2005 - $this->assertNotVisible("{$base}validator3", ""); + $this->assertNotVisible("{$base}validator3"); $this->type("{$base}text3", "4/5/2005"); - $this->click("//input[@type='submit' and @value='Test']", ""); + $this->byXPath("//input[@type='submit' and @value='Test']")->click(); $this->pause(250); - $this->assertVisible("{$base}validator3", ""); + $this->assertVisible("{$base}validator3"); $this->type("{$base}text3", "1/2/2005"); - $this->clickAndWait("//input[@type='submit' and @value='Test']", ""); - $this->assertNotVisible("{$base}validator3", ""); - } - + $this->byXPath("//input[@type='submit' and @value='Test']")->click(); + $this->assertNotVisible("{$base}validator3"); + } + function testStringRange() { $base = "ctl0_Content_"; - $this->open("validators/index.php?page=RangeValidatorString", ""); - $this->verifyTextPresent("Prado RangeValidator Tests String", ""); - + $this->url("validators/index.php?page=RangeValidatorString"); + $this->assertContains("Prado RangeValidator Tests String", $this->source()); + //between 'd' and 'y' $this->type("{$base}text1", "a"); - $this->assertNotVisible("{$base}validator1", ""); - $this->click("//input[@type='submit' and @value='Test']", ""); - $this->assertVisible("{$base}validator1", ""); + $this->assertNotVisible("{$base}validator1"); + $this->byXPath("//input[@type='submit' and @value='Test']")->click(); + $this->assertVisible("{$base}validator1"); $this->type("{$base}text1", "b"); - $this->click("//input[@type='submit' and @value='Test']", ""); - $this->assertVisible("{$base}validator1", ""); + $this->byXPath("//input[@type='submit' and @value='Test']")->click(); + $this->assertVisible("{$base}validator1"); $this->type("{$base}text1", "f"); - $this->assertNotVisible("{$base}validator1", ""); - $this->clickAndWait("//input[@type='submit' and @value='Test']", ""); - $this->assertNotVisible("{$base}validator1", ""); - - + $this->assertNotVisible("{$base}validator1"); + $this->byXPath("//input[@type='submit' and @value='Test']")->click(); + $this->assertNotVisible("{$base}validator1"); + + // >= 'd' - $this->assertNotVisible("{$base}validator2", ""); + $this->assertNotVisible("{$base}validator2"); $this->type("{$base}text2", "a"); - $this->click("//input[@type='submit' and @value='Test']", ""); - $this->assertVisible("{$base}validator2", ""); + $this->byXPath("//input[@type='submit' and @value='Test']")->click(); + $this->assertVisible("{$base}validator2"); $this->type("{$base}text2", "g"); - $this->clickAndWait("//input[@type='submit' and @value='Test']", ""); - $this->assertNotVisible("{$base}validator2", ""); + $this->byXPath("//input[@type='submit' and @value='Test']")->click(); + $this->assertNotVisible("{$base}validator2"); // <= 'y' - $this->assertNotVisible("{$base}validator3", ""); + $this->assertNotVisible("{$base}validator3"); $this->type("{$base}text3", "z"); - $this->click("//input[@type='submit' and @value='Test']", ""); - $this->assertVisible("{$base}validator3", ""); + $this->byXPath("//input[@type='submit' and @value='Test']")->click(); + $this->assertVisible("{$base}validator3"); $this->type("{$base}text3", "t"); - $this->clickAndWait("//input[@type='submit' and @value='Test']", ""); - $this->assertNotVisible("{$base}validator3", ""); - } + $this->byXPath("//input[@type='submit' and @value='Test']")->click(); + $this->assertNotVisible("{$base}validator3"); + } } diff --git a/tests/FunctionalTests/validators/tests/RegExpValidatorTestCase.php b/tests/FunctionalTests/validators/tests/RegExpValidatorTestCase.php index f269bf3b..ffa30126 100755 --- a/tests/FunctionalTests/validators/tests/RegExpValidatorTestCase.php +++ b/tests/FunctionalTests/validators/tests/RegExpValidatorTestCase.php @@ -1,32 +1,32 @@ <?php //New Test -class RegExpValidatorTestCase extends PradoGenericSeleniumTest +class RegExpValidatorTestCase extends PradoGenericSelenium2Test { function test() { $base = "ctl0_Content_"; - $this->open("validators/index.php?page=RegularExpressionValidator", ""); - $this->verifyTextPresent("Prado RegularExpressionValidator Tests", ""); - $this->assertNotVisible("{$base}validator1", ""); - $this->assertNotVisible("{$base}validator2", ""); + $this->url("validators/index.php?page=RegularExpressionValidator"); + $this->assertContains("Prado RegularExpressionValidator Tests", $this->source()); + $this->assertNotVisible("{$base}validator1"); + $this->assertNotVisible("{$base}validator2"); $this->type("{$base}text1", "1"); $this->type("{$base}text2", "2"); - $this->click("//input[@type='submit' and @value='Test']", ""); - $this->assertVisible("{$base}validator1", ""); - $this->assertVisible("{$base}validator2", ""); + $this->byXPath("//input[@type='submit' and @value='Test']")->click(); + $this->assertVisible("{$base}validator1"); + $this->assertVisible("{$base}validator2"); $this->type("{$base}text1", "asdasd"); - $this->click("//input[@type='submit' and @value='Test']", ""); - $this->assertVisible("{$base}validator1", ""); + $this->byXPath("//input[@type='submit' and @value='Test']")->click(); + $this->assertVisible("{$base}validator1"); $this->type("{$base}text1", "12345"); - $this->assertNotVisible("{$base}validator1", ""); - $this->assertVisible("{$base}validator2", ""); + $this->assertNotVisible("{$base}validator1"); + $this->assertVisible("{$base}validator2"); $this->type("{$base}text2", "wei@gmail.com"); - $this->assertNotVisible("{$base}validator1", ""); - $this->assertNotVisible("{$base}validator2", ""); - $this->clickAndWait("//input[@type='submit' and @value='Test']", ""); - $this->assertNotVisible("{$base}validator1", ""); - $this->assertNotVisible("{$base}validator2", ""); + $this->assertNotVisible("{$base}validator1"); + $this->assertNotVisible("{$base}validator2"); + $this->byXPath("//input[@type='submit' and @value='Test']")->click(); + $this->assertNotVisible("{$base}validator1"); + $this->assertNotVisible("{$base}validator2"); } } diff --git a/tests/FunctionalTests/validators/tests/RequiredFieldTestCase.php b/tests/FunctionalTests/validators/tests/RequiredFieldTestCase.php index f8b54eb0..e868155c 100755 --- a/tests/FunctionalTests/validators/tests/RequiredFieldTestCase.php +++ b/tests/FunctionalTests/validators/tests/RequiredFieldTestCase.php @@ -1,54 +1,54 @@ <?php -class RequiredFieldTestCase extends PradoGenericSeleniumTest +class RequiredFieldTestCase extends PradoGenericSelenium2Test { function test() { $base = "ctl0_Content_"; - $this->open("validators/index.php?page=RequiredFieldValidator"); - $this->assertTextPresent("RequiredFieldValidator Tests"); + $this->url("validators/index.php?page=RequiredFieldValidator"); + $this->assertContains("RequiredFieldValidator Tests", $this->source()); $this->assertNotVisible("{$base}validator1"); $this->assertNotVisible("{$base}validator2"); - $this->click("{$base}submit1"); + $this->byId("{$base}submit1")->click(); $this->assertVisible("{$base}validator1"); $this->assertVisible("{$base}validator2"); $this->type("{$base}text1", "testing"); - $this->click("{$base}submit1"); + $this->byId("{$base}submit1")->click(); $this->assertNotVisible("{$base}validator1"); - $this->click("{$base}submit2"); + $this->byId("{$base}submit2")->click(); $this->assertNotVisible("{$base}validator1"); - $this->assertNotVisible("{$base}validator2"); + $this->assertVisible("{$base}validator2"); $this->assertVisible("{$base}validator3"); $this->assertVisible("{$base}validator4"); $this->type("{$base}text2", "testing2"); - $this->click("{$base}submit2"); + $this->byId("{$base}submit2")->click(); $this->assertNotVisible("{$base}validator3"); - $this->click("{$base}submit3"); + $this->byId("{$base}submit3")->click(); $this->assertVisible("{$base}summary3"); - $this->clickAndWait("{$base}submit4"); + $this->byId("{$base}submit4")->click(); $this->assertNotVisible("{$base}validator1"); $this->assertNotVisible("{$base}validator2"); $this->assertNotVisible("{$base}validator3"); $this->assertNotVisible("{$base}validator4"); - $this->click("{$base}submit1"); + $this->byId("{$base}submit1")->click(); $this->assertVisible("{$base}validator2"); - $this->click("{$base}check1"); - $this->click("{$base}submit2"); + $this->byId("{$base}check1")->click(); + $this->byId("{$base}submit2")->click(); $this->assertVisible("{$base}validator4"); - $this->clickAndWait("{$base}submit1"); + $this->byId("{$base}submit1")->click(); $this->assertNotVisible("{$base}validator1"); $this->assertNotVisible("{$base}validator2"); $this->type("{$base}text1"); - $this->click("{$base}check1"); - $this->click("{$base}submit1"); + $this->byId("{$base}check1")->click(); + $this->byId("{$base}submit1")->click(); $this->assertVisible("{$base}validator1"); $this->assertVisible("{$base}validator2"); - $this->click("{$base}check2"); - $this->clickAndWait("{$base}submit2"); + $this->byId("{$base}check2")->click(); + $this->byId("{$base}submit2")->click(); $this->type("{$base}text1", "Hello"); - $this->click("{$base}check1"); - $this->click("{$base}submit2"); + $this->byId("{$base}check1")->click(); + $this->byId("{$base}submit2")->click(); $this->assertNotVisible("{$base}validator5"); $this->assertNotVisible("{$base}validator6"); @@ -56,14 +56,14 @@ class RequiredFieldTestCase extends PradoGenericSeleniumTest $this->assertNotVisible("{$base}validator8"); $this->type("{$base}text1"); $this->type("{$base}text2"); - $this->click("{$base}check1"); - $this->click("{$base}check2"); - $this->click("{$base}submit3"); + $this->byId("{$base}check1")->click(); + $this->byId("{$base}check2")->click(); + $this->byId("{$base}submit3")->click(); $this->assertVisible("{$base}validator5"); $this->assertVisible("{$base}validator6"); $this->assertVisible("{$base}validator7"); $this->assertVisible("{$base}validator8"); - $this->clickAndWait("{$base}submit4"); + $this->byId("{$base}submit4")->click(); $this->assertNotVisible("{$base}validator5"); $this->assertNotVisible("{$base}validator6"); $this->assertNotVisible("{$base}validator7"); @@ -73,10 +73,10 @@ class RequiredFieldTestCase extends PradoGenericSeleniumTest function testInitialValue() { $base = "ctl0_Content_"; - $this->open("validators/index.php?page=RequiredFieldValidator"); - $this->assertTextPresent("InitialValue Test"); + $this->url("validators/index.php?page=RequiredFieldValidator"); + $this->assertContains("InitialValue Test", $this->source()); $this->assertNotVisible("{$base}validator9"); - $this->click("{$base}submit5"); + $this->byId("{$base}submit5")->click(); $this->pause(250); $this->assertVisible("{$base}validator9"); $this->type("{$base}text5", "adasd"); diff --git a/tests/FunctionalTests/validators/tests/RequiredListTestCase.php b/tests/FunctionalTests/validators/tests/RequiredListTestCase.php index 2662c721..0de6815e 100755 --- a/tests/FunctionalTests/validators/tests/RequiredListTestCase.php +++ b/tests/FunctionalTests/validators/tests/RequiredListTestCase.php @@ -1,35 +1,35 @@ <?php -class RequiredListTestCase extends PradoGenericSeleniumTest +class RequiredListTestCase extends PradoGenericSelenium2Test { function test() { $base = "ctl0_Content_"; - $this->open("validators/index.php?page=RequiredListValidator"); - $this->click("{$base}submit1"); + $this->url("validators/index.php?page=RequiredListValidator"); + $this->byId("{$base}submit1")->click(); $this->assertVisible("{$base}validator1"); $this->assertVisible("{$base}validator2"); $this->assertVisible("{$base}validator3"); - $this->click("{$base}list1_c0"); - $this->addSelection("{$base}list2", "label=One"); - $this->addSelection("{$base}list2", "label=Two"); - $this->click("{$base}list3_c3"); - $this->clickAndWait("{$base}submit1"); + $this->byId("{$base}list1_c0")->click(); + $this->addSelection("{$base}list2", "One"); + $this->addSelection("{$base}list2", "Two"); + $this->byId("{$base}list3_c3")->click(); + $this->byId("{$base}submit1")->click(); $this->assertNotVisible("{$base}validator1"); $this->assertNotVisible("{$base}validator2"); $this->assertNotVisible("{$base}validator3"); - $this->click("{$base}list1_c1"); - $this->click("{$base}list1_c2"); - $this->click("{$base}list1_c3"); - $this->addSelection("{$base}list2", "label=Two"); - $this->click("{$base}list1_c3"); - $this->clickAndWait("{$base}submit1"); + $this->byId("{$base}list1_c1")->click(); + $this->byId("{$base}list1_c2")->click(); + $this->byId("{$base}list1_c3")->click(); + $this->addSelection("{$base}list2", "Two"); + $this->byId("{$base}list1_c3")->click(); + $this->byId("{$base}submit1")->click(); $this->assertNotVisible("{$base}validator1"); $this->assertNotVisible("{$base}validator2"); $this->assertNotVisible("{$base}validator3"); - $this->click("{$base}list3_c3"); - $this->clickAndWait("{$base}submit1"); + $this->byId("{$base}list3_c3")->click(); + $this->byId("{$base}submit1")->click(); $this->pause(200); $this->assertNotVisible("{$base}validator1"); $this->assertNotVisible("{$base}validator2"); diff --git a/tests/FunctionalTests/validators/tests/ValidationSummaryTestCase.php b/tests/FunctionalTests/validators/tests/ValidationSummaryTestCase.php index 7dc1d6b1..d4c44a34 100755 --- a/tests/FunctionalTests/validators/tests/ValidationSummaryTestCase.php +++ b/tests/FunctionalTests/validators/tests/ValidationSummaryTestCase.php @@ -1,46 +1,46 @@ <?php //New Test -class ValidationSummaryTestCase extends PradoGenericSeleniumTest +class ValidationSummaryTestCase extends PradoGenericSelenium2Test { function test() { $base = "ctl0_Content_"; - - $this->open("validators/index.php?page=ValidationSummary", ""); - $this->verifyTextPresent("Validation Summary Test", ""); - //$this->verifyText("{$base}summary1", ""); - //$this->verifyText("{$base}summary2", ""); - - $this->click("//input[@type='submit' and @value='Create New Account']", ""); + + $this->url("validators/index.php?page=ValidationSummary"); + $this->assertContains("Validation Summary Test", $this->source()); + //$this->assertText("{$base}summary1", ""); + //$this->assertText("{$base}summary2", ""); + + $this->byXPath("//input[@type='submit' and @value='Create New Account']")->click(); $this->assertVisible("{$base}summary1"); $this->assertNotVisible("{$base}summary2"); - $this->click("//input[@type='submit' and @value='Sign In']", ""); + $this->byXPath("//input[@type='submit' and @value='Sign In']")->click(); $this->assertNotVisible("{$base}summary1"); - $this->assertVisible("{$base}summary2"); - + $this->assertVisible("{$base}summary2"); + $this->type("{$base}Username", "qwe"); $this->type("{$base}Password", "ewwq"); - $this->click("//input[@type='submit' and @value='Sign In']", ""); + $this->byXPath("//input[@type='submit' and @value='Sign In']")->click(); $this->assertNotVisible("{$base}summary1"); - $this->assertVisible("{$base}summary2"); - - /*$this->clickAndWait("//input[@type='submit' and @value='Create New Account']", ""); + $this->assertVisible("{$base}summary2"); + + /*$this->byXPath("//input[@type='submit' and @value='Create New Account']")->click(); $this->type("{$base}UserID", "123"); $this->type("{$base}Pass", "123"); - $this->clickAndWait("//input[@type='submit' and @value='Sign In']", ""); - //$this->verifyText("{$base}summary1", ""); - //$this->verifyText("{$base}summary2", ""); - $this->clickAndWait("//input[@type='submit' and @value='Create New Account']", ""); - //$this->verifyText("{$base}summary1", ""); - //$this->verifyText("{$base}summary2", ""); + $this->byXPath("//input[@type='submit' and @value='Sign In']")->click(); + //$this->assertText("{$base}summary1", ""); + //$this->assertText("{$base}summary2", ""); + $this->byXPath("//input[@type='submit' and @value='Create New Account']")->click(); + //$this->assertText("{$base}summary1", ""); + //$this->assertText("{$base}summary2", ""); $this->type("{$base}Password", ""); - $this->click("//input[@type='submit' and @value='Create New Account']", ""); + $this->byXPath("//input[@type='submit' and @value='Create New Account']")->click(); $this->assertVisible("{$base}summary1"); $this->assertNotVisible("{$base}summary2"); - + $this->type("{$base}Password", "12312"); $this->assertVisible("{$base}summary1"); */ diff --git a/tests/simple_unit/ActiveRecord/ActiveRecordDynamicCallTestCase.php b/tests/simple_unit/ActiveRecord/ActiveRecordDynamicCallTestCase.php index 8d7fa46a..58c9977a 100644 --- a/tests/simple_unit/ActiveRecord/ActiveRecordDynamicCallTestCase.php +++ b/tests/simple_unit/ActiveRecord/ActiveRecordDynamicCallTestCase.php @@ -65,5 +65,3 @@ class ActiveRecordDynamicCallTestCase extends UnitTestCase var_dump($param); } } - -?>
\ No newline at end of file diff --git a/tests/simple_unit/ActiveRecord/ActiveRecordFinderTestCase.php b/tests/simple_unit/ActiveRecord/ActiveRecordFinderTestCase.php index e962046b..d9bd7420 100644 --- a/tests/simple_unit/ActiveRecord/ActiveRecordFinderTestCase.php +++ b/tests/simple_unit/ActiveRecord/ActiveRecordFinderTestCase.php @@ -41,5 +41,3 @@ class ActiveRecordFinderTestCase extends UnitTestCase } } - -?>
\ No newline at end of file diff --git a/tests/simple_unit/ActiveRecord/ActiveRecordMySql5TestCase.php b/tests/simple_unit/ActiveRecord/ActiveRecordMySql5TestCase.php index d173f005..09981f43 100644 --- a/tests/simple_unit/ActiveRecord/ActiveRecordMySql5TestCase.php +++ b/tests/simple_unit/ActiveRecord/ActiveRecordMySql5TestCase.php @@ -42,5 +42,4 @@ class ActiveRecordMySql5TestCase extends UnitTestCase $this->assertEqual($check->{$prop}, $blog->{$prop}); } -} -?>
\ No newline at end of file +}
\ No newline at end of file diff --git a/tests/simple_unit/ActiveRecord/ActiveRecordRegistryTestCase.php b/tests/simple_unit/ActiveRecord/ActiveRecordRegistryTestCase.php index fe1507cd..12b0796c 100644 --- a/tests/simple_unit/ActiveRecord/ActiveRecordRegistryTestCase.php +++ b/tests/simple_unit/ActiveRecord/ActiveRecordRegistryTestCase.php @@ -163,5 +163,3 @@ class ActiveRecordRegistryTestCase extends UnitTestCase } } - -?>
\ No newline at end of file diff --git a/tests/simple_unit/ActiveRecord/BaseActiveRecordTestCase.php b/tests/simple_unit/ActiveRecord/BaseActiveRecordTestCase.php index c356216b..676a0dd0 100644 --- a/tests/simple_unit/ActiveRecord/BaseActiveRecordTestCase.php +++ b/tests/simple_unit/ActiveRecord/BaseActiveRecordTestCase.php @@ -29,5 +29,3 @@ class BaseActiveRecordTestCase extends UnitTestCase } } } - -?>
\ No newline at end of file diff --git a/tests/simple_unit/ActiveRecord/CountRecordsTestCase.php b/tests/simple_unit/ActiveRecord/CountRecordsTestCase.php index 4c489d49..36a96ab6 100644 --- a/tests/simple_unit/ActiveRecord/CountRecordsTestCase.php +++ b/tests/simple_unit/ActiveRecord/CountRecordsTestCase.php @@ -31,5 +31,3 @@ class CountRecordsTestCase extends UnitTestCase $this->assertEqual($finder->count(), 8); } } - -?>
\ No newline at end of file diff --git a/tests/simple_unit/ActiveRecord/CriteriaTestCase.php b/tests/simple_unit/ActiveRecord/CriteriaTestCase.php index de5b3b71..a320f38c 100644 --- a/tests/simple_unit/ActiveRecord/CriteriaTestCase.php +++ b/tests/simple_unit/ActiveRecord/CriteriaTestCase.php @@ -46,5 +46,3 @@ class CriteriaTestCase extends UnitTestCase $this->assertEqual($criteria->getParameters()->toArray(), $expect); } } - -?>
\ No newline at end of file diff --git a/tests/simple_unit/ActiveRecord/DeleteByPkTestCase.php b/tests/simple_unit/ActiveRecord/DeleteByPkTestCase.php index f848033c..0c09a9b0 100644 --- a/tests/simple_unit/ActiveRecord/DeleteByPkTestCase.php +++ b/tests/simple_unit/ActiveRecord/DeleteByPkTestCase.php @@ -27,5 +27,4 @@ class DeleteByPkTestCase extends UnitTestCase $this->assertEqual($finder->deleteByPk(array(100, 101), array(102, 103)),0); $this->assertEqual($finder->deleteByPk(array(array(100, 101), array(102, 103))),0); } -} -?>
\ No newline at end of file +}
\ No newline at end of file diff --git a/tests/simple_unit/ActiveRecord/FindByPksTestCase.php b/tests/simple_unit/ActiveRecord/FindByPksTestCase.php index 4ccbddd5..32a79cea 100644 --- a/tests/simple_unit/ActiveRecord/FindByPksTestCase.php +++ b/tests/simple_unit/ActiveRecord/FindByPksTestCase.php @@ -60,5 +60,3 @@ class FindByPksTestCase extends UnitTestCase $this->assertEqual($dep->section_id, $sec_id); } } - -?>
\ No newline at end of file diff --git a/tests/simple_unit/ActiveRecord/FindBySqlTestCase.php b/tests/simple_unit/ActiveRecord/FindBySqlTestCase.php index e613cc30..14da0833 100644 --- a/tests/simple_unit/ActiveRecord/FindBySqlTestCase.php +++ b/tests/simple_unit/ActiveRecord/FindBySqlTestCase.php @@ -42,5 +42,3 @@ class FindBySqlTestCase extends UnitTestCase var_dump($users); } } - -?>
\ No newline at end of file diff --git a/tests/simple_unit/ActiveRecord/ForeignKeyTestCase.php b/tests/simple_unit/ActiveRecord/ForeignKeyTestCase.php index b960760e..86462ca6 100644 --- a/tests/simple_unit/ActiveRecord/ForeignKeyTestCase.php +++ b/tests/simple_unit/ActiveRecord/ForeignKeyTestCase.php @@ -171,5 +171,3 @@ class ForeignKeyTestCase extends UnitTestCase } } - -?>
\ No newline at end of file diff --git a/tests/simple_unit/ActiveRecord/ForeignObjectUpdateTest.php b/tests/simple_unit/ActiveRecord/ForeignObjectUpdateTest.php index 672c2d0f..29fbff42 100644 --- a/tests/simple_unit/ActiveRecord/ForeignObjectUpdateTest.php +++ b/tests/simple_unit/ActiveRecord/ForeignObjectUpdateTest.php @@ -238,5 +238,3 @@ class ForeignObjectUpdateTest extends UnitTestCase } //*/ } - -?>
\ No newline at end of file diff --git a/tests/simple_unit/ActiveRecord/MultipleForeignKeyTestCase.php b/tests/simple_unit/ActiveRecord/MultipleForeignKeyTestCase.php index c43db032..4b149503 100644 --- a/tests/simple_unit/ActiveRecord/MultipleForeignKeyTestCase.php +++ b/tests/simple_unit/ActiveRecord/MultipleForeignKeyTestCase.php @@ -188,5 +188,3 @@ class MultipleForeignKeyTestCase extends UnitTestCase $this->assertNotIdentical($arr, $arr->state2[0]->object2); } } - -?>
\ No newline at end of file diff --git a/tests/simple_unit/ActiveRecord/RecordEventTestCase.php b/tests/simple_unit/ActiveRecord/RecordEventTestCase.php index 3e98d46b..12c57421 100644 --- a/tests/simple_unit/ActiveRecord/RecordEventTestCase.php +++ b/tests/simple_unit/ActiveRecord/RecordEventTestCase.php @@ -33,5 +33,3 @@ class RecordEventTestCase extends UnitTestCase //var_dump($param); } } - -?>
\ No newline at end of file diff --git a/tests/simple_unit/ActiveRecord/SqliteTestCase.php b/tests/simple_unit/ActiveRecord/SqliteTestCase.php index 7d860b9a..ed0ea496 100644 --- a/tests/simple_unit/ActiveRecord/SqliteTestCase.php +++ b/tests/simple_unit/ActiveRecord/SqliteTestCase.php @@ -17,5 +17,3 @@ class SqliteTestCase extends UnitTestCase $this->assertNotNull($user); } } - -?>
\ No newline at end of file diff --git a/tests/simple_unit/ActiveRecord/UserRecordTestCase.php b/tests/simple_unit/ActiveRecord/UserRecordTestCase.php index 34e45ca8..85b12594 100644 --- a/tests/simple_unit/ActiveRecord/UserRecordTestCase.php +++ b/tests/simple_unit/ActiveRecord/UserRecordTestCase.php @@ -62,5 +62,3 @@ class UserRecordTestCase extends UnitTestCase $this->assertEqual($user->$prop,$check->$prop); } } - -?>
\ No newline at end of file diff --git a/tests/simple_unit/ActiveRecord/ViewRecordTestCase.php b/tests/simple_unit/ActiveRecord/ViewRecordTestCase.php index adf0beed..bb13a96f 100644 --- a/tests/simple_unit/ActiveRecord/ViewRecordTestCase.php +++ b/tests/simple_unit/ActiveRecord/ViewRecordTestCase.php @@ -72,5 +72,4 @@ class ViewRecordTestCase extends UnitTestCase $this->pass(); } } -} -?>
\ No newline at end of file +}
\ No newline at end of file diff --git a/tests/simple_unit/ActiveRecord/records/Blogs.php b/tests/simple_unit/ActiveRecord/records/Blogs.php index 680b3141..6523f029 100644 --- a/tests/simple_unit/ActiveRecord/records/Blogs.php +++ b/tests/simple_unit/ActiveRecord/records/Blogs.php @@ -10,5 +10,3 @@ class Blogs extends TActiveRecord return parent::finder($className); } } - -?>
\ No newline at end of file diff --git a/tests/simple_unit/ActiveRecord/records/DepSections.php b/tests/simple_unit/ActiveRecord/records/DepSections.php index 6f37ae3e..bf01ed12 100644 --- a/tests/simple_unit/ActiveRecord/records/DepSections.php +++ b/tests/simple_unit/ActiveRecord/records/DepSections.php @@ -12,5 +12,3 @@ class DepSections extends TActiveRecord return parent::finder($className); } } - -?>
\ No newline at end of file diff --git a/tests/simple_unit/ActiveRecord/records/DepartmentRecord.php b/tests/simple_unit/ActiveRecord/records/DepartmentRecord.php index 732610ae..b60c7930 100644 --- a/tests/simple_unit/ActiveRecord/records/DepartmentRecord.php +++ b/tests/simple_unit/ActiveRecord/records/DepartmentRecord.php @@ -14,5 +14,3 @@ class DepartmentRecord extends TActiveRecord return parent::finder($className); } } - -?>
\ No newline at end of file diff --git a/tests/simple_unit/ActiveRecord/records/ItemRecord.php b/tests/simple_unit/ActiveRecord/records/ItemRecord.php index 8585ebaf..e6707cde 100644 --- a/tests/simple_unit/ActiveRecord/records/ItemRecord.php +++ b/tests/simple_unit/ActiveRecord/records/ItemRecord.php @@ -45,5 +45,3 @@ class ItemRecord extends TActiveRecord return parent::finder($className); } } - -?>
\ No newline at end of file diff --git a/tests/simple_unit/ActiveRecord/records/SimpleUser.php b/tests/simple_unit/ActiveRecord/records/SimpleUser.php index cfba272e..b6748857 100644 --- a/tests/simple_unit/ActiveRecord/records/SimpleUser.php +++ b/tests/simple_unit/ActiveRecord/records/SimpleUser.php @@ -10,5 +10,3 @@ class SimpleUser extends TActiveRecord return parent::finder($className); } } - -?>
\ No newline at end of file diff --git a/tests/simple_unit/ActiveRecord/records/SqliteUsers.php b/tests/simple_unit/ActiveRecord/records/SqliteUsers.php index 8e5b9fde..f8fa12c5 100644 --- a/tests/simple_unit/ActiveRecord/records/SqliteUsers.php +++ b/tests/simple_unit/ActiveRecord/records/SqliteUsers.php @@ -12,5 +12,3 @@ class SqliteUsers extends TActiveRecord return parent::finder($className); } } - -?>
\ No newline at end of file diff --git a/tests/simple_unit/ActiveRecord/records/UserRecord.php b/tests/simple_unit/ActiveRecord/records/UserRecord.php index c4e8ce60..4ef98baf 100644 --- a/tests/simple_unit/ActiveRecord/records/UserRecord.php +++ b/tests/simple_unit/ActiveRecord/records/UserRecord.php @@ -34,5 +34,3 @@ class UserRecord extends TActiveRecord return parent::finder($className); } } - -?>
\ No newline at end of file diff --git a/tests/simple_unit/DbCommon/CommandBuilderMssqlTest.php b/tests/simple_unit/DbCommon/CommandBuilderMssqlTest.php index f8a4257c..d309c1cc 100644 --- a/tests/simple_unit/DbCommon/CommandBuilderMssqlTest.php +++ b/tests/simple_unit/DbCommon/CommandBuilderMssqlTest.php @@ -42,5 +42,3 @@ class CommandBuilderMssqlTest extends UnitTestCase // var_dump($sql); } } - -?>
\ No newline at end of file diff --git a/tests/simple_unit/DbCommon/CommandBuilderMysqlTest.php b/tests/simple_unit/DbCommon/CommandBuilderMysqlTest.php index e248defd..e47914aa 100644 --- a/tests/simple_unit/DbCommon/CommandBuilderMysqlTest.php +++ b/tests/simple_unit/DbCommon/CommandBuilderMysqlTest.php @@ -15,5 +15,3 @@ class CommandBuilderMysqlTest extends UnitTestCase $this->mysql_meta_data()->getTableInfo("tests.table1"); } } - -?>
\ No newline at end of file diff --git a/tests/simple_unit/DbCommon/CommandBuilderPgsqlTest.php b/tests/simple_unit/DbCommon/CommandBuilderPgsqlTest.php index 63660aee..8e339073 100644 --- a/tests/simple_unit/DbCommon/CommandBuilderPgsqlTest.php +++ b/tests/simple_unit/DbCommon/CommandBuilderPgsqlTest.php @@ -72,5 +72,3 @@ class CommandBuilderPgsqlTest extends UnitTestCase $this->assertEqual($expect, $limit); } } - -?>
\ No newline at end of file diff --git a/tests/simple_unit/DbCommon/MssqlColumnTest.php b/tests/simple_unit/DbCommon/MssqlColumnTest.php index 16d73bc4..f64615e8 100644 --- a/tests/simple_unit/DbCommon/MssqlColumnTest.php +++ b/tests/simple_unit/DbCommon/MssqlColumnTest.php @@ -44,5 +44,3 @@ class MssqlColumnTest extends UnitTestCase var_dump($result); }*/ } - -?>
\ No newline at end of file diff --git a/tests/simple_unit/DbCommon/Mysql4ColumnTest.php b/tests/simple_unit/DbCommon/Mysql4ColumnTest.php index 234a212f..6216cdd7 100644 --- a/tests/simple_unit/DbCommon/Mysql4ColumnTest.php +++ b/tests/simple_unit/DbCommon/Mysql4ColumnTest.php @@ -250,5 +250,3 @@ class Mysql4ColumnTest extends UnitTestCase } } } - -?>
\ No newline at end of file diff --git a/tests/simple_unit/DbCommon/MysqlColumnTest.php b/tests/simple_unit/DbCommon/MysqlColumnTest.php index 08fdb545..57565ca1 100644 --- a/tests/simple_unit/DbCommon/MysqlColumnTest.php +++ b/tests/simple_unit/DbCommon/MysqlColumnTest.php @@ -250,5 +250,3 @@ class MysqlColumnTest extends UnitTestCase } } } - -?>
\ No newline at end of file diff --git a/tests/simple_unit/DbCommon/PgsqlColumnTest.php b/tests/simple_unit/DbCommon/PgsqlColumnTest.php index a16de964..5859c115 100644 --- a/tests/simple_unit/DbCommon/PgsqlColumnTest.php +++ b/tests/simple_unit/DbCommon/PgsqlColumnTest.php @@ -135,5 +135,3 @@ class PgsqlColumnTest extends UnitTestCase } } } - -?>
\ No newline at end of file diff --git a/tests/simple_unit/DbCommon/SqliteColumnTest.php b/tests/simple_unit/DbCommon/SqliteColumnTest.php index 246c4a27..712d2977 100644 --- a/tests/simple_unit/DbCommon/SqliteColumnTest.php +++ b/tests/simple_unit/DbCommon/SqliteColumnTest.php @@ -25,5 +25,4 @@ class SqliteColumnTest extends UnitTestCase //$table = new TTableGateway('Accounts', $conn); // var_dump($table->findAll()->readAll()); } -} -?>
\ No newline at end of file +}
\ No newline at end of file diff --git a/tests/simple_unit/I18N/MysqlMessageSourceTestCase.php b/tests/simple_unit/I18N/MysqlMessageSourceTestCase.php index 80e9c1fd..0728baf7 100644 --- a/tests/simple_unit/I18N/MysqlMessageSourceTestCase.php +++ b/tests/simple_unit/I18N/MysqlMessageSourceTestCase.php @@ -41,5 +41,3 @@ class MysqlMessageSourceTestCase extends UnitTestCase } */ } - -?>
\ No newline at end of file diff --git a/tests/simple_unit/Soap/ContactManager.php b/tests/simple_unit/Soap/ContactManager.php index 290063b3..2fbeec48 100644 --- a/tests/simple_unit/Soap/ContactManager.php +++ b/tests/simple_unit/Soap/ContactManager.php @@ -23,12 +23,12 @@ class ContactManager{ $Contact->email = "me@you.com"; $Contact->id = 1; $Contact->name ="me"; - + $ret[] = $Contact; //debugObject("Contacten: ",$ret); return $ret; } - + /** * Gets the Contact with the given id. * @param int $id The id @@ -48,7 +48,7 @@ class ContactManager{ public function newContact() { return new Contact(); } - + /** * Saves a given Contact * @param Contact $Contact @@ -60,7 +60,7 @@ class ContactManager{ //$Contact->save(); return true; } - + /** * @return mixed * @soapmethod @@ -69,7 +69,7 @@ class ContactManager{ { return array(array(1,2), array("12", 1.2)); } - + /** * @return array * @soapmethod @@ -92,13 +92,13 @@ class ContactManager{ */ class Contact{ - /** + /** * @var int $id * @soapproperty */ public $id; - - /** + + /** * @var string $name * @soapproperty */ @@ -110,10 +110,10 @@ class Contact{ public $address; /** @var string $email - * @soapproperty + * @soapproperty */ public $email; - + /** * saves a Contact * @@ -134,24 +134,22 @@ class Contact{ */ class Address{ /** @var string $street - * @soapproperty + * @soapproperty */ public $street; - + /** @var string $nr * @soapproperty */ public $nr; - + /** @var string $zipcode * @soapproperty */ - public $zipcode; - + public $zipcode; + /** @var string $city * @soapproperty */ - public $city; + public $city; } - -?>
\ No newline at end of file diff --git a/tests/simple_unit/Soap/SoapTestCase.php b/tests/simple_unit/Soap/SoapTestCase.php index fe151b04..3aaa60d3 100644 --- a/tests/simple_unit/Soap/SoapTestCase.php +++ b/tests/simple_unit/Soap/SoapTestCase.php @@ -35,7 +35,7 @@ class SoapTestCase extends UnitTestCase { try { - $result = $this->getClient()->getContact(1); + $result = $this->getClient()->getContact(1); $this->fail(); } catch (SoapFault $f) @@ -88,4 +88,3 @@ class SoapTestCase extends UnitTestCase } } -?> diff --git a/tests/simple_unit/SqlMap/ActiveRecordSqlMapTest.php b/tests/simple_unit/SqlMap/ActiveRecordSqlMapTest.php index b3cde511..2ae051e8 100644 --- a/tests/simple_unit/SqlMap/ActiveRecordSqlMapTest.php +++ b/tests/simple_unit/SqlMap/ActiveRecordSqlMapTest.php @@ -83,5 +83,3 @@ class ActiveRecordSqlMapTest extends BaseCase $this->assertEqual($account1->{$prop}, $account2->{$prop}); } } - -?>
\ No newline at end of file diff --git a/tests/simple_unit/SqlMap/BaseCase.php b/tests/simple_unit/SqlMap/BaseCase.php index b0961b5b..4f44a5b7 100644 --- a/tests/simple_unit/SqlMap/BaseCase.php +++ b/tests/simple_unit/SqlMap/BaseCase.php @@ -258,5 +258,3 @@ class TDateTime $this->_datetime = $value; } } - -?>
\ No newline at end of file diff --git a/tests/simple_unit/SqlMap/CacheTest.php b/tests/simple_unit/SqlMap/CacheTest.php index 131ddfbb..ff87cd3a 100644 --- a/tests/simple_unit/SqlMap/CacheTest.php +++ b/tests/simple_unit/SqlMap/CacheTest.php @@ -160,5 +160,3 @@ class CacheTest extends BaseCase $this->assertIdentical(0.5, $cache->getHitRatio()); } } - -?>
\ No newline at end of file diff --git a/tests/simple_unit/SqlMap/DelegateTest.php b/tests/simple_unit/SqlMap/DelegateTest.php index 800e4240..80b23332 100644 --- a/tests/simple_unit/SqlMap/DelegateTest.php +++ b/tests/simple_unit/SqlMap/DelegateTest.php @@ -60,5 +60,3 @@ class DelegateTest extends BaseCase } - -?>
\ No newline at end of file diff --git a/tests/simple_unit/SqlMap/Dynamic/DynamicTest.php b/tests/simple_unit/SqlMap/Dynamic/DynamicTest.php index 436cd49e..be7a1820 100644 --- a/tests/simple_unit/SqlMap/Dynamic/DynamicTest.php +++ b/tests/simple_unit/SqlMap/Dynamic/DynamicTest.php @@ -7,5 +7,3 @@ class DynamicTest extends UnitTestCase } } - -?>
\ No newline at end of file diff --git a/tests/simple_unit/SqlMap/GroupByTest.php b/tests/simple_unit/SqlMap/GroupByTest.php index 11bd86bb..a16211c3 100644 --- a/tests/simple_unit/SqlMap/GroupByTest.php +++ b/tests/simple_unit/SqlMap/GroupByTest.php @@ -39,5 +39,3 @@ class GroupByTest extends BaseCase /**/ } - -?>
\ No newline at end of file diff --git a/tests/simple_unit/SqlMap/InheritanceTest.php b/tests/simple_unit/SqlMap/InheritanceTest.php index 82f86af3..81cad4a5 100644 --- a/tests/simple_unit/SqlMap/InheritanceTest.php +++ b/tests/simple_unit/SqlMap/InheritanceTest.php @@ -141,5 +141,4 @@ class CustomInheritance extends TSqlMapTypeHandler { throw new TDataMapperException('can not create'); } -} -?>
\ No newline at end of file +}
\ No newline at end of file diff --git a/tests/simple_unit/SqlMap/ParameterMapTest.php b/tests/simple_unit/SqlMap/ParameterMapTest.php index fb29c162..557b9f4d 100644 --- a/tests/simple_unit/SqlMap/ParameterMapTest.php +++ b/tests/simple_unit/SqlMap/ParameterMapTest.php @@ -245,5 +245,3 @@ class ParameterMapTest extends BaseCase } /**/ } - -?>
\ No newline at end of file diff --git a/tests/simple_unit/SqlMap/PropertyAccessTest.php b/tests/simple_unit/SqlMap/PropertyAccessTest.php index d580f965..80199628 100644 --- a/tests/simple_unit/SqlMap/PropertyAccessTest.php +++ b/tests/simple_unit/SqlMap/PropertyAccessTest.php @@ -73,5 +73,3 @@ class PropertyAccessTest extends BaseCase } - -?>
\ No newline at end of file diff --git a/tests/simple_unit/SqlMap/ResultClassTest.php b/tests/simple_unit/SqlMap/ResultClassTest.php index 041c124e..773268b9 100644 --- a/tests/simple_unit/SqlMap/ResultClassTest.php +++ b/tests/simple_unit/SqlMap/ResultClassTest.php @@ -245,5 +245,3 @@ class ResultClassTest extends BaseCase /**/ } - -?>
\ No newline at end of file diff --git a/tests/simple_unit/SqlMap/ResultMapTest.php b/tests/simple_unit/SqlMap/ResultMapTest.php index d545b65e..b14cee31 100644 --- a/tests/simple_unit/SqlMap/ResultMapTest.php +++ b/tests/simple_unit/SqlMap/ResultMapTest.php @@ -269,5 +269,3 @@ class ResultMapTest extends BaseCase */ } - -?>
\ No newline at end of file diff --git a/tests/simple_unit/SqlMap/SelectKeyTest.php b/tests/simple_unit/SqlMap/SelectKeyTest.php index a1efa640..464b94f1 100644 --- a/tests/simple_unit/SqlMap/SelectKeyTest.php +++ b/tests/simple_unit/SqlMap/SelectKeyTest.php @@ -116,5 +116,3 @@ class SelectKeyTest extends BaseCase $this->initScript('line-item-init.sql'); } } - -?>
\ No newline at end of file diff --git a/tests/simple_unit/SqlMap/SqlMapCacheTest.php b/tests/simple_unit/SqlMap/SqlMapCacheTest.php index 1bb9b8d4..7c3495b5 100644 --- a/tests/simple_unit/SqlMap/SqlMapCacheTest.php +++ b/tests/simple_unit/SqlMap/SqlMapCacheTest.php @@ -73,5 +73,3 @@ class SqlMapCacheTest extends UnitTestCase } } - -?>
\ No newline at end of file diff --git a/tests/simple_unit/SqlMap/StatementExtendsTest.php b/tests/simple_unit/SqlMap/StatementExtendsTest.php index f496f154..69beaa58 100644 --- a/tests/simple_unit/SqlMap/StatementExtendsTest.php +++ b/tests/simple_unit/SqlMap/StatementExtendsTest.php @@ -25,5 +25,3 @@ class StatementExtendsTest extends UnitTestCase $this->assertPattern('/img_progress/', $sql2); } } - -?>
\ No newline at end of file diff --git a/tests/simple_unit/SqlMap/StatementTest.php b/tests/simple_unit/SqlMap/StatementTest.php index f9c3fb13..3f9f4506 100644 --- a/tests/simple_unit/SqlMap/StatementTest.php +++ b/tests/simple_unit/SqlMap/StatementTest.php @@ -1131,5 +1131,3 @@ class StatementTest extends BaseCase #endregion /**/ } - -?>
\ No newline at end of file diff --git a/tests/simple_unit/SqlMap/TestQueryForMap.php b/tests/simple_unit/SqlMap/TestQueryForMap.php index 89676469..2de020a8 100644 --- a/tests/simple_unit/SqlMap/TestQueryForMap.php +++ b/tests/simple_unit/SqlMap/TestQueryForMap.php @@ -39,5 +39,3 @@ class TestQueryForMap extends BaseCase } } - -?>
\ No newline at end of file diff --git a/tests/simple_unit/SqlMap/common.php b/tests/simple_unit/SqlMap/common.php index 5146d123..020a296b 100644 --- a/tests/simple_unit/SqlMap/common.php +++ b/tests/simple_unit/SqlMap/common.php @@ -151,5 +151,3 @@ class BaseTestConfig } } - -?>
\ No newline at end of file diff --git a/tests/simple_unit/SqlMap/domain/A.php b/tests/simple_unit/SqlMap/domain/A.php index af1f925d..a4f204e4 100644 --- a/tests/simple_unit/SqlMap/domain/A.php +++ b/tests/simple_unit/SqlMap/domain/A.php @@ -23,5 +23,3 @@ class A public function getF(){ return $this->_F; } public function setF($value){ $this->_F = $value; } } - -?>
\ No newline at end of file diff --git a/tests/simple_unit/SqlMap/domain/Account.php b/tests/simple_unit/SqlMap/domain/Account.php index 9502eb85..b4bcbcc8 100644 --- a/tests/simple_unit/SqlMap/domain/Account.php +++ b/tests/simple_unit/SqlMap/domain/Account.php @@ -32,5 +32,3 @@ class Account public function setCartOptions($value){ $this->_CartOptions = $value; } } - -?>
\ No newline at end of file diff --git a/tests/simple_unit/SqlMap/domain/AccountBis.php b/tests/simple_unit/SqlMap/domain/AccountBis.php index d454f2a8..e48184b6 100644 --- a/tests/simple_unit/SqlMap/domain/AccountBis.php +++ b/tests/simple_unit/SqlMap/domain/AccountBis.php @@ -9,5 +9,3 @@ class AccountBis public $More; } - -?>
\ No newline at end of file diff --git a/tests/simple_unit/SqlMap/domain/AccountCollection.php b/tests/simple_unit/SqlMap/domain/AccountCollection.php index b14ece5e..06e30dc8 100644 --- a/tests/simple_unit/SqlMap/domain/AccountCollection.php +++ b/tests/simple_unit/SqlMap/domain/AccountCollection.php @@ -13,5 +13,3 @@ class AccountCollection extends TList $array->copyFrom($this); } } - -?>
\ No newline at end of file diff --git a/tests/simple_unit/SqlMap/domain/B.php b/tests/simple_unit/SqlMap/domain/B.php index 788b804e..ab42e6b6 100644 --- a/tests/simple_unit/SqlMap/domain/B.php +++ b/tests/simple_unit/SqlMap/domain/B.php @@ -19,5 +19,3 @@ class B public function getLibelle(){ return $this->_Libelle; } public function setLibelle($value){ $this->_Libelle = $value; } } - -?>
\ No newline at end of file diff --git a/tests/simple_unit/SqlMap/domain/Book.php b/tests/simple_unit/SqlMap/domain/Book.php index 80877112..4c0670e8 100644 --- a/tests/simple_unit/SqlMap/domain/Book.php +++ b/tests/simple_unit/SqlMap/domain/Book.php @@ -5,7 +5,5 @@ class Book extends Document private $_PageNumber=''; public function getPageNumber(){ return $this->_PageNumber; } - public function setPageNumber($value){ $this->_PageNumber = $value; } + public function setPageNumber($value){ $this->_PageNumber = $value; } } - -?>
\ No newline at end of file diff --git a/tests/simple_unit/SqlMap/domain/C.php b/tests/simple_unit/SqlMap/domain/C.php index 47118d44..642f97e9 100644 --- a/tests/simple_unit/SqlMap/domain/C.php +++ b/tests/simple_unit/SqlMap/domain/C.php @@ -11,5 +11,3 @@ class C public function getLibelle(){ return $this->_Libelle; } public function setLibelle($value){ $this->_Libelle = $value; } } - -?>
\ No newline at end of file diff --git a/tests/simple_unit/SqlMap/domain/Category.php b/tests/simple_unit/SqlMap/domain/Category.php index db76edb4..895819e9 100644 --- a/tests/simple_unit/SqlMap/domain/Category.php +++ b/tests/simple_unit/SqlMap/domain/Category.php @@ -15,5 +15,3 @@ class Category public function getGuidString(){ return $this->_Guid; } public function setGuidString($value){ $this->_Guid = $value; } } - -?>
\ No newline at end of file diff --git a/tests/simple_unit/SqlMap/domain/Complex.php b/tests/simple_unit/SqlMap/domain/Complex.php index 99cb04b8..01082343 100644 --- a/tests/simple_unit/SqlMap/domain/Complex.php +++ b/tests/simple_unit/SqlMap/domain/Complex.php @@ -7,5 +7,3 @@ class Complex public function getMap(){ return $this->_map; } public function setMap(TMap $map){ $this->_map = $map; } } - -?>
\ No newline at end of file diff --git a/tests/simple_unit/SqlMap/domain/D.php b/tests/simple_unit/SqlMap/domain/D.php index 2cbd2883..f120e2d1 100644 --- a/tests/simple_unit/SqlMap/domain/D.php +++ b/tests/simple_unit/SqlMap/domain/D.php @@ -12,5 +12,3 @@ class D public function setLibelle($value){ $this->_Libelle = $value; } } - -?>
\ No newline at end of file diff --git a/tests/simple_unit/SqlMap/domain/Document.php b/tests/simple_unit/SqlMap/domain/Document.php index 682f8eb3..518851e6 100644 --- a/tests/simple_unit/SqlMap/domain/Document.php +++ b/tests/simple_unit/SqlMap/domain/Document.php @@ -12,5 +12,3 @@ class Document public function setTitle($value){ $this->_Title = $value; } } - -?>
\ No newline at end of file diff --git a/tests/simple_unit/SqlMap/domain/DocumentCollection.php b/tests/simple_unit/SqlMap/domain/DocumentCollection.php index c130db56..a2d5d89d 100644 --- a/tests/simple_unit/SqlMap/domain/DocumentCollection.php +++ b/tests/simple_unit/SqlMap/domain/DocumentCollection.php @@ -4,5 +4,3 @@ class DocumentCollection extends TList { } - -?>
\ No newline at end of file diff --git a/tests/simple_unit/SqlMap/domain/E.php b/tests/simple_unit/SqlMap/domain/E.php index 8473c156..c69c8027 100644 --- a/tests/simple_unit/SqlMap/domain/E.php +++ b/tests/simple_unit/SqlMap/domain/E.php @@ -12,5 +12,3 @@ class E public function setLibelle($value){ $this->_Libelle = $value; } } - -?>
\ No newline at end of file diff --git a/tests/simple_unit/SqlMap/domain/F.php b/tests/simple_unit/SqlMap/domain/F.php index 2bbbb2fb..159d8d63 100644 --- a/tests/simple_unit/SqlMap/domain/F.php +++ b/tests/simple_unit/SqlMap/domain/F.php @@ -12,5 +12,3 @@ class F public function setLibelle($value){ $this->_Libelle = $value; } } - -?>
\ No newline at end of file diff --git a/tests/simple_unit/SqlMap/domain/LineItem.php b/tests/simple_unit/SqlMap/domain/LineItem.php index f6908bbd..a989ab8b 100644 --- a/tests/simple_unit/SqlMap/domain/LineItem.php +++ b/tests/simple_unit/SqlMap/domain/LineItem.php @@ -28,5 +28,3 @@ class LineItem public function setPictureData($value){ $this->_PictureData = $value; } } - -?>
\ No newline at end of file diff --git a/tests/simple_unit/SqlMap/domain/LineItemCollection.php b/tests/simple_unit/SqlMap/domain/LineItemCollection.php index 8bc95622..1c31dca3 100644 --- a/tests/simple_unit/SqlMap/domain/LineItemCollection.php +++ b/tests/simple_unit/SqlMap/domain/LineItemCollection.php @@ -4,5 +4,3 @@ class LineItemCollection extends TList { } - -?>
\ No newline at end of file diff --git a/tests/simple_unit/SqlMap/domain/Newspaper.php b/tests/simple_unit/SqlMap/domain/Newspaper.php index 08716c6d..12ebce5b 100644 --- a/tests/simple_unit/SqlMap/domain/Newspaper.php +++ b/tests/simple_unit/SqlMap/domain/Newspaper.php @@ -8,5 +8,3 @@ class Newspaper extends Document public function setCity($value){ $this->_City = $value; } } - -?>
\ No newline at end of file diff --git a/tests/simple_unit/SqlMap/domain/Order.php b/tests/simple_unit/SqlMap/domain/Order.php index 312626fe..2b907ac6 100644 --- a/tests/simple_unit/SqlMap/domain/Order.php +++ b/tests/simple_unit/SqlMap/domain/Order.php @@ -67,5 +67,3 @@ class Order public function setFavouriteLineItem($value){ $this->_FavouriteLineItem = $value; } } - -?>
\ No newline at end of file diff --git a/tests/simple_unit/SqlMap/domain/Other.php b/tests/simple_unit/SqlMap/domain/Other.php index 9e78ab97..89f9d490 100644 --- a/tests/simple_unit/SqlMap/domain/Other.php +++ b/tests/simple_unit/SqlMap/domain/Other.php @@ -19,5 +19,3 @@ class Other public function getLong(){ return $this->_Long; } public function setLong($value){ $this->_Long = $value; } } - -?>
\ No newline at end of file diff --git a/tests/simple_unit/SqlMap/domain/Sample.php b/tests/simple_unit/SqlMap/domain/Sample.php index e03be2df..f2a8951f 100644 --- a/tests/simple_unit/SqlMap/domain/Sample.php +++ b/tests/simple_unit/SqlMap/domain/Sample.php @@ -51,5 +51,3 @@ class Sample public function getSequenceDate(){ return $this->_SequenceDate; } public function setSequenceDate($value){ $this->_SequenceDate = $value; } } - -?>
\ No newline at end of file diff --git a/tests/simple_unit/SqlMap/domain/Search.php b/tests/simple_unit/SqlMap/domain/Search.php index c01891a9..d2170044 100644 --- a/tests/simple_unit/SqlMap/domain/Search.php +++ b/tests/simple_unit/SqlMap/domain/Search.php @@ -19,5 +19,3 @@ class Search public function getStartDateAnd(){ return $this->_StartDateAnd; } public function setStartDateAnd($value){ $this->_StartDateAnd = $value; } } - -?>
\ No newline at end of file diff --git a/tests/simple_unit/SqlMap/domain/User.php b/tests/simple_unit/SqlMap/domain/User.php index b21712a3..1106d1e9 100644 --- a/tests/simple_unit/SqlMap/domain/User.php +++ b/tests/simple_unit/SqlMap/domain/User.php @@ -23,5 +23,3 @@ class User public function getLastLogon(){ return $this->_LastLogon; } public function setLastLogon($value){ $this->_LastLogon = $value; } } - -?>
\ No newline at end of file diff --git a/tests/simple_unit/SqlMap/gen.php b/tests/simple_unit/SqlMap/gen.php index 855172ba..40ddc297 100644 --- a/tests/simple_unit/SqlMap/gen.php +++ b/tests/simple_unit/SqlMap/gen.php @@ -29,5 +29,3 @@ function print_funcs($props) echo $getter.$setter."\n"; } } - -?>
\ No newline at end of file diff --git a/tests/simple_unit/SqlMap/queryForListLimitTest.php b/tests/simple_unit/SqlMap/queryForListLimitTest.php index 349314a5..af550dcb 100644 --- a/tests/simple_unit/SqlMap/queryForListLimitTest.php +++ b/tests/simple_unit/SqlMap/queryForListLimitTest.php @@ -36,5 +36,3 @@ class queryForListLimitTest extends BaseCase $this->assertEqual($list1[1][2],'Dalton'); } } - -?>
\ No newline at end of file diff --git a/tests/simple_unit/TableGateway/BaseGatewayTest.php b/tests/simple_unit/TableGateway/BaseGatewayTest.php index 98b236ee..f3117ed2 100644 --- a/tests/simple_unit/TableGateway/BaseGatewayTest.php +++ b/tests/simple_unit/TableGateway/BaseGatewayTest.php @@ -90,5 +90,4 @@ class BaseGatewayTest extends UnitTestCase { $this->getGateway()->deleteAll('1=1'); } -} -?>
\ No newline at end of file +}
\ No newline at end of file diff --git a/tests/simple_unit/TableGateway/CountTest.php b/tests/simple_unit/TableGateway/CountTest.php index 0e159ab0..97211e3c 100644 --- a/tests/simple_unit/TableGateway/CountTest.php +++ b/tests/simple_unit/TableGateway/CountTest.php @@ -12,5 +12,4 @@ class CountTest extends BaseGatewayTest $result = $this->getGateway2()->count('department_id = ?', 1); $this->assertEqual(4, $result); } -} -?>
\ No newline at end of file +}
\ No newline at end of file diff --git a/tests/simple_unit/TableGateway/DeleteByPkTest.php b/tests/simple_unit/TableGateway/DeleteByPkTest.php index 57d9dd31..49b2d86c 100644 --- a/tests/simple_unit/TableGateway/DeleteByPkTest.php +++ b/tests/simple_unit/TableGateway/DeleteByPkTest.php @@ -48,5 +48,4 @@ class DeleteByPkTest extends BaseGatewayTest $this->assertEqual(2, $deleted); } -} -?>
\ No newline at end of file +}
\ No newline at end of file diff --git a/tests/simple_unit/TableGateway/MagicCallTest.php b/tests/simple_unit/TableGateway/MagicCallTest.php index 8d42fba8..87f9e785 100644 --- a/tests/simple_unit/TableGateway/MagicCallTest.php +++ b/tests/simple_unit/TableGateway/MagicCallTest.php @@ -27,5 +27,4 @@ class MagicCallTest extends BaseGatewayTest $this->assertEqual(0, count($result)); } -} -?>
\ No newline at end of file +}
\ No newline at end of file diff --git a/tests/simple_unit/TableGateway/TableGatewayPgsqlTest.php b/tests/simple_unit/TableGateway/TableGatewayPgsqlTest.php index f34dcefc..96c9351d 100644 --- a/tests/simple_unit/TableGateway/TableGatewayPgsqlTest.php +++ b/tests/simple_unit/TableGateway/TableGatewayPgsqlTest.php @@ -52,5 +52,4 @@ class TableGatewayPgsqlTest extends BaseGatewayTest $this->assertEqual($result['username'], 'record2'); } -} -?>
\ No newline at end of file +}
\ No newline at end of file diff --git a/tests/simple_unit/TableGateway/TableInfoGatewayTest.php b/tests/simple_unit/TableGateway/TableInfoGatewayTest.php index 51af7634..6c85248c 100644 --- a/tests/simple_unit/TableGateway/TableInfoGatewayTest.php +++ b/tests/simple_unit/TableGateway/TableInfoGatewayTest.php @@ -13,5 +13,4 @@ class TableInfoGatewayTest extends BaseGatewayTest $table = new TTableGateway($info, $conn); $this->assertEqual(count($table->findAll()->readAll()), 2); } -} -?>
\ No newline at end of file +}
\ No newline at end of file diff --git a/tests/simple_unit/TableGateway/TestFindByPk.php b/tests/simple_unit/TableGateway/TestFindByPk.php index 5a7a081c..3756d35a 100644 --- a/tests/simple_unit/TableGateway/TestFindByPk.php +++ b/tests/simple_unit/TableGateway/TestFindByPk.php @@ -44,5 +44,4 @@ class TestFindByPk extends BaseGatewayTest $this->assertEqual($expect, $result); } -} -?>
\ No newline at end of file +}
\ No newline at end of file diff --git a/tests/simple_unit/Tickets/Ticket589Test.php b/tests/simple_unit/Tickets/Ticket589Test.php index 2fedda6f..487181ff 100644 --- a/tests/simple_unit/Tickets/Ticket589Test.php +++ b/tests/simple_unit/Tickets/Ticket589Test.php @@ -18,5 +18,3 @@ class Ticket589Test extends UnitTestCase } } } - -?>
\ No newline at end of file diff --git a/tests/simple_unit/unit.php b/tests/simple_unit/unit.php index 63910f68..b0e7874d 100644 --- a/tests/simple_unit/unit.php +++ b/tests/simple_unit/unit.php @@ -5,5 +5,3 @@ $test_cases = dirname(__FILE__)."/"; $tester = new PradoUnitTester($test_cases); $tester->run(new HtmlReporter()); - -?>
\ No newline at end of file diff --git a/tests/simple_unit/ws.php b/tests/simple_unit/ws.php index 703235d1..9096183e 100644 --- a/tests/simple_unit/ws.php +++ b/tests/simple_unit/ws.php @@ -5,5 +5,3 @@ include_once './Soap/ContactManager.php'; $app = new TApplication('.'); $app->run(); - -?>
\ No newline at end of file diff --git a/tests/test_tools/PradoGenericSelenium2Test.php b/tests/test_tools/PradoGenericSelenium2Test.php new file mode 100755 index 00000000..23dfeb61 --- /dev/null +++ b/tests/test_tools/PradoGenericSelenium2Test.php @@ -0,0 +1,230 @@ +<?php +require_once 'PHPUnit/Extensions/Selenium2TestCase.php'; + +// TODO: stub +class PradoGenericSelenium2Test extends PHPUnit_Extensions_Selenium2TestCase +{ + public static $browsers = array( +/* + array( + 'name' => 'Firefox on OSX', + 'browserName' => '*firefox', + 'host' => '127.0.0.1', + 'port' => 4444, + ), +*/ + array( + 'name' => 'Chrome on OSX', + 'browserName' => 'chrome', + 'sessionStrategy' => 'shared', + 'host' => '127.0.0.1', + 'port' => 4444, + ), +/* + array( + 'name' => 'Firefox on WindowsXP', + 'browserName' => '*firefox', + 'host' => '127.0.0.1', + 'port' => 4445, + ), + array( + 'name' => 'Internet Explorer 8 on WindowsXP', + 'browserName' => '*iehta', + 'host' => '127.0.0.1', + 'port' => 4445, + ) +*/ + ); + + static $baseurl='http://127.0.0.1/prado-master/tests/FunctionalTests/'; + + static $timeout=5; //seconds + + protected function setUp() + { + self::shareSession(true); + $this->setBrowserUrl(static::$baseurl); + $this->setSeleniumServerRequestsTimeout(static::$timeout); + } + + protected function assertAttribute($idattr, $txt) + { + list($id, $attr) = explode('@', $idattr); + + $element = $this->getElement($id); + $value=$element->attribute($attr); + + if(strpos($txt, 'regexp:')===0) + { + $this->assertRegExp('/'.substr($txt, 7).'/', $value); + } else { + $this->assertEquals($txt, $value); + } + } + + protected function getElement($id) + { + if(strpos($id, 'id=')===0) { + return $this->byId(substr($id, 3)); + } elseif(strpos($id, 'name=')===0) { + return $this->byName(substr($id, 5)); + } elseif(strpos($id, '//')===0) { + return $this->byXPath($id); + } elseif(strpos($id, '$')!==false) { + return $this->byName($id); + } else { + return $this->byId($id); + } + } + + protected function assertText($id, $txt) + { + $this->assertEquals($txt, $this->getElement($id)->text()); + } + + protected function assertValue($id, $txt) + { + $this->assertEquals($txt, $this->getElement($id)->value()); + } + + protected function assertVisible($id) + { + $this->assertTrue($this->getElement($id)->displayed()); + } + + protected function assertNotVisible($id) + { + $this->assertFalse($this->getElement($id)->displayed()); + } + + protected function assertElementPresent($id) + { + $this->assertTrue($this->getElement($id)!==null); + } + + protected function assertElementNotPresent($id) + { + try { + $el = $this->getElement($id); + } catch (PHPUnit_Extensions_Selenium2TestCase_WebDriverException $e) { + $this->assertEquals(PHPUnit_Extensions_Selenium2TestCase_WebDriverException::NoSuchElement, $e->getCode()); + return; + } + $this->fail('The element '.$id.' shouldn\'t exist.'); + } + + protected function type($id, $txt='') + { + $element = $this->getElement($id); + $element->clear(); + $element->value($txt); + // trigger onblur() event + $this->byCssSelector('body')->click(); + } + + protected function typeSpecial($id, $txt='') + { + $element = $this->getElement($id); + // clear the textbox without using clear() that triggers onchange() + // the idea is to focus the input, move to the end of the text and hit + // backspace until the input is empty. + // on multiline textareas, line feeds can make this difficult, so we mix + // sequences of end+backspace and start+delete + + $element->click(); + while(strlen($element->value())>0) + { + $this->keys(PHPUnit_Extensions_Selenium2TestCase_Keys::END); + // the number 100 is purely empiric + for($i=0;$i<100;$i++) + $this->keys(PHPUnit_Extensions_Selenium2TestCase_Keys::BACKSPACE); + + $this->keys(PHPUnit_Extensions_Selenium2TestCase_Keys::HOME); + // the number 100 is purely empiric + for($i=0;$i<100;$i++) + $this->keys(PHPUnit_Extensions_Selenium2TestCase_Keys::DELETE); + } + + $element->value($txt); + // trigger onblur() event + $this->byCssSelector('body')->click(); + } + + protected function select($id, $value) + { + $select = parent::select($this->getElement($id)); + $select->clearSelectedOptions(); + + $select->selectOptionByLabel($value); + } + + protected function selectAndWait($id, $value) + { + $this->select($id, $value); + } + + protected function addSelection($id, $value) + { + parent::select($this->getElement($id))->selectOptionByLabel($value); + } + + protected function getSelectedLabels($id) + { + return parent::select($this->getElement($id))->selectedLabels(); + } + + protected function getSelectOptions($id) + { + return parent::select($this->getElement($id))->selectOptionLabels(); + } + + protected function assertSelectedIndex($id, $value) + { + $options=parent::select($this->getElement($id))->selectOptionValues(); + $curval=parent::select($this->getElement($id))->selectedValue(); + + $i=0; + foreach($options as $option) + { + if($option==$curval) + { + $this->assertEquals($i, $value); + return; + } + $i++; + } + $this->fail('Current value '.$curval.' not found in: '.implode(',', $options)); + } + + protected function assertSelected($id, $label) + { + $this->assertSame($label, parent::select($this->getElement($id))->selectedLabel()); + } + + protected function assertNotSomethingSelected($id) + { + $this->assertSame(array(), $this->getSelectedLabels($id)); + } + + protected function assertSelectedValue($id, $index) + { + $this->assertSame($index, parent::select($this->getElement($id))->selectedValue()); + } + + protected function assertAlertNotPresent() + { + try { + $foo=$this->alertText(); + } catch (PHPUnit_Extensions_Selenium2TestCase_WebDriverException $e) { + $this->assertEquals(PHPUnit_Extensions_Selenium2TestCase_WebDriverException::NoAlertOpenError, $e->getCode()); + return; + } + $this->fail('Failed asserting no alert is open'); + } + + protected function pause($msec) + { + usleep($msec*1000); + } + +}
\ No newline at end of file diff --git a/tests/test_tools/PradoGenericSeleniumTest.php b/tests/test_tools/PradoGenericSeleniumTest.php deleted file mode 100644 index 2c9ceb21..00000000 --- a/tests/test_tools/PradoGenericSeleniumTest.php +++ /dev/null @@ -1,42 +0,0 @@ -<?php -require_once 'PHPUnit/Extensions/SeleniumTestCase.php'; -require_once 'PHPUnit/Extensions/Selenium2TestCase.php'; - -class PradoGenericSeleniumTest extends PHPUnit_Extensions_SeleniumTestCase -{ - static $browser='*googlechrome'; - static $baseurl='http://127.0.0.1/prado-3.2/tests/FunctionalTests/'; - - protected function setUp() - { - $this->shareSession(true); - $this->setBrowser(static::$browser); - $this->setBrowserUrl(static::$baseurl); - } - - protected function tearDown() - { - } -} - -// TODO: stub -class PradoGenericSelenium2Test extends PHPUnit_Extensions_Selenium2TestCase -{ - static $browser='chrome'; - static $baseurl='http://127.0.0.1/prado-3.2/tests/FunctionalTests/'; - - protected function setUp() - { - $this->setBrowser(static::$browser); - $this->setBrowserUrl(static::$baseurl); - } - - protected function open($url) - { - $this->setBrowserUrl(static::$baseurl.$url); - } - - protected function tearDown() - { - } -}
\ No newline at end of file diff --git a/tests/test_tools/README.txt b/tests/test_tools/README.txt index cfa02abe..6bc3aa79 100644 --- a/tests/test_tools/README.txt +++ b/tests/test_tools/README.txt @@ -4,7 +4,7 @@ Functional tests are browser based that tests the overall functional of a Prado === Writing Tests === -Lets test some part of a Prado application. Create a new php file, e.g. +Lets test some part of a Prado application. Create a new php file, e.g. testExample1.php @@ -21,11 +21,10 @@ class testExample1 extends SeleniumTestCase { //using xpath to find the button with value "Click Me!" $this->click('//input[@value="Click Me!"]'); - + //..more commands and assertions } } -?> </php> === Tests as part of Example code === @@ -50,9 +49,9 @@ class testMyButtonExample extends SeleniumTestCase { //get the test page url $page = Prado::getApplication()->getTestPage(__FILE__); - + //open MyButtonExample page - $this->open($page); + $this->open($page); } function testButtonClick() @@ -62,7 +61,6 @@ class testMyButtonExample extends SeleniumTestCase $this->click('//input[@value="Hello World!"]'); } } -?> </php> File: MyButtonExample.tpl @@ -108,7 +106,7 @@ Select the element with the specified @id attribute. If no match is found, sele Find an element using JavaScript traversal of the HTML Document Object Model. DOM locators ''must'' begin with "document.". * dom=document.forms['myForm'].myDropdown * dom=document.images[56] - + ==== '''xpath='''''xpathExpression''==== Locate an element using an XPath expression. XPath locators ''must'' begin with "//". * xpath=//img[@alt='The image alt text'] @@ -133,15 +131,15 @@ Select Option Specifiers provide different ways of specifying options of an HTML matches options based on their labels, i.e. the visible text. * label=regexp:^[Oo]ther -==== value=valuePattern ==== +==== value=valuePattern ==== matches options based on their values. * value=other -==== id=id ==== +==== id=id ==== matches options based on their ids. * id=option1 -==== index=index ==== +==== index=index ==== matches an option based on its index (offset from zero). * index=2 @@ -174,8 +172,8 @@ Selenium Actions examples: - open /mypage - open http://localhost/ + open /mypage + open http://localhost/ click( elementLocator ) @@ -183,9 +181,9 @@ Selenium Actions examples: - click aCheckbox - clickAndWait submitButton - clickAndWait anyLink + click aCheckbox + clickAndWait submitButton + clickAndWait anyLink note: Selenium will always automatically click on a popup dialog raised by the alert() or confirm() methods. (The exception is those raised during 'onload', which are not yet handled by Selenium). You must use [verify|assert]Alert or [verify|assert]Confirmation to tell Selenium that you expect the popup dialog. You may use chooseCancelOnNextConfirmation to click 'cancel' on the next confirmation dialog instead of clicking 'OK'. @@ -222,8 +220,8 @@ Selenium Actions examples: - selectWindow myPopupWindow - selectWindow null + selectWindow myPopupWindow + selectWindow null goBack() @@ -231,7 +229,7 @@ Selenium Actions examples: - goBack + goBack close() @@ -239,7 +237,7 @@ Selenium Actions examples: - close + close pause( milliseconds ) @@ -247,8 +245,8 @@ Selenium Actions examples: - pause 5000 - pause 2000 + pause 5000 + pause 2000 fireEvent( elementLocator, eventName ) @@ -310,7 +308,7 @@ Selenium Actions examples: - chooseCancelOnNextConfirmation + chooseCancelOnNextConfirmation answerOnNextPrompt( answerString ) @@ -318,7 +316,7 @@ Selenium Actions examples: - answerOnNextPrompt Kangaroo + answerOnNextPrompt Kangaroo Selenium Checks @@ -330,8 +328,8 @@ Selenium Checks examples: - verifyLocation /mypage - assertLocation /mypage + verifyLocation /mypage + assertLocation /mypage assertTitle( titlePattern ) @@ -339,8 +337,8 @@ Selenium Checks examples: - verifyTitle My Page - assertTitle My Page + verifyTitle My Page + assertTitle My Page assertValue( inputLocator, valuePattern ) @@ -396,8 +394,8 @@ Selenium Checks examples: - verifyTextPresent You are now logged in. - assertTextPresent You are now logged in. + verifyTextPresent You are now logged in. + assertTextPresent You are now logged in. assertTextNotPresent( text ) @@ -409,8 +407,8 @@ Selenium Checks examples: - verifyElementPresent submitButton - assertElementPresent //img[@alt='foo'] + verifyElementPresent submitButton + assertElementPresent //img[@alt='foo'] assertElementNotPresent( elementLocator ) @@ -418,8 +416,8 @@ Selenium Checks examples: - verifyElementNotPresent cancelButton - assertElementNotPresent cancelButton + verifyElementNotPresent cancelButton + assertElementNotPresent cancelButton assertTable( cellAddress, valuePattern ) @@ -436,8 +434,8 @@ Selenium Checks examples: - verifyVisible postcode - assertVisible postcode + verifyVisible postcode + assertVisible postcode assertNotVisible( elementLocator ) @@ -445,8 +443,8 @@ Selenium Checks examples: - verifyNotVisible postcode - assertNotVisible postcode + verifyNotVisible postcode + assertNotVisible postcode verifyEditable / assertEditable( inputLocator ) @@ -454,8 +452,8 @@ Selenium Checks examples: - verifyEditable shape - assertEditable colour + verifyEditable shape + assertEditable colour assertNotEditable( inputLocator ) @@ -473,8 +471,8 @@ Selenium Checks examples: - verifyAlert Invalid Phone Number - assertAlert Invalid Phone Number + verifyAlert Invalid Phone Number + assertAlert Invalid Phone Number assertConfirmation( messagePattern ) @@ -488,8 +486,8 @@ Selenium Checks examples: - assertConfirmation Remove this user? - verifyConfirmation Are you sure? + assertConfirmation Remove this user? + verifyConfirmation Are you sure? assertPrompt( messagePattern ) @@ -499,9 +497,9 @@ Selenium Checks examples: - answerOnNextPrompt Joe - click id=delegate - verifyPrompt Delegate to who? + answerOnNextPrompt Joe + click id=delegate + verifyPrompt Delegate to who? Parameter construction and Variables diff --git a/tests/test_tools/phpunit_bootstrap.php b/tests/test_tools/phpunit_bootstrap.php index 1154e5fc..c1cb423f 100644 --- a/tests/test_tools/phpunit_bootstrap.php +++ b/tests/test_tools/phpunit_bootstrap.php @@ -13,6 +13,8 @@ set_include_path(PRADO_FRAMEWORK_DIR.PATH_SEPARATOR.get_include_path()); // coverage tests waste a lot of memory! ini_set('memory_limit', '1G'); +date_default_timezone_set('UTC'); + if (!@include_once VENDOR_DIR.'/autoload.php') { die('You must set up the project dependencies, run the following commands: wget http://getcomposer.org/composer.phar @@ -22,4 +24,4 @@ if (!@include_once VENDOR_DIR.'/autoload.php') { require_once(PRADO_FRAMEWORK_DIR.'/prado.php'); // for FunctionalTests -require_once(__DIR__.'/PradoGenericSeleniumTest.php');
\ No newline at end of file +require_once(__DIR__.'/PradoGenericSelenium2Test.php');
\ No newline at end of file diff --git a/tests/test_tools/simpletest/HtmlReporterWithCoverage.php b/tests/test_tools/simpletest/HtmlReporterWithCoverage.php index abd10076..f3ae2391 100644 --- a/tests/test_tools/simpletest/HtmlReporterWithCoverage.php +++ b/tests/test_tools/simpletest/HtmlReporterWithCoverage.php @@ -1,11 +1,11 @@ <?php -if (!defined('T_ML_COMMENT')) +if (!defined('T_ML_COMMENT')) define('T_ML_COMMENT', T_COMMENT); -else +else define('T_DOC_COMMENT', T_ML_COMMENT); -class HtmlReporterWithCoverage extends HtmlReporter +class HtmlReporterWithCoverage extends HtmlReporter { protected $coverage = array(); @@ -19,7 +19,7 @@ class HtmlReporterWithCoverage extends HtmlReporter $this->base_dir = $base_dir; } - function paintHeader($test_name, $charset="UTF-8") + function paintHeader($test_name, $charset="UTF-8") { $this->sendNoCacheHeaders(); header('Content-Type: text/html; Charset='.$charset); @@ -31,30 +31,30 @@ class HtmlReporterWithCoverage extends HtmlReporter print "</head>\n<body>\n"; print "<h1>$test_name</h1>\n"; flush(); - - if (extension_loaded('xdebug')) + + if (extension_loaded('xdebug')) xdebug_start_code_coverage(XDEBUG_CC_UNUSED); - } + } /** * */ - function _getCss() + function _getCss() { $contents = parent::_getCss()."\n "; $contents .= ' - .bar { float: left; display: inline; border: 1px solid #eee; width: 300px; white-space: nowrap;} - .percentage { float: left; background-color: #eef; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 0.65em; padding: 5px; margin-right: } - .coverage {margin: 0.4em; } + .bar { float: left; display: inline; border: 1px solid #eee; width: 300px; white-space: nowrap;} + .percentage { float: left; background-color: #eef; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 0.65em; padding: 5px; margin-right: } + .coverage {margin: 0.4em; } .coverage a { padding-left: 0.5em; } - .coverage:after { - content: "."; - display: block; - height: 0; - clear: both; + .coverage:after { + content: "."; + display: block; + height: 0; + clear: both; visibility: hidden; } .coverage {display: inline-block;} @@ -66,9 +66,9 @@ class HtmlReporterWithCoverage extends HtmlReporter Return $contents; } - function paintFooter($test_name) + function paintFooter($test_name) { - if (extension_loaded('xdebug')) + if (extension_loaded('xdebug')) { $this->coverage = xdebug_get_code_coverage(); xdebug_stop_code_coverage(); @@ -93,10 +93,10 @@ class HtmlReporterWithCoverage extends HtmlReporter $dir = dirname(__FILE__); if(count($this->coverage) > 0) print '<h2>Code Coverage</h2>'; - - - ksort($this->coverage); - + + + ksort($this->coverage); + $details = array(); foreach($this->coverage as $file => $coverage) { @@ -110,7 +110,7 @@ class HtmlReporterWithCoverage extends HtmlReporter $width = $percentage * 3; $filename = str_replace($this->base_dir, '',$file); $link = $this->constructURL($filename, $coverage); - + $detail['total'] = $total; $detail['executed'] = $executed; $detail['width'] = $width; @@ -150,7 +150,7 @@ class HtmlReporterWithCoverage extends HtmlReporter } -class HTMLCoverageReport extends HtmlReporter +class HTMLCoverageReport extends HtmlReporter { protected $file; protected $lines; @@ -184,7 +184,7 @@ class HTMLCoverageReport extends HtmlReporter $this->paintFooter(); } - function paintHeader($file, $charset="UTF-8") + function paintHeader($file, $charset="UTF-8") { $total = $this->codelines($this->file); $executed = count($this->lines); @@ -218,21 +218,21 @@ class HTMLCoverageReport extends HtmlReporter $lines = ''; - foreach ($tokens as $token) + foreach ($tokens as $token) { - if (is_string($token)) + if (is_string($token)) { // simple 1-character token $lines .= $token; - } - else + } + else { // token array list($id, $text) = $token; - switch ($id) - { - case T_COMMENT: + switch ($id) + { + case T_COMMENT: case T_ML_COMMENT: // we've defined this case T_DOC_COMMENT: // and this // no action on comments @@ -265,4 +265,3 @@ class HTMLCoverageReport extends HtmlReporter } } -?> diff --git a/tests/test_tools/simpletest/authentication.php b/tests/test_tools/simpletest/authentication.php index cae366b3..86b68402 100644 --- a/tests/test_tools/simpletest/authentication.php +++ b/tests/test_tools/simpletest/authentication.php @@ -234,5 +234,4 @@ 'Authorization: Basic ' . base64_encode("$username:$password")); } } - } -?>
\ No newline at end of file + }
\ No newline at end of file diff --git a/tests/test_tools/simpletest/browser.php b/tests/test_tools/simpletest/browser.php index 44c8ddd4..410b18b9 100644 --- a/tests/test_tools/simpletest/browser.php +++ b/tests/test_tools/simpletest/browser.php @@ -220,7 +220,7 @@ function useFrames() { $this->_ignore_frames = false; } - + /** * Switches off cookie sending and recieving. * @access public @@ -228,7 +228,7 @@ function ignoreCookies() { $this->_user_agent->ignoreCookies(); } - + /** * Switches back on the cookie sending and recieving. * @access public @@ -257,7 +257,7 @@ } return $frameset; } - + /** * Assembles the parsing machinery and actually parses * a single page. Frees all of the builder memory and so @@ -1053,5 +1053,4 @@ } return $raw; } - } -?>
\ No newline at end of file + }
\ No newline at end of file diff --git a/tests/test_tools/simpletest/collector.php b/tests/test_tools/simpletest/collector.php index 5bcde179..ded847c9 100644 --- a/tests/test_tools/simpletest/collector.php +++ b/tests/test_tools/simpletest/collector.php @@ -1,12 +1,11 @@ <?php /** - * This file contains the following classes: {@link SimpleCollector}, + * This file contains the following classes: {@link SimpleCollector}, * {@link SimplePatternCollector}. - * + * * @author Travis Swicegood <development@domain51.com> * @package SimpleTest * @subpackage UnitTester - * @version $Id: collector.php 1398 2006-09-08 19:31:03Z xue $ */ /** @@ -17,7 +16,7 @@ * @subpackage UnitTester */ class SimpleCollector { - + /** * Strips off any kind of slash at the end so as to normalise the path * @@ -25,12 +24,12 @@ class SimpleCollector { */ function _removeTrailingSlash($path) { return preg_replace('|[\\/]$|', '', $path); - + /** * @internal * Try benchmarking the following. It's more code, but by not using the - * regex, it may be faster? Also, shouldn't be looking for - * DIRECTORY_SEPERATOR instead of a manual "/"? + * regex, it may be faster? Also, shouldn't be looking for + * DIRECTORY_SEPERATOR instead of a manual "/"? */ if (substr($path, -1) == DIRECTORY_SEPERATOR) { return substr($path, 0, -1); @@ -54,12 +53,12 @@ class SimpleCollector { closedir($handle); } } - + /** * This method determines what should be done with a given file and adds * it via {@link GroupTest::addTestFile()} if necessary. * - * This method should be overriden to provide custom matching criteria, + * This method should be overriden to provide custom matching criteria, * such as pattern matching, recursive matching, etc. For an example, see * {@link SimplePatternCollector::_handle()}. * @@ -85,8 +84,8 @@ class SimpleCollector { */ class SimplePatternCollector extends SimpleCollector { protected $_pattern; - - + + /** * * @param string $pattern Perl compatible regex to test name against @@ -96,8 +95,8 @@ class SimplePatternCollector extends SimpleCollector { function SimplePatternCollector($pattern = '/php$/i') { $this->_pattern = $pattern; } - - + + /** * Attempts to add files that match a given pattern. * @@ -111,5 +110,4 @@ class SimplePatternCollector extends SimpleCollector { parent::_handle($test, $filename); } } -} -?>
\ No newline at end of file +}
\ No newline at end of file diff --git a/tests/test_tools/simpletest/compatibility.php b/tests/test_tools/simpletest/compatibility.php index 92cf70d3..a181793e 100644 --- a/tests/test_tools/simpletest/compatibility.php +++ b/tests/test_tools/simpletest/compatibility.php @@ -181,4 +181,3 @@ return array(); } } -?> diff --git a/tests/test_tools/simpletest/cookies.php b/tests/test_tools/simpletest/cookies.php index 4a2b0d4e..eba8776e 100644 --- a/tests/test_tools/simpletest/cookies.php +++ b/tests/test_tools/simpletest/cookies.php @@ -11,7 +11,7 @@ */ require_once(dirname(__FILE__) . '/url.php'); /**#@-*/ - + /** * Cookie data holder. Cookie rules are full of pretty * arbitary stuff. I have used... @@ -27,7 +27,7 @@ protected $_path; protected $_expiry; protected $_is_secure; - + /** * Constructor. Sets the stored values. * @param string $name Cookie key. @@ -49,7 +49,7 @@ } $this->_is_secure = $is_secure; } - + /** * Sets the host. The cookie rules determine * that the first two parts are taken for @@ -67,7 +67,7 @@ } return false; } - + /** * Accessor for the truncated host to which this * cookie applies. @@ -77,7 +77,7 @@ function getHost() { return $this->_host; } - + /** * Test for a cookie being valid for a host name. * @param string $host Host to test against. @@ -87,7 +87,7 @@ function isValidHost($host) { return ($this->_truncateHost($host) === $this->getHost()); } - + /** * Extracts just the domain part that determines a * cookie's host validity. @@ -104,7 +104,7 @@ } return false; } - + /** * Accessor for name. * @return string Cookie key. @@ -113,7 +113,7 @@ function getName() { return $this->_name; } - + /** * Accessor for value. A deleted cookie will * have an empty string for this. @@ -123,7 +123,7 @@ function getValue() { return $this->_value; } - + /** * Accessor for path. * @return string Valid cookie path. @@ -132,7 +132,7 @@ function getPath() { return $this->_path; } - + /** * Tests a path to see if the cookie applies * there. The test path must be longer or @@ -147,7 +147,7 @@ $this->getPath(), strlen($this->getPath())) == 0); } - + /** * Accessor for expiry. * @return string Expiry string. @@ -159,7 +159,7 @@ } return gmdate("D, d M Y H:i:s", $this->_expiry) . " GMT"; } - + /** * Test to see if cookie is expired against * the cookie format time or timestamp. @@ -180,7 +180,7 @@ } return ($this->_expiry < $now); } - + /** * Ages the cookie by the specified number of * seconds. @@ -192,7 +192,7 @@ $this->_expiry -= $interval; } } - + /** * Accessor for the secure flag. * @return boolean True if cookie needs SSL. @@ -201,7 +201,7 @@ function isSecure() { return $this->_is_secure; } - + /** * Adds a trailing and leading slash to the path * if missing. @@ -218,7 +218,7 @@ return $path; } } - + /** * Repository for cookies. This stuff is a * tiny bit browser dependent. @@ -227,7 +227,7 @@ */ class SimpleCookieJar { protected $_cookies; - + /** * Constructor. Jar starts empty. * @access public @@ -235,7 +235,7 @@ function SimpleCookieJar() { $this->_cookies = array(); } - + /** * Removes expired and temporary cookies as if * the browser was closed and re-opened. @@ -258,7 +258,7 @@ } $this->_cookies = $surviving_cookies; } - + /** * Ages all cookies in the cookie jar. * @param integer $interval The old session is moved @@ -272,7 +272,7 @@ $this->_cookies[$i]->agePrematurely($interval); } } - + /** * Sets an additional cookie. If a cookie has * the same name and path it is replaced. @@ -290,7 +290,7 @@ } $this->_cookies[$this->_findFirstMatch($cookie)] = $cookie; } - + /** * Finds a matching cookie to write over or the * first empty slot if none. @@ -311,7 +311,7 @@ } return count($this->_cookies); } - + /** * Reads the most specific cookie value from the * browser cookies. Looks for the longest path that @@ -335,7 +335,7 @@ } return (isset($value) ? $value : false); } - + /** * Tests cookie for matching against search * criteria. @@ -359,7 +359,7 @@ } return true; } - + /** * Uses a URL to sift relevant cookies by host and * path. Results are list of strings of form "name=value". @@ -376,5 +376,4 @@ } return $pairs; } - } -?>
\ No newline at end of file + }
\ No newline at end of file diff --git a/tests/test_tools/simpletest/detached.php b/tests/test_tools/simpletest/detached.php index 1f3638bb..06665781 100644 --- a/tests/test_tools/simpletest/detached.php +++ b/tests/test_tools/simpletest/detached.php @@ -92,5 +92,4 @@ function &_createParser($reporter) { return new SimpleTestXmlParser($reporter); } - } -?>
\ No newline at end of file + }
\ No newline at end of file diff --git a/tests/test_tools/simpletest/dumper.php b/tests/test_tools/simpletest/dumper.php index a2ea30b0..9c3f745a 100644 --- a/tests/test_tools/simpletest/dumper.php +++ b/tests/test_tools/simpletest/dumper.php @@ -398,5 +398,4 @@ } return false; } - } -?>
\ No newline at end of file + }
\ No newline at end of file diff --git a/tests/test_tools/simpletest/encoding.php b/tests/test_tools/simpletest/encoding.php index 0dc9fbfa..ca2083a3 100644 --- a/tests/test_tools/simpletest/encoding.php +++ b/tests/test_tools/simpletest/encoding.php @@ -5,7 +5,7 @@ * @subpackage WebTester * @version $Id: encoding.php 1398 2006-09-08 19:31:03Z xue $ */ - + /**#@+ * include other SimpleTest class files */ @@ -20,7 +20,7 @@ class SimpleEncodedPair { protected $_key; protected $_value; - + /** * Stashes the data for rendering later. * @param string $key Form element name. @@ -30,7 +30,7 @@ $this->_key = $key; $this->_value = $value; } - + /** * The pair as a single string. * @return string Encoded pair. @@ -39,7 +39,7 @@ function asRequest() { return $this->_key . '=' . urlencode($this->_value); } - + /** * The MIME part as a string. * @return string MIME part encoding. @@ -51,7 +51,7 @@ $part .= "\r\n" . $this->_value; return $part; } - + /** * Is this the value we are looking for? * @param string $key Identifier. @@ -61,7 +61,7 @@ function isKey($key) { return $key == $this->_key; } - + /** * Is this the value we are looking for? * @return string Identifier. @@ -70,7 +70,7 @@ function getKey() { return $this->_key; } - + /** * Is this the value we are looking for? * @return string Content. @@ -90,7 +90,7 @@ protected $_key; protected $_content; protected $_filename; - + /** * Stashes the data for rendering later. * @param string $key Key to add value to. @@ -102,7 +102,7 @@ $this->_content = $content; $this->_filename = $filename; } - + /** * The pair as a single string. * @return string Encoded pair. @@ -111,7 +111,7 @@ function asRequest() { return ''; } - + /** * The MIME part as a string. * @return string MIME part encoding. @@ -125,7 +125,7 @@ $part .= "\r\n\r\n" . $this->_content; return $part; } - + /** * Attempts to figure out the MIME type from the * file extension and the content. @@ -138,7 +138,7 @@ } return 'application/octet-stream'; } - + /** * Tests each character is in the range 0-127. * @param string $ascii String to test. @@ -152,7 +152,7 @@ } return true; } - + /** * Is this the value we are looking for? * @param string $key Identifier. @@ -162,7 +162,7 @@ function isKey($key) { return $key == $this->_key; } - + /** * Is this the value we are looking for? * @return string Identifier. @@ -171,7 +171,7 @@ function getKey() { return $this->_key; } - + /** * Is this the value we are looking for? * @return string Content. @@ -190,7 +190,7 @@ */ class SimpleEncoding { protected $_request; - + /** * Starts empty. * @param array $query Hash of parameters. @@ -205,7 +205,7 @@ $this->clear(); $this->merge($query); } - + /** * Empties the request of parameters. * @access public @@ -213,7 +213,7 @@ function clear() { $this->_request = array(); } - + /** * Adds a parameter to the query. * @param string $key Key to add value to. @@ -232,7 +232,7 @@ $this->_addPair($key, $value); } } - + /** * Adds a new value into the request. * @param string $key Key to add value to. @@ -242,7 +242,7 @@ function _addPair($key, $value) { $this->_request[] = new SimpleEncodedPair($key, $value); } - + /** * Adds a MIME part to the query. Does nothing for a * form encoded packet. @@ -254,7 +254,7 @@ function attach($key, $content, $filename) { $this->_request[] = new SimpleAttachment($key, $content, $filename); } - + /** * Adds a set of parameters to this query. * @param array/SimpleQueryString $query Multiple values are @@ -270,7 +270,7 @@ } } } - + /** * Accessor for single value. * @return string/array False if missing, string @@ -293,7 +293,7 @@ return $values; } } - + /** * Accessor for listing of pairs. * @return array All pair objects. @@ -302,7 +302,7 @@ function getAll() { return $this->_request; } - + /** * Renders the query string as a URL encoded * request part. @@ -319,7 +319,7 @@ return implode('&', $statements); } } - + /** * Bundle of GET parameters. Can include * repeated parameters. @@ -327,7 +327,7 @@ * @subpackage WebTester */ class SimpleGetEncoding extends SimpleEncoding { - + /** * Starts empty. * @param array $query Hash of parameters. @@ -338,7 +338,7 @@ function SimpleGetEncoding($query = false) { $this->SimpleEncoding($query); } - + /** * HTTP request method. * @return string Always GET. @@ -347,7 +347,7 @@ function getMethod() { return 'GET'; } - + /** * Writes no extra headers. * @param SimpleSocket $socket Socket to write to. @@ -355,7 +355,7 @@ */ function writeHeadersTo($socket) { } - + /** * No data is sent to the socket as the data is encoded into * the URL. @@ -364,7 +364,7 @@ */ function writeTo($socket) { } - + /** * Renders the query string as a URL encoded * request part for attaching to a URL. @@ -375,14 +375,14 @@ return $this->_encode(); } } - + /** * Bundle of URL parameters for a HEAD request. * @package SimpleTest * @subpackage WebTester */ class SimpleHeadEncoding extends SimpleGetEncoding { - + /** * Starts empty. * @param array $query Hash of parameters. @@ -393,7 +393,7 @@ function SimpleHeadEncoding($query = false) { $this->SimpleGetEncoding($query); } - + /** * HTTP request method. * @return string Always HEAD. @@ -403,7 +403,7 @@ return 'HEAD'; } } - + /** * Bundle of POST parameters. Can include * repeated parameters. @@ -411,7 +411,7 @@ * @subpackage WebTester */ class SimplePostEncoding extends SimpleEncoding { - + /** * Starts empty. * @param array $query Hash of parameters. @@ -422,7 +422,7 @@ function SimplePostEncoding($query = false) { $this->SimpleEncoding($query); } - + /** * HTTP request method. * @return string Always POST. @@ -431,7 +431,7 @@ function getMethod() { return 'POST'; } - + /** * Dispatches the form headers down the socket. * @param SimpleSocket $socket Socket to write to. @@ -441,7 +441,7 @@ $socket->write("Content-Length: " . (integer)strlen($this->_encode()) . "\r\n"); $socket->write("Content-Type: application/x-www-form-urlencoded\r\n"); } - + /** * Dispatches the form data down the socket. * @param SimpleSocket $socket Socket to write to. @@ -450,7 +450,7 @@ function writeTo($socket) { $socket->write($this->_encode()); } - + /** * Renders the query string as a URL encoded * request part for attaching to a URL. @@ -461,7 +461,7 @@ return ''; } } - + /** * Bundle of POST parameters in the multipart * format. Can include file uploads. @@ -470,7 +470,7 @@ */ class SimpleMultipartEncoding extends SimplePostEncoding { protected $_boundary; - + /** * Starts empty. * @param array $query Hash of parameters. @@ -482,7 +482,7 @@ $this->SimplePostEncoding($query); $this->_boundary = ($boundary === false ? uniqid('st') : $boundary); } - + /** * Dispatches the form headers down the socket. * @param SimpleSocket $socket Socket to write to. @@ -492,7 +492,7 @@ $socket->write("Content-Length: " . (integer)strlen($this->_encode()) . "\r\n"); $socket->write("Content-Type: multipart/form-data, boundary=" . $this->_boundary . "\r\n"); } - + /** * Dispatches the form data down the socket. * @param SimpleSocket $socket Socket to write to. @@ -501,7 +501,7 @@ function writeTo($socket) { $socket->write($this->_encode()); } - + /** * Renders the query string as a URL encoded * request part. @@ -517,5 +517,4 @@ $stream .= "--" . $this->_boundary . "--\r\n"; return $stream; } - } -?>
\ No newline at end of file + }
\ No newline at end of file diff --git a/tests/test_tools/simpletest/errors.php b/tests/test_tools/simpletest/errors.php index a756bd7c..c10d68a5 100644 --- a/tests/test_tools/simpletest/errors.php +++ b/tests/test_tools/simpletest/errors.php @@ -178,5 +178,4 @@ $queue->add($severity, $message, $filename, $line, $super_globals); set_error_handler('simpleTestErrorHandler'); } - } -?>
\ No newline at end of file + }
\ No newline at end of file diff --git a/tests/test_tools/simpletest/exceptions.php b/tests/test_tools/simpletest/exceptions.php index 63558ad1..30d35386 100644 --- a/tests/test_tools/simpletest/exceptions.php +++ b/tests/test_tools/simpletest/exceptions.php @@ -42,5 +42,4 @@ $test_case->exception($exception); } } - } -?>
\ No newline at end of file + }
\ No newline at end of file diff --git a/tests/test_tools/simpletest/expectation.php b/tests/test_tools/simpletest/expectation.php index 8513aff4..a660fa9c 100644 --- a/tests/test_tools/simpletest/expectation.php +++ b/tests/test_tools/simpletest/expectation.php @@ -717,4 +717,3 @@ "] should contain method [$method]"; } } -?> diff --git a/tests/test_tools/simpletest/form.php b/tests/test_tools/simpletest/form.php index 0e6aea14..fba26bf6 100644 --- a/tests/test_tools/simpletest/form.php +++ b/tests/test_tools/simpletest/form.php @@ -5,7 +5,7 @@ * @subpackage WebTester * @version $Id: form.php 1398 2006-09-08 19:31:03Z xue $ */ - + /**#@+ * include SimpleTest files */ @@ -13,7 +13,7 @@ require_once(dirname(__FILE__) . '/encoding.php'); require_once(dirname(__FILE__) . '/selector.php'); /**#@-*/ - + /** * Form tag class to hold widget values. * @package SimpleTest @@ -30,7 +30,7 @@ protected $_widgets; protected $_radios; protected $_checkboxes; - + /** * Starts with no held controls/widgets. * @param SimpleTag $tag Form tag to read. @@ -48,7 +48,7 @@ $this->_radios = array(); $this->_checkboxes = array(); } - + /** * Creates the request packet to be sent by the form. * @param SimpleTag $tag Form tag to read. @@ -64,7 +64,7 @@ } return 'SimpleGetEncoding'; } - + /** * Sets the frame target within a frameset. * @param string $frame Name of frame. @@ -73,7 +73,7 @@ function setDefaultTarget($frame) { $this->_default_target = $frame; } - + /** * Accessor for method of form submission. * @return string Either get or post. @@ -82,7 +82,7 @@ function getMethod() { return ($this->_method ? strtolower($this->_method) : 'get'); } - + /** * Combined action attribute with current location * to get an absolute form target. @@ -97,7 +97,7 @@ $url = new SimpleUrl($action); return $url->makeAbsolute($base); } - + /** * Absolute URL of the target. * @return SimpleUrl URL target. @@ -110,7 +110,7 @@ } return $url; } - + /** * Creates the encoding for the current values in the * form. @@ -125,7 +125,7 @@ } return $encoding; } - + /** * ID field of form for unique identification. * @return string Unique tag ID. @@ -134,7 +134,7 @@ function getId() { return $this->_id; } - + /** * Adds a tag contents to the form. * @param SimpleWidget $tag Input tag to add. @@ -149,7 +149,7 @@ $this->_setWidget($tag); } } - + /** * Sets the widget into the form, grouping radio * buttons if any. @@ -165,7 +165,7 @@ $this->_widgets[] = $tag; } } - + /** * Adds a radio button, building a group if necessary. * @param SimpleRadioButtonTag $tag Incoming form control. @@ -178,7 +178,7 @@ } $this->_widgets[$this->_radios[$tag->getName()]]->addWidget($tag); } - + /** * Adds a checkbox, making it a group on a repeated name. * @param SimpleCheckboxTag $tag Incoming form control. @@ -198,7 +198,7 @@ $this->_widgets[$index]->addWidget($tag); } } - + /** * Extracts current value from form. * @param SimpleSelector $selector Criteria to apply. @@ -219,7 +219,7 @@ } return null; } - + /** * Sets a widget value within the form. * @param SimpleSelector $selector Criteria to apply. @@ -240,7 +240,7 @@ } return $success; } - + /** * Used by the page object to set widgets labels to * external label tags. @@ -257,7 +257,7 @@ } } } - + /** * Test to see if a form has a submit button. * @param SimpleSelector $selector Criteria to apply. @@ -272,7 +272,7 @@ } return false; } - + /** * Test to see if a form has an image control. * @param SimpleSelector $selector Criteria to apply. @@ -287,7 +287,7 @@ } return false; } - + /** * Gets the submit values for a selected button. * @param SimpleSelector $selector Criteria to apply. @@ -306,12 +306,12 @@ if ($additional) { $encoding->merge($additional); } - return $encoding; + return $encoding; } } return false; } - + /** * Gets the submit values for an image. * @param SimpleSelector $selector Criteria to apply. @@ -332,12 +332,12 @@ if ($additional) { $encoding->merge($additional); } - return $encoding; + return $encoding; } } return false; } - + /** * Simply submits the form without the submit button * value. Used when there is only one button or it @@ -349,4 +349,3 @@ return $this->_encode(); } } -?> diff --git a/tests/test_tools/simpletest/frames.php b/tests/test_tools/simpletest/frames.php index 60ced141..86e03157 100644 --- a/tests/test_tools/simpletest/frames.php +++ b/tests/test_tools/simpletest/frames.php @@ -584,5 +584,4 @@ } return null; } - } -?>
\ No newline at end of file + }
\ No newline at end of file diff --git a/tests/test_tools/simpletest/http.php b/tests/test_tools/simpletest/http.php index 9344a5b9..78c91b7e 100644 --- a/tests/test_tools/simpletest/http.php +++ b/tests/test_tools/simpletest/http.php @@ -13,7 +13,7 @@ require_once(dirname(__FILE__) . '/cookies.php'); require_once(dirname(__FILE__) . '/url.php'); /**#@-*/ - + /** * Creates HTTP headers for the end point of * a HTTP request. @@ -22,7 +22,7 @@ */ class SimpleRoute { protected $_url; - + /** * Sets the target URL. * @param SimpleUrl $url URL as object. @@ -31,7 +31,7 @@ function SimpleRoute($url) { $this->_url = $url; } - + /** * Resource name. * @return SimpleUrl Current url. @@ -40,7 +40,7 @@ function getUrl() { return $this->_url; } - + /** * Creates the first line which is the actual request. * @param string $method HTTP request method, usually GET. @@ -51,7 +51,7 @@ return $method . ' ' . $this->_url->getPath() . $this->_url->getEncodedRequest() . ' HTTP/1.0'; } - + /** * Creates the host part of the request. * @return string Host line content. @@ -64,7 +64,7 @@ } return $line; } - + /** * Opens a socket to the route. * @param string $method HTTP request method, usually GET. @@ -86,7 +86,7 @@ } return $socket; } - + /** * Factory for socket. * @param string $scheme Protocol to use. @@ -105,7 +105,7 @@ return $socket; } } - + /** * Creates HTTP headers for the end point of * a HTTP request via a proxy server. @@ -116,7 +116,7 @@ protected $_proxy; protected $_username; protected $_password; - + /** * Stashes the proxy address. * @param SimpleUrl $url URL as object. @@ -131,7 +131,7 @@ $this->_username = $username; $this->_password = $password; } - + /** * Creates the first line which is the actual request. * @param string $method HTTP request method, usually GET. @@ -146,7 +146,7 @@ return $method . ' ' . $scheme . '://' . $url->getHost() . $port . $url->getPath() . $url->getEncodedRequest() . ' HTTP/1.0'; } - + /** * Creates the host part of the request. * @param SimpleUrl $url URL as object. @@ -158,7 +158,7 @@ $port = $this->_proxy->getPort() ? $this->_proxy->getPort() : 8080; return "$host:$port"; } - + /** * Opens a socket to the route. * @param string $method HTTP request method, usually GET. @@ -198,7 +198,7 @@ protected $_encoding; protected $_headers; protected $_cookies; - + /** * Builds the socket request from the different pieces. * These include proxy information, URL, cookies, headers, @@ -214,7 +214,7 @@ $this->_headers = array(); $this->_cookies = array(); } - + /** * Dispatches the content to the route's socket. * @param integer $timeout Connection timeout. @@ -231,7 +231,7 @@ $response = $this->_createResponse($socket); return $response; } - + /** * Sends the headers. * @param SimpleSocket $socket Open socket. @@ -251,7 +251,7 @@ $socket->write("\r\n"); $encoding->writeTo($socket); } - + /** * Adds a header line to the request. * @param string $header_line Text of full header line. @@ -260,7 +260,7 @@ function addHeaderLine($header_line) { $this->_headers[] = $header_line; } - + /** * Reads all the relevant cookies from the * cookie jar. @@ -271,7 +271,7 @@ function readCookiesFromJar($jar, $url) { $this->_cookies = $jar->selectAsPairs($url); } - + /** * Wraps the socket in a response parser. * @param SimpleSocket $socket Responding socket. @@ -286,7 +286,7 @@ return $response; } } - + /** * Collection of header lines in the response. * @package SimpleTest @@ -301,7 +301,7 @@ protected $_cookies; protected $_authentication; protected $_realm; - + /** * Parses the incoming header block. * @param string $headers Header block. @@ -320,7 +320,7 @@ $this->_parseHeaderLine($header_line); } } - + /** * Accessor for parsed HTTP protocol version. * @return integer HTTP error code. @@ -329,7 +329,7 @@ function getHttpVersion() { return $this->_http_version; } - + /** * Accessor for raw header block. * @return string All headers as raw string. @@ -338,7 +338,7 @@ function getRaw() { return $this->_raw_headers; } - + /** * Accessor for parsed HTTP error code. * @return integer HTTP error code. @@ -347,7 +347,7 @@ function getResponseCode() { return (integer)$this->_response_code; } - + /** * Returns the redirected URL or false if * no redirection. @@ -357,7 +357,7 @@ function getLocation() { return $this->_location; } - + /** * Test to see if the response is a valid redirect. * @return boolean True if valid redirect. @@ -367,7 +367,7 @@ return in_array($this->_response_code, array(301, 302, 303, 307)) && (boolean)$this->getLocation(); } - + /** * Test to see if the response is an authentication * challenge. @@ -379,7 +379,7 @@ (boolean)$this->_authentication && (boolean)$this->_realm; } - + /** * Accessor for MIME type header information. * @return string MIME type. @@ -388,7 +388,7 @@ function getMimeType() { return $this->_mime_type; } - + /** * Accessor for authentication type. * @return string Type. @@ -397,7 +397,7 @@ function getAuthentication() { return $this->_authentication; } - + /** * Accessor for security realm. * @return string Realm. @@ -406,7 +406,7 @@ function getRealm() { return $this->_realm; } - + /** * Writes new cookies to the cookie jar. * @param SimpleCookieJar $jar Jar to write to. @@ -449,7 +449,7 @@ $this->_realm = trim($matches[2]); } } - + /** * Parse the Set-cookie content. * @param string $cookie_line Text after "Set-cookie:" @@ -472,7 +472,7 @@ isset($cookie["expires"]) ? $cookie["expires"] : false); } } - + /** * Basic HTTP response. * @package SimpleTest @@ -484,7 +484,7 @@ protected $_sent; protected $_content; protected $_headers; - + /** * Constructor. Reads and parses the incoming * content and headers. @@ -507,7 +507,7 @@ } $this->_parse($raw); } - + /** * Splits up the headers and the rest of the content. * @param string $raw Content to parse. @@ -525,7 +525,7 @@ $this->_headers = new SimpleHttpHeaders($headers); } } - + /** * Original request method. * @return string GET, POST or HEAD. @@ -534,7 +534,7 @@ function getMethod() { return $this->_encoding->getMethod(); } - + /** * Resource name. * @return SimpleUrl Current url. @@ -543,7 +543,7 @@ function getUrl() { return $this->_url; } - + /** * Original request data. * @return mixed Sent content. @@ -552,7 +552,7 @@ function getRequestData() { return $this->_encoding; } - + /** * Raw request that was sent down the wire. * @return string Bytes actually sent. @@ -561,7 +561,7 @@ function getSent() { return $this->_sent; } - + /** * Accessor for the content after the last * header line. @@ -571,7 +571,7 @@ function getContent() { return $this->_content; } - + /** * Accessor for header block. The response is the * combination of this and the content. @@ -581,7 +581,7 @@ function getHeaders() { return $this->_headers; } - + /** * Accessor for any new cookies. * @return array List of new cookies. @@ -590,7 +590,7 @@ function getNewCookies() { return $this->_headers->getNewCookies(); } - + /** * Reads the whole of the socket output into a * single string. @@ -606,7 +606,7 @@ } return $all; } - + /** * Test to see if the packet from the socket is the * last one. @@ -620,5 +620,4 @@ } return ! $packet; } - } -?>
\ No newline at end of file + }
\ No newline at end of file diff --git a/tests/test_tools/simpletest/invoker.php b/tests/test_tools/simpletest/invoker.php index d5bf4996..dfe9263c 100644 --- a/tests/test_tools/simpletest/invoker.php +++ b/tests/test_tools/simpletest/invoker.php @@ -136,4 +136,3 @@ $this->_invoker->after($method); } } -?> diff --git a/tests/test_tools/simpletest/mock_objects.php b/tests/test_tools/simpletest/mock_objects.php index 1636600e..b63d1760 100644 --- a/tests/test_tools/simpletest/mock_objects.php +++ b/tests/test_tools/simpletest/mock_objects.php @@ -1269,5 +1269,4 @@ } return $code; } - } -?>
\ No newline at end of file + }
\ No newline at end of file diff --git a/tests/test_tools/simpletest/options.php b/tests/test_tools/simpletest/options.php index da4d8b2f..23008ff9 100644 --- a/tests/test_tools/simpletest/options.php +++ b/tests/test_tools/simpletest/options.php @@ -363,4 +363,3 @@ return array(); } } -?> diff --git a/tests/test_tools/simpletest/page.php b/tests/test_tools/simpletest/page.php index eeae0cc9..7d0ac7b8 100644 --- a/tests/test_tools/simpletest/page.php +++ b/tests/test_tools/simpletest/page.php @@ -128,7 +128,7 @@ function SimplePageBuilder() { $this->SimpleSaxListener(); } - + /** * Frees up any references so as to allow the PHP garbage * collection from unset() to work. @@ -177,7 +177,7 @@ $parser = new SimpleHtmlSaxParser($listener); return $parser; } - + /** * Start of element event. Opens a new tag. * @param string $name Element name. @@ -972,4 +972,3 @@ return null; } } -?> diff --git a/tests/test_tools/simpletest/parser.php b/tests/test_tools/simpletest/parser.php index d6c10579..94fd40d0 100644 --- a/tests/test_tools/simpletest/parser.php +++ b/tests/test_tools/simpletest/parser.php @@ -769,5 +769,4 @@ */ function addContent($text) { } - } -?>
\ No newline at end of file + }
\ No newline at end of file diff --git a/tests/test_tools/simpletest/reflection_php4.php b/tests/test_tools/simpletest/reflection_php4.php index 4af685ec..df9c76cc 100644 --- a/tests/test_tools/simpletest/reflection_php4.php +++ b/tests/test_tools/simpletest/reflection_php4.php @@ -111,5 +111,4 @@ function getSignature($method) { return "function $method()"; } - } -?>
\ No newline at end of file + }
\ No newline at end of file diff --git a/tests/test_tools/simpletest/reflection_php5.php b/tests/test_tools/simpletest/reflection_php5.php index 58a30856..6d2ad360 100644 --- a/tests/test_tools/simpletest/reflection_php5.php +++ b/tests/test_tools/simpletest/reflection_php5.php @@ -124,7 +124,7 @@ } return array_unique($methods); } - + /** * Checks to see if the method signature has to be tightly * specified. @@ -207,7 +207,7 @@ } return "function $name()"; } - + /** * For a signature specified in an interface, full * details must be replicated to be a valid implementation. @@ -271,5 +271,4 @@ } return false; } - } -?>
\ No newline at end of file + }
\ No newline at end of file diff --git a/tests/test_tools/simpletest/remote.php b/tests/test_tools/simpletest/remote.php index 7e6898cb..1868733d 100644 --- a/tests/test_tools/simpletest/remote.php +++ b/tests/test_tools/simpletest/remote.php @@ -23,7 +23,7 @@ protected $_url; protected $_dry_url; protected $_size; - + /** * Sets the location of the remote test. * @param string $url Test location. @@ -35,7 +35,7 @@ $this->_dry_url = $dry_url ? $dry_url : $url; $this->_size = false; } - + /** * Accessor for the test name for subclasses. * @return string Name of the test. @@ -67,7 +67,7 @@ } return true; } - + /** * Creates a new web browser object for fetching * the XML report. @@ -77,7 +77,7 @@ function &_createBrowser() { return new SimpleBrowser(); } - + /** * Creates the XML parser. * @param SimpleReporter $reporter Target of test results. @@ -87,7 +87,7 @@ function &_createParser($reporter) { return new SimpleTestXmlParser($reporter); } - + /** * Accessor for the number of subtests. * @return integer Number of test cases. @@ -111,5 +111,4 @@ } return $this->_size; } - } -?>
\ No newline at end of file + }
\ No newline at end of file diff --git a/tests/test_tools/simpletest/reporter.php b/tests/test_tools/simpletest/reporter.php index c8c1639d..a6b5a85a 100644 --- a/tests/test_tools/simpletest/reporter.php +++ b/tests/test_tools/simpletest/reporter.php @@ -363,5 +363,4 @@ $this->_within_test_case = false; } } - } -?>
\ No newline at end of file + }
\ No newline at end of file diff --git a/tests/test_tools/simpletest/runner.php b/tests/test_tools/simpletest/runner.php index 57939f7a..d7303895 100644 --- a/tests/test_tools/simpletest/runner.php +++ b/tests/test_tools/simpletest/runner.php @@ -5,7 +5,7 @@ * @subpackage UnitTester * @version $Id: runner.php 1398 2006-09-08 19:31:03Z xue $ */ - + /**#@+ * Includes SimpleTest files and defined the root constant * for dependent libraries. @@ -19,7 +19,7 @@ define('SIMPLE_TEST', dirname(__FILE__) . '/'); } /**#@-*/ - + /** * This is called by the class runner to run a * single test method. Will also run the setUp() @@ -29,7 +29,7 @@ */ class SimpleInvoker { protected $_test_case; - + /** * Stashes the test case for later. * @param SimpleTestCase $test_case Test case to run. @@ -37,7 +37,7 @@ function SimpleInvoker($test_case) { $this->_test_case = $test_case; } - + /** * Accessor for test case being run. * @return SimpleTestCase Test case. @@ -46,7 +46,7 @@ function getTestCase() { return $this->_test_case; } - + /** * Invokes a test method and buffered with setUp() * and tearDown() calls. @@ -59,7 +59,7 @@ $this->_test_case->tearDown(); } } - + /** * Do nothing decorator. Just passes the invocation * straight through. @@ -68,7 +68,7 @@ */ class SimpleInvokerDecorator { protected $_invoker; - + /** * Stores the invoker to wrap. * @param SimpleInvoker $invoker Test method runner. @@ -76,7 +76,7 @@ function SimpleInvokerDecorator($invoker) { $this->_invoker = $invoker; } - + /** * Accessor for test case being run. * @return SimpleTestCase Test case. @@ -85,7 +85,7 @@ function getTestCase() { return $this->_invoker->getTestCase(); } - + /** * Invokes a test method and buffered with setUp() * and tearDown() calls. @@ -103,7 +103,7 @@ * @subpackage UnitTester */ class SimpleErrorTrappingInvoker extends SimpleInvokerDecorator { - + /** /** * Stores the invoker to wrap. @@ -112,7 +112,7 @@ function SimpleErrorTrappingInvoker($invoker) { $this->SimpleInvokerDecorator($invoker); } - + /** * Invokes a test method and dispatches any * untrapped errors. Called back from @@ -142,7 +142,7 @@ class SimpleRunner { protected $_test_case; protected $_scorer; - + /** * Takes in the test case and reporter to mediate between. * @param SimpleTestCase $test_case Test case to run. @@ -152,7 +152,7 @@ $this->_test_case = $test_case; $this->_scorer = $scorer; } - + /** * Accessor for test case being run. * @return SimpleTestCase Test case. @@ -161,7 +161,7 @@ function getTestCase() { return $this->_test_case; } - + /** * Runs the test methods in the test case. * @param SimpleTest $test_case Test case to run test on. @@ -185,7 +185,7 @@ $this->_scorer->paintMethodEnd($method); } } - + /** * Tests to see if the method is the constructor and * so should be ignored. @@ -198,7 +198,7 @@ $this->_test_case, strtolower($method)); } - + /** * Tests to see if the method is a test that should * be run. Currently any method that starts with 'test' @@ -219,7 +219,7 @@ function paintMethodStart($test_name) { $this->_scorer->paintMethodStart($test_name); } - + /** * Paints the end of a test method. * @param string $test_name Name of test or other label. @@ -228,7 +228,7 @@ function paintMethodEnd($test_name) { $this->_scorer->paintMethodEnd($test_name); } - + /** * Chains to the wrapped reporter. * @param string $message Message is ignored. @@ -237,7 +237,7 @@ function paintPass($message) { $this->_scorer->paintPass($message); } - + /** * Chains to the wrapped reporter. * @param string $message Message is ignored. @@ -246,7 +246,7 @@ function paintFail($message) { $this->_scorer->paintFail($message); } - + /** * Chains to the wrapped reporter. * @param string $message Text of error formatted by @@ -256,7 +256,7 @@ function paintError($message) { $this->_scorer->paintError($message); } - + /** * Chains to the wrapped reporter. * @param Exception $exception Object thrown. @@ -265,7 +265,7 @@ function paintException($exception) { $this->_scorer->paintException($exception); } - + /** * Chains to the wrapped reporter. * @param string $message Text to display. @@ -274,7 +274,7 @@ function paintMessage($message) { $this->_scorer->paintMessage($message); } - + /** * Chains to the wrapped reporter. * @param string $message Text to display. @@ -283,7 +283,7 @@ function paintFormattedMessage($message) { $this->_scorer->paintFormattedMessage($message); } - + /** * Chains to the wrapped reporter. * @param string $type Event type as text. @@ -297,4 +297,3 @@ $this->_scorer->paintSignal($type, $payload); } } -?> diff --git a/tests/test_tools/simpletest/scorer.php b/tests/test_tools/simpletest/scorer.php index 2c81c954..48b7162b 100644 --- a/tests/test_tools/simpletest/scorer.php +++ b/tests/test_tools/simpletest/scorer.php @@ -773,5 +773,4 @@ $this->_reporters[$i]->paintSignal($type, $payload); } } - } -?>
\ No newline at end of file + }
\ No newline at end of file diff --git a/tests/test_tools/simpletest/selector.php b/tests/test_tools/simpletest/selector.php index 901815ad..6af21ff6 100644 --- a/tests/test_tools/simpletest/selector.php +++ b/tests/test_tools/simpletest/selector.php @@ -129,5 +129,4 @@ } return ($widget->getName() == $this->_label); } - } -?>
\ No newline at end of file + }
\ No newline at end of file diff --git a/tests/test_tools/simpletest/shell_tester.php b/tests/test_tools/simpletest/shell_tester.php index 5719e9d3..5ac6013d 100644 --- a/tests/test_tools/simpletest/shell_tester.php +++ b/tests/test_tools/simpletest/shell_tester.php @@ -127,7 +127,7 @@ $shell = $this->_getShell(); return $shell->getOutputAsList(); } - + /** * Will trigger a pass if the two parameters have * the same value only. Otherwise a fail. This @@ -144,7 +144,7 @@ $second, $message); } - + /** * Will trigger a pass if the two parameters have * a different value. Otherwise a fail. This @@ -302,5 +302,4 @@ $shell = new SimpleShell(); return $shell; } - } -?>
\ No newline at end of file + }
\ No newline at end of file diff --git a/tests/test_tools/simpletest/simple_test.php b/tests/test_tools/simpletest/simple_test.php index 3bb1d40e..cc39a08b 100644 --- a/tests/test_tools/simpletest/simple_test.php +++ b/tests/test_tools/simpletest/simple_test.php @@ -550,4 +550,3 @@ return 0; } } -?> diff --git a/tests/test_tools/simpletest/simpletest.php b/tests/test_tools/simpletest/simpletest.php index f859ac0f..df1536ac 100644 --- a/tests/test_tools/simpletest/simpletest.php +++ b/tests/test_tools/simpletest/simpletest.php @@ -278,5 +278,4 @@ function getDefaultProxyPassword() { return Simpletest::getDefaultProxyPassword(); } - } -?>
\ No newline at end of file + }
\ No newline at end of file diff --git a/tests/test_tools/simpletest/socket.php b/tests/test_tools/simpletest/socket.php index 7b47aa9c..cfeed48a 100644 --- a/tests/test_tools/simpletest/socket.php +++ b/tests/test_tools/simpletest/socket.php @@ -212,5 +212,4 @@ function _openSocket($host, $port, $error_number, $error, $timeout) { return parent::_openSocket("tls://$host", $port, $error_number, $error, $timeout); } - } -?>
\ No newline at end of file + }
\ No newline at end of file diff --git a/tests/test_tools/simpletest/tag.php b/tests/test_tools/simpletest/tag.php index 5d8de890..46fb740a 100644 --- a/tests/test_tools/simpletest/tag.php +++ b/tests/test_tools/simpletest/tag.php @@ -5,14 +5,14 @@ * @subpackage WebTester * @version $Id: tag.php 1398 2006-09-08 19:31:03Z xue $ */ - + /**#@+ * include SimpleTest files */ require_once(dirname(__FILE__) . '/parser.php'); require_once(dirname(__FILE__) . '/encoding.php'); /**#@-*/ - + /** * HTML or XML tag. * @package SimpleTest @@ -22,7 +22,7 @@ protected $_name; protected $_attributes; protected $_content; - + /** * Starts with a named tag with attributes only. * @param string $name Tag name. @@ -36,7 +36,7 @@ $this->_attributes = $attributes; $this->_content = ''; } - + /** * Check to see if the tag can have both start and * end tags with content in between. @@ -46,7 +46,7 @@ function expectEndTag() { return true; } - + /** * The current tag should not swallow all content for * itself as it's searchable page content. Private @@ -68,7 +68,7 @@ function addContent($content) { $this->_content .= (string)$content; } - + /** * Adds an enclosed tag to the content. * @param SimpleTag $tag New tag. @@ -76,7 +76,7 @@ */ function addTag($tag) { } - + /** * Accessor for tag name. * @return string Name of tag. @@ -85,7 +85,7 @@ function getTagName() { return $this->_name; } - + /** * List of legal child elements. * @return array List of element names. @@ -94,7 +94,7 @@ function getChildElements() { return array(); } - + /** * Accessor for an attribute. * @param string $label Attribute name. @@ -108,7 +108,7 @@ } return (string)$this->_attributes[$label]; } - + /** * Sets an attribute. * @param string $label Attribute name. @@ -118,7 +118,7 @@ function _setAttribute($label, $value) { $this->_attributes[strtolower($label)] = $value; } - + /** * Accessor for the whole content so far. * @return string Content as big raw string. @@ -127,7 +127,7 @@ function getContent() { return $this->_content; } - + /** * Accessor for content reduced to visible text. Acts * like a text mode browser, normalising space and @@ -138,7 +138,7 @@ function getText() { return SimpleHtmlSaxParser::normalise($this->_content); } - + /** * Test to see if id attribute matches. * @param string $id ID to test against. @@ -149,14 +149,14 @@ return ($this->getAttribute('id') == $id); } } - + /** * Page title. * @package SimpleTest * @subpackage WebTester */ class SimpleTitleTag extends SimpleTag { - + /** * Starts with a named tag with attributes only. * @param hash $attributes Attribute names and @@ -166,14 +166,14 @@ $this->SimpleTag('title', $attributes); } } - + /** * Link. * @package SimpleTest * @subpackage WebTester */ class SimpleAnchorTag extends SimpleTag { - + /** * Starts with a named tag with attributes only. * @param hash $attributes Attribute names and @@ -182,7 +182,7 @@ function SimpleAnchorTag($attributes) { $this->SimpleTag('a', $attributes); } - + /** * Accessor for URL as string. * @return string Coerced as string. @@ -196,7 +196,7 @@ return $url; } } - + /** * Form element. * @package SimpleTest @@ -206,7 +206,7 @@ protected $_value; protected $_label; protected $_is_set; - + /** * Starts with a named tag with attributes only. * @param string $name Tag name. @@ -219,7 +219,7 @@ $this->_label = false; $this->_is_set = false; } - + /** * Accessor for name submitted as the key in * GET/POST variables hash. @@ -229,7 +229,7 @@ function getName() { return $this->getAttribute('name'); } - + /** * Accessor for default value parsed with the tag. * @return string Parsed value. @@ -238,7 +238,7 @@ function getDefault() { return $this->getAttribute('value'); } - + /** * Accessor for currently set value or default if * none. @@ -252,7 +252,7 @@ } return $this->_value; } - + /** * Sets the current form element value. * @param string $value New value. @@ -264,7 +264,7 @@ $this->_is_set = true; return true; } - + /** * Resets the form element value back to the * default. @@ -273,7 +273,7 @@ function resetValue() { $this->_is_set = false; } - + /** * Allows setting of a label externally, say by a * label tag. @@ -283,7 +283,7 @@ function setLabel($label) { $this->_label = trim($label); } - + /** * Reads external or internal label. * @param string $label Label to test. @@ -293,7 +293,7 @@ function isLabel($label) { return $this->_label == trim($label); } - + /** * Dispatches the value into the form encoded packet. * @param SimpleEncoding $encoding Form packet. @@ -305,14 +305,14 @@ } } } - + /** * Text, password and hidden field. * @package SimpleTest * @subpackage WebTester */ class SimpleTextTag extends SimpleWidget { - + /** * Starts with a named tag with attributes only. * @param hash $attributes Attribute names and @@ -324,7 +324,7 @@ $this->_setAttribute('value', ''); } } - + /** * Tag contains no content. * @return boolean False. @@ -333,7 +333,7 @@ function expectEndTag() { return false; } - + /** * Sets the current form element value. Cannot * change the value of a hidden field. @@ -348,14 +348,14 @@ return parent::setValue($value); } } - + /** * Submit button as input tag. * @package SimpleTest * @subpackage WebTester */ class SimpleSubmitTag extends SimpleWidget { - + /** * Starts with a named tag with attributes only. * @param hash $attributes Attribute names and @@ -367,7 +367,7 @@ $this->_setAttribute('value', 'Submit'); } } - + /** * Tag contains no end element. * @return boolean False. @@ -376,7 +376,7 @@ function expectEndTag() { return false; } - + /** * Disables the setting of the button value. * @param string $value Ignored. @@ -386,7 +386,7 @@ function setValue($value) { return false; } - + /** * Value of browser visible text. * @return string Visible label. @@ -395,7 +395,7 @@ function getLabel() { return $this->getValue(); } - + /** * Test for a label match when searching. * @param string $label Label to test. @@ -406,14 +406,14 @@ return trim($label) == trim($this->getLabel()); } } - + /** * Image button as input tag. * @package SimpleTest * @subpackage WebTester */ class SimpleImageSubmitTag extends SimpleWidget { - + /** * Starts with a named tag with attributes only. * @param hash $attributes Attribute names and @@ -422,7 +422,7 @@ function SimpleImageSubmitTag($attributes) { $this->SimpleWidget('input', $attributes); } - + /** * Tag contains no end element. * @return boolean False. @@ -431,7 +431,7 @@ function expectEndTag() { return false; } - + /** * Disables the setting of the button value. * @param string $value Ignored. @@ -441,7 +441,7 @@ function setValue($value) { return false; } - + /** * Value of browser visible text. * @return string Visible label. @@ -453,7 +453,7 @@ } return $this->getAttribute('alt'); } - + /** * Test for a label match when searching. * @param string $label Label to test. @@ -463,7 +463,7 @@ function isLabel($label) { return trim($label) == trim($this->getLabel()); } - + /** * Dispatches the value into the form encoded packet. * @param SimpleEncoding $encoding Form packet. @@ -481,14 +481,14 @@ } } } - + /** * Submit button as button tag. * @package SimpleTest * @subpackage WebTester */ class SimpleButtonTag extends SimpleWidget { - + /** * Starts with a named tag with attributes only. * Defaults are very browser dependent. @@ -498,7 +498,7 @@ function SimpleButtonTag($attributes) { $this->SimpleWidget('button', $attributes); } - + /** * Check to see if the tag can have both start and * end tags with content in between. @@ -508,7 +508,7 @@ function expectEndTag() { return true; } - + /** * Disables the setting of the button value. * @param string $value Ignored. @@ -518,7 +518,7 @@ function setValue($value) { return false; } - + /** * Value of browser visible text. * @return string Visible label. @@ -527,7 +527,7 @@ function getLabel() { return $this->getContent(); } - + /** * Test for a label match when searching. * @param string $label Label to test. @@ -538,14 +538,14 @@ return trim($label) == trim($this->getLabel()); } } - + /** * Content tag for text area. * @package SimpleTest * @subpackage WebTester */ class SimpleTextAreaTag extends SimpleWidget { - + /** * Starts with a named tag with attributes only. * @param hash $attributes Attribute names and @@ -554,7 +554,7 @@ function SimpleTextAreaTag($attributes) { $this->SimpleWidget('textarea', $attributes); } - + /** * Accessor for starting value. * @return string Parsed value. @@ -563,7 +563,7 @@ function getDefault() { return $this->_wrap(SimpleHtmlSaxParser::decodeHtml($this->getContent())); } - + /** * Applies word wrapping if needed. * @param string $value New value. @@ -573,7 +573,7 @@ function setValue($value) { return parent::setValue($this->_wrap($value)); } - + /** * Test to see if text should be wrapped. * @return boolean True if wrapping on. @@ -588,7 +588,7 @@ } return false; } - + /** * Performs the formatting that is peculiar to * this tag. There is strange behaviour in this @@ -613,7 +613,7 @@ } return $text; } - + /** * The content of textarea is not part of the page. * @return boolean True. @@ -623,14 +623,14 @@ return true; } } - + /** * File upload widget. * @package SimpleTest * @subpackage WebTester */ class SimpleUploadTag extends SimpleWidget { - + /** * Starts with attributes only. * @param hash $attributes Attribute names and @@ -639,7 +639,7 @@ function SimpleUploadTag($attributes) { $this->SimpleWidget('input', $attributes); } - + /** * Tag contains no content. * @return boolean False. @@ -648,7 +648,7 @@ function expectEndTag() { return false; } - + /** * Dispatches the value into the form encoded packet. * @param SimpleEncoding $encoding Form packet. @@ -664,7 +664,7 @@ basename($this->getValue())); } } - + /** * Drop down widget. * @package SimpleTest @@ -673,7 +673,7 @@ class SimpleSelectionTag extends SimpleWidget { protected $_options; protected $_choice; - + /** * Starts with attributes only. * @param hash $attributes Attribute names and @@ -684,7 +684,7 @@ $this->_options = array(); $this->_choice = false; } - + /** * Adds an option tag to a selection field. * @param SimpleOptionTag $tag New option. @@ -695,7 +695,7 @@ $this->_options[] = $tag; } } - + /** * Text within the selection element is ignored. * @param string $content Ignored. @@ -703,7 +703,7 @@ */ function addContent($content) { } - + /** * Scans options for defaults. If none, then * the first option is selected. @@ -721,7 +721,7 @@ } return ''; } - + /** * Can only set allowed values. * @param string $value New choice. @@ -737,7 +737,7 @@ } return false; } - + /** * Accessor for current selection value. * @return string Value attribute or @@ -751,7 +751,7 @@ return $this->_options[$this->_choice]->getValue(); } } - + /** * Drop down widget. * @package SimpleTest @@ -760,7 +760,7 @@ class MultipleSelectionTag extends SimpleWidget { protected $_options; protected $_values; - + /** * Starts with attributes only. * @param hash $attributes Attribute names and @@ -771,7 +771,7 @@ $this->_options = array(); $this->_values = false; } - + /** * Adds an option tag to a selection field. * @param SimpleOptionTag $tag New option. @@ -782,7 +782,7 @@ $this->_options[] = $tag; } } - + /** * Text within the selection element is ignored. * @param string $content Ignored. @@ -790,7 +790,7 @@ */ function addContent($content) { } - + /** * Scans options for defaults to populate the * value array(). @@ -806,7 +806,7 @@ } return $default; } - + /** * Can only set allowed values. Any illegal value * will result in a failure, but all correct values @@ -833,7 +833,7 @@ $this->_values = $achieved; return true; } - + /** * Accessor for current selection value. * @return array List of currently set options. @@ -846,21 +846,21 @@ return $this->_values; } } - + /** * Option for selection field. * @package SimpleTest * @subpackage WebTester */ class SimpleOptionTag extends SimpleWidget { - + /** * Stashes the attributes. */ function SimpleOptionTag($attributes) { $this->SimpleWidget('option', $attributes); } - + /** * Does nothing. * @param string $value Ignored. @@ -870,7 +870,7 @@ function setValue($value) { return false; } - + /** * Test to see if a value matches the option. * @param string $compare Value to compare with. @@ -884,7 +884,7 @@ } return trim($this->getContent()) == $compare; } - + /** * Accessor for starting value. Will be set to * the option label if no value exists. @@ -897,7 +897,7 @@ } return $this->getAttribute('value'); } - + /** * The content of options is not part of the page. * @return boolean True. @@ -907,14 +907,14 @@ return true; } } - + /** * Radio button. * @package SimpleTest * @subpackage WebTester */ class SimpleRadioButtonTag extends SimpleWidget { - + /** * Stashes the attributes. * @param array $attributes Hash of attributes. @@ -925,7 +925,7 @@ $this->_setAttribute('value', 'on'); } } - + /** * Tag contains no content. * @return boolean False. @@ -934,7 +934,7 @@ function expectEndTag() { return false; } - + /** * The only allowed value sn the one in the * "value" attribute. @@ -951,7 +951,7 @@ } return parent::setValue($value); } - + /** * Accessor for starting value. * @return string Parsed value. @@ -964,14 +964,14 @@ return false; } } - + /** * Checkbox widget. * @package SimpleTest * @subpackage WebTester */ class SimpleCheckboxTag extends SimpleWidget { - + /** * Starts with attributes only. * @param hash $attributes Attribute names and @@ -983,7 +983,7 @@ $this->_setAttribute('value', 'on'); } } - + /** * Tag contains no content. * @return boolean False. @@ -992,7 +992,7 @@ function expectEndTag() { return false; } - + /** * The only allowed value in the one in the * "value" attribute. The default for this @@ -1014,7 +1014,7 @@ } return parent::setValue($value); } - + /** * Accessor for starting value. The default * value is "on". @@ -1028,7 +1028,7 @@ return false; } } - + /** * A group of multiple widgets with some shared behaviour. * @package SimpleTest @@ -1045,7 +1045,7 @@ function addWidget($widget) { $this->_widgets[] = $widget; } - + /** * Accessor to widget set. * @return array All widgets. @@ -1064,7 +1064,7 @@ function getAttribute($label) { return false; } - + /** * Fetches the name for the widget from the first * member. @@ -1076,7 +1076,7 @@ return $this->_widgets[0]->getName(); } } - + /** * Scans the widgets for one with the appropriate * ID field. @@ -1092,7 +1092,7 @@ } return false; } - + /** * Scans the widgets for one with the appropriate * attached label. @@ -1108,7 +1108,7 @@ } return false; } - + /** * Dispatches the value into the form encoded packet. * @param SimpleEncoding $encoding Form packet. @@ -1125,7 +1125,7 @@ * @subpackage WebTester */ class SimpleCheckboxGroup extends SimpleTagGroup { - + /** * Accessor for current selected widget or false * if none. @@ -1142,7 +1142,7 @@ } return $this->_coerceValues($values); } - + /** * Accessor for starting value that is active. * @return string/array Widget values or false if none. @@ -1158,7 +1158,7 @@ } return $this->_coerceValues($values); } - + /** * Accessor for current set values. * @param string/array/boolean $values Either a single string, a @@ -1182,7 +1182,7 @@ } return true; } - + /** * Tests to see if a possible value set is legal. * @param string/array/boolean $values Either a single string, a @@ -1202,7 +1202,7 @@ } return ($values == $matches); } - + /** * Converts the output to an appropriate format. This means * that no values is false, a single value is just that @@ -1220,7 +1220,7 @@ return $values; } } - + /** * Converts false or string into array. The opposite of * the coercian method. @@ -1248,7 +1248,7 @@ * @subpackage WebTester */ class SimpleRadioGroup extends SimpleTagGroup { - + /** * Each tag is tried in turn until one is * successfully set. The others will be @@ -1270,7 +1270,7 @@ } return true; } - + /** * Tests to see if a value is allowed. * @param string Attempted value. @@ -1286,7 +1286,7 @@ } return false; } - + /** * Accessor for current selected widget or false * if none. @@ -1303,7 +1303,7 @@ } return false; } - + /** * Accessor for starting value that is active. * @return string/boolean Value of first checked @@ -1320,14 +1320,14 @@ return false; } } - + /** * Tag to keep track of labels. * @package SimpleTest * @subpackage WebTester */ class SimpleLabelTag extends SimpleTag { - + /** * Starts with a named tag with attributes only. * @param hash $attributes Attribute names and @@ -1336,7 +1336,7 @@ function SimpleLabelTag($attributes) { $this->SimpleTag('label', $attributes); } - + /** * Access for the ID to attach the label to. * @return string For attribute. @@ -1346,14 +1346,14 @@ return $this->getAttribute('for'); } } - + /** * Tag to aid parsing the form. * @package SimpleTest * @subpackage WebTester */ class SimpleFormTag extends SimpleTag { - + /** * Starts with a named tag with attributes only. * @param hash $attributes Attribute names and @@ -1363,14 +1363,14 @@ $this->SimpleTag('form', $attributes); } } - + /** * Tag to aid parsing the frames in a page. * @package SimpleTest * @subpackage WebTester */ class SimpleFrameTag extends SimpleTag { - + /** * Starts with a named tag with attributes only. * @param hash $attributes Attribute names and @@ -1379,7 +1379,7 @@ function SimpleFrameTag($attributes) { $this->SimpleTag('frame', $attributes); } - + /** * Tag contains no content. * @return boolean False. @@ -1388,5 +1388,4 @@ function expectEndTag() { return false; } - } -?>
\ No newline at end of file + }
\ No newline at end of file diff --git a/tests/test_tools/simpletest/test_case.php b/tests/test_tools/simpletest/test_case.php index 91a356d8..74253d80 100644 --- a/tests/test_tools/simpletest/test_case.php +++ b/tests/test_tools/simpletest/test_case.php @@ -687,4 +687,3 @@ return 0; } } -?> diff --git a/tests/test_tools/simpletest/unit_tester.php b/tests/test_tools/simpletest/unit_tester.php index 7a382b5f..672a3050 100644 --- a/tests/test_tools/simpletest/unit_tester.php +++ b/tests/test_tools/simpletest/unit_tester.php @@ -370,4 +370,3 @@ return $this->assertError(new PatternExpectation($pattern), $message); } } -?> diff --git a/tests/test_tools/simpletest/url.php b/tests/test_tools/simpletest/url.php index b208d1b3..dedc6a9b 100644 --- a/tests/test_tools/simpletest/url.php +++ b/tests/test_tools/simpletest/url.php @@ -521,5 +521,4 @@ static function getAllTopLevelDomains() { return 'com|edu|net|org|gov|mil|int|biz|info|name|pro|aero|coop|museum'; } - } -?>
\ No newline at end of file + }
\ No newline at end of file diff --git a/tests/test_tools/simpletest/user_agent.php b/tests/test_tools/simpletest/user_agent.php index a901e6d4..161a1b68 100644 --- a/tests/test_tools/simpletest/user_agent.php +++ b/tests/test_tools/simpletest/user_agent.php @@ -14,11 +14,11 @@ require_once(dirname(__FILE__) . '/encoding.php'); require_once(dirname(__FILE__) . '/authentication.php'); /**#@-*/ - + if (! defined('DEFAULT_MAX_REDIRECTS')) { define('DEFAULT_MAX_REDIRECTS', 3); } - + if (! defined('DEFAULT_CONNECTION_TIMEOUT')) { define('DEFAULT_CONNECTION_TIMEOUT', 15); } @@ -39,7 +39,7 @@ protected $_proxy_password = false; protected $_connection_timeout = DEFAULT_CONNECTION_TIMEOUT; protected $_additional_headers = array(); - + /** * Starts with no cookies, realms or proxies. * @access public @@ -48,7 +48,7 @@ $this->_cookie_jar = new SimpleCookieJar(); $this->_authenticator = new SimpleAuthenticator(); } - + /** * Removes expired and temporary cookies as if * the browser was closed and re-opened. Authorisation @@ -62,7 +62,7 @@ $this->_cookie_jar->restartSession($date); $this->_authenticator->restartSession(); } - + /** * Adds a header to every fetch. * @param string $header Header line to add to every @@ -72,7 +72,7 @@ function addHeader($header) { $this->_additional_headers[] = $header; } - + /** * Ages the cookies by the specified time. * @param integer $interval Amount in seconds. @@ -81,7 +81,7 @@ function ageCookies($interval) { $this->_cookie_jar->agePrematurely($interval); } - + /** * Sets an additional cookie. If a cookie has * the same name and path it is replaced. @@ -95,7 +95,7 @@ function setCookie($name, $value, $host = false, $path = '/', $expiry = false) { $this->_cookie_jar->setCookie($name, $value, $host, $path, $expiry); } - + /** * Reads the most specific cookie value from the * browser cookies. @@ -109,7 +109,7 @@ function getCookieValue($host, $path, $name) { return $this->_cookie_jar->getCookieValue($host, $path, $name); } - + /** * Reads the current cookies within the base URL. * @param string $name Key of cookie to find. @@ -124,7 +124,7 @@ } return $this->getCookieValue($base->getHost(), $base->getPath(), $name); } - + /** * Switches off cookie sending and recieving. * @access public @@ -132,7 +132,7 @@ function ignoreCookies() { $this->_cookies_enabled = false; } - + /** * Switches back on the cookie sending and recieving. * @access public @@ -140,7 +140,7 @@ function useCookies() { $this->_cookies_enabled = true; } - + /** * Sets the socket timeout for opening a connection. * @param integer $timeout Maximum time in seconds. @@ -149,7 +149,7 @@ function setConnectionTimeout($timeout) { $this->_connection_timeout = $timeout; } - + /** * Sets the maximum number of redirects before * a page will be loaded anyway. @@ -159,7 +159,7 @@ function setMaximumRedirects($max) { $this->_max_redirects = $max; } - + /** * Sets proxy to use on all requests for when * testing from behind a firewall. Set URL @@ -181,7 +181,7 @@ $this->_proxy_username = $username; $this->_proxy_password = $password; } - + /** * Test to see if the redirect limit is passed. * @param integer $redirects Count so far. @@ -191,7 +191,7 @@ function _isTooManyRedirects($redirects) { return ($redirects > $this->_max_redirects); } - + /** * Sets the identity for the current realm. * @param string $host Host to which realm applies. @@ -203,7 +203,7 @@ function setIdentity($host, $realm, $username, $password) { $this->_authenticator->setIdentityForRealm($host, $realm, $username, $password); } - + /** * Fetches a URL as a response object. Will keep trying if redirected. * It will also collect authentication realm information. @@ -228,7 +228,7 @@ } return $response; } - + /** * Fetches the page until no longer redirected or * until the redirect limit runs out. @@ -257,7 +257,7 @@ } while (! $this->_isTooManyRedirects(++$redirects)); return $response; } - + /** * Actually make the web request. * @param SimpleUrl $url Target to fetch. @@ -270,7 +270,7 @@ $response = $request->fetch($this->_connection_timeout); return $response; } - + /** * Creates a full page request. * @param SimpleUrl $url Target to fetch as url object. @@ -287,7 +287,7 @@ $this->_authenticator->addHeaders($request, $url); return $request; } - + /** * Builds the appropriate HTTP request object. * @param SimpleUrl $url Target to fetch as url object. @@ -299,7 +299,7 @@ $request = new SimpleHttpRequest($this->_createRoute($url), $encoding); return $request; } - + /** * Sets up either a direct route or via a proxy. * @param SimpleUrl $url Target to fetch as url object. @@ -318,7 +318,7 @@ } return $route; } - + /** * Adds additional manual headers. * @param SimpleHttpRequest $request Outgoing request. @@ -329,5 +329,4 @@ $request->addHeaderLine($header); } } - } -?>
\ No newline at end of file + }
\ No newline at end of file diff --git a/tests/test_tools/simpletest/web_tester.php b/tests/test_tools/simpletest/web_tester.php index c582a6ff..c6a48110 100644 --- a/tests/test_tools/simpletest/web_tester.php +++ b/tests/test_tools/simpletest/web_tester.php @@ -14,7 +14,7 @@ require_once(dirname(__FILE__) . '/page.php'); require_once(dirname(__FILE__) . '/expectation.php'); /**#@-*/ - + /** * Test for an HTML widget value match. * @package SimpleTest @@ -22,7 +22,7 @@ */ class FieldExpectation extends SimpleExpectation { protected $_value; - + /** * Sets the field value to compare against. * @param mixed $value Test value to match. Can be an @@ -38,7 +38,7 @@ } $this->_value = $value; } - + /** * Tests the expectation. True if it matches * a string value or an array value in any order. @@ -59,7 +59,7 @@ } return false; } - + /** * Tests for valid field comparisons with a single option. * @param mixed $value Value to type check. @@ -69,7 +69,7 @@ function _isSingle($value) { return is_string($value) || is_integer($value) || is_float($value); } - + /** * String comparison for simple field with a single option. * @param mixed $compare String to test against. @@ -85,7 +85,7 @@ } return ($this->_value == $compare); } - + /** * List comparison for multivalue field. * @param mixed $compare List in any order to test against. @@ -102,7 +102,7 @@ sort($compare); return ($this->_value === $compare); } - + /** * Returns a human readable test message. * @param mixed $compare Comparison value. @@ -125,7 +125,7 @@ } } } - + /** * Test for a specific HTTP header within a header block. * @package SimpleTest @@ -134,7 +134,7 @@ class HttpHeaderExpectation extends SimpleExpectation { protected $_expected_header; protected $_expected_value; - + /** * Sets the field and value to compare against. * @param string $header Case insenstive trimmed header name. @@ -150,7 +150,7 @@ $this->_expected_header = $this->_normaliseHeader($header); $this->_expected_value = $value; } - + /** * Accessor for aggregated object. * @return mixed Expectation set in constructor. @@ -159,7 +159,7 @@ function _getExpectation() { return $this->_expected_value; } - + /** * Removes whitespace at ends and case variations. * @param string $header Name of header. @@ -170,7 +170,7 @@ function _normaliseHeader($header) { return strtolower(trim($header)); } - + /** * Tests the expectation. True if it matches * a string value or an array value in any order. @@ -181,7 +181,7 @@ function test($compare) { return is_string($this->_findHeader($compare)); } - + /** * Searches the incoming result. Will extract the matching * line as text. @@ -198,7 +198,7 @@ } return false; } - + /** * Compares a single header line against the expectation. * @param string $line A single line to compare. @@ -215,7 +215,7 @@ } return $this->_testHeaderValue($value, $this->_expected_value); } - + /** * Tests the value part of the header. * @param string $value Value to test. @@ -232,7 +232,7 @@ } return (trim($value) == trim($expected)); } - + /** * Returns a human readable test message. * @param mixed $compare Raw header block to search. @@ -254,7 +254,7 @@ } } } - + /** * Test for a specific HTTP header within a header block that * should not be found. @@ -264,7 +264,7 @@ class NoHttpHeaderExpectation extends HttpHeaderExpectation { protected $_expected_header; protected $_expected_value; - + /** * Sets the field and value to compare against. * @param string $unwanted Case insenstive trimmed header name. @@ -274,7 +274,7 @@ function NoHttpHeaderExpectation($unwanted, $message = '%s') { $this->HttpHeaderExpectation($unwanted, false, $message); } - + /** * Tests that the unwanted header is not found. * @param mixed $compare Raw header block to search. @@ -284,7 +284,7 @@ function test($compare) { return ($this->_findHeader($compare) === false); } - + /** * Returns a human readable test message. * @param mixed $compare Raw header block to search. @@ -301,7 +301,7 @@ } } } - + /** * Test for a text substring. * @package SimpleTest @@ -309,7 +309,7 @@ */ class TextExpectation extends SimpleExpectation { protected $_substring; - + /** * Sets the value to compare against. * @param string $substring Text to search for. @@ -320,7 +320,7 @@ $this->SimpleExpectation($message); $this->_substring = $substring; } - + /** * Accessor for the substring. * @return string Text to match. @@ -329,7 +329,7 @@ function _getSubstring() { return $this->_substring; } - + /** * Tests the expectation. True if the text contains the * substring. @@ -340,7 +340,7 @@ function test($compare) { return (strpos($compare, $this->_substring) !== false); } - + /** * Returns a human readable test message. * @param mixed $compare Comparison value. @@ -358,7 +358,7 @@ $dumper->describeValue($compare) . "]"; } } - + /** * Describes a pattern match including the string * found and it's position. @@ -374,7 +374,7 @@ $dumper->clipString($subject, 100, $position) . "]"; } } - + /** * Fail if a substring is detected within the * comparison text. @@ -382,7 +382,7 @@ * @subpackage UnitTester */ class NoTextExpectation extends TextExpectation { - + /** * Sets the reject pattern * @param string $substring Text to search for. @@ -392,7 +392,7 @@ function NoTextExpectation($substring, $message = '%s') { $this->TextExpectation($substring, $message); } - + /** * Tests the expectation. False if the substring appears * in the text. @@ -403,7 +403,7 @@ function test($compare) { return ! parent::test($compare); } - + /** * Returns a human readable test message. * @param string $compare Comparison value. @@ -422,7 +422,7 @@ } } } - + /** * Test case for testing of web pages. Allows * fetching of pages, parsing of HTML and @@ -433,7 +433,7 @@ class WebTestCase extends SimpleTestCase { protected $_browser; protected $_ignore_errors = false; - + /** * Creates an empty test case. Should be subclassed * with test methods for a functional test case. @@ -444,7 +444,7 @@ function WebTestCase($label = false) { $this->SimpleTestCase($label); } - + /** * Announces the start of the test. * @param string $method Test method just started. @@ -464,7 +464,7 @@ $this->unsetBrowser(); parent::after($method); } - + /** * Gets a current browser reference for setting * special expectations or for detailed @@ -475,7 +475,7 @@ function &getBrowser() { return $this->_browser; } - + /** * Gets a current browser reference for setting * special expectations or for detailed @@ -486,7 +486,7 @@ function setBrowser($browser) { return $this->_browser = $browser; } - + /** * Clears the current browser reference to help the * PHP garbage collector. @@ -495,7 +495,7 @@ function unsetBrowser() { unset($this->_browser); } - + /** * Creates a new default web browser object. * Will be cleared at the end of the test method. @@ -506,7 +506,7 @@ $browser = new SimpleBrowser(); return $browser; } - + /** * Gets the last response error. * @return string Last low level HTTP error. @@ -515,7 +515,7 @@ function getTransportError() { return $this->_browser->getTransportError(); } - + /** * Accessor for the currently selected URL. * @return string Current location or false if @@ -525,7 +525,7 @@ function getUrl() { return $this->_browser->getUrl(); } - + /** * Dumps the current request for debugging. * @access public @@ -533,7 +533,7 @@ function showRequest() { $this->dump($this->_browser->getRequest()); } - + /** * Dumps the current HTTP headers for debugging. * @access public @@ -541,7 +541,7 @@ function showHeaders() { $this->dump($this->_browser->getHeaders()); } - + /** * Dumps the current HTML source for debugging. * @access public @@ -549,7 +549,7 @@ function showSource() { $this->dump($this->_browser->getContent()); } - + /** * Dumps the visible text only for debugging. * @access public @@ -557,7 +557,7 @@ function showText() { $this->dump(wordwrap($this->_browser->getContentAsText(), 80)); } - + /** * Simulates the closing and reopening of the browser. * Temporary cookies will be discarded and timed @@ -575,7 +575,7 @@ } $this->_browser->restart($date); } - + /** * Moves cookie expiry times back into the past. * Useful for testing timeouts and expiries. @@ -585,7 +585,7 @@ function ageCookies($interval) { $this->_browser->ageCookies($interval); } - + /** * Disables frames support. Frames will not be fetched * and the frameset page will be used instead. @@ -594,7 +594,7 @@ function ignoreFrames() { $this->_browser->ignoreFrames(); } - + /** * Switches off cookie sending and recieving. * @access public @@ -602,7 +602,7 @@ function ignoreCookies() { $this->_browser->ignoreCookies(); } - + /** * Skips errors for the next request only. You might * want to confirm that a page is unreachable for @@ -612,7 +612,7 @@ function ignoreErrors() { $this->_ignore_errors = true; } - + /** * Issues a fail if there is a transport error anywhere * in the current frameset. Only one such error is @@ -640,7 +640,7 @@ function addHeader($header) { $this->_browser->addHeader($header); } - + /** * Sets the maximum number of redirects before * the web page is loaded regardless. @@ -654,7 +654,7 @@ } $this->_browser->setMaximumRedirects($max); } - + /** * Sets the socket timeout for opening a connection and * receiving at least one byte of information. @@ -664,7 +664,7 @@ function setConnectionTimeout($timeout) { $this->_browser->setConnectionTimeout($timeout); } - + /** * Sets proxy to use on all requests for when * testing from behind a firewall. Set URL @@ -677,7 +677,7 @@ function useProxy($proxy, $username = false, $password = false) { $this->_browser->useProxy($proxy, $username, $password); } - + /** * Fetches a page into the page buffer. If * there is no base for the URL then the @@ -691,7 +691,7 @@ function get($url, $parameters = false) { return $this->_failOnError($this->_browser->get($url, $parameters)); } - + /** * Fetches a page by POST into the page buffer. * If there is no base for the URL then the @@ -705,7 +705,7 @@ function post($url, $parameters = false) { return $this->_failOnError($this->_browser->post($url, $parameters)); } - + /** * Does a HTTP HEAD fetch, fetching only the page * headers. The current base URL is unchanged by this. @@ -717,7 +717,7 @@ function head($url, $parameters = false) { return $this->_failOnError($this->_browser->head($url, $parameters)); } - + /** * Equivalent to hitting the retry button on the * browser. Will attempt to repeat the page fetch. @@ -727,7 +727,7 @@ function retry() { return $this->_failOnError($this->_browser->retry()); } - + /** * Equivalent to hitting the back button on the * browser. @@ -738,7 +738,7 @@ function back() { return $this->_failOnError($this->_browser->back()); } - + /** * Equivalent to hitting the forward button on the * browser. @@ -749,7 +749,7 @@ function forward() { return $this->_failOnError($this->_browser->forward()); } - + /** * Retries a request after setting the authentication * for the current realm. @@ -764,7 +764,7 @@ return $this->_failOnError( $this->_browser->authenticate($username, $password)); } - + /** * Gets the cookie value for the current browser context. * @param string $name Name of cookie. @@ -774,7 +774,7 @@ function getCookie($name) { return $this->_browser->getCurrentCookieValue($name); } - + /** * Sets a cookie in the current browser. * @param string $name Name of cookie. @@ -787,7 +787,7 @@ function setCookie($name, $value, $host = false, $path = "/", $expiry = false) { $this->_browser->setCookie($name, $value, $host, $path, $expiry); } - + /** * Accessor for current frame focus. Will be * false if no frame has focus. @@ -799,7 +799,7 @@ function getFrameFocus() { return $this->_browser->getFrameFocus(); } - + /** * Sets the focus by index. The integer index starts from 1. * @param integer $choice Chosen frame. @@ -809,7 +809,7 @@ function setFrameFocusByIndex($choice) { return $this->_browser->setFrameFocusByIndex($choice); } - + /** * Sets the focus by name. * @param string $name Chosen frame. @@ -819,7 +819,7 @@ function setFrameFocus($name) { return $this->_browser->setFrameFocus($name); } - + /** * Clears the frame focus. All frames will be searched * for content. @@ -828,7 +828,7 @@ function clearFrameFocus() { return $this->_browser->clearFrameFocus(); } - + /** * Clicks a visible text item. Will first try buttons, * then links and then images. @@ -839,7 +839,7 @@ function click($label) { return $this->_failOnError($this->_browser->click($label)); } - + /** * Clicks the submit button by label. The owning * form will be submitted by this. @@ -853,7 +853,7 @@ return $this->_failOnError( $this->_browser->clickSubmit($label, $additional)); } - + /** * Clicks the submit button by name attribute. The owning * form will be submitted by this. @@ -866,7 +866,7 @@ return $this->_failOnError( $this->_browser->clickSubmitByName($name, $additional)); } - + /** * Clicks the submit button by ID attribute. The owning * form will be submitted by this. @@ -879,7 +879,7 @@ return $this->_failOnError( $this->_browser->clickSubmitById($id, $additional)); } - + /** * Clicks the submit image by some kind of label. Usually * the alt tag or the nearest equivalent. The owning @@ -897,7 +897,7 @@ return $this->_failOnError( $this->_browser->clickImage($label, $x, $y, $additional)); } - + /** * Clicks the submit image by the name. Usually * the alt tag or the nearest equivalent. The owning @@ -915,7 +915,7 @@ return $this->_failOnError( $this->_browser->clickImageByName($name, $x, $y, $additional)); } - + /** * Clicks the submit image by ID attribute. The owning * form will be submitted by this. Clicking outside of @@ -932,7 +932,7 @@ return $this->_failOnError( $this->_browser->clickImageById($id, $x, $y, $additional)); } - + /** * Submits a form by the ID. * @param string $id Form ID. No button information @@ -943,7 +943,7 @@ function submitFormById($id) { return $this->_failOnError($this->_browser->submitFormById($id)); } - + /** * Follows a link by name. Will click the first link * found with this link text by default, or a later @@ -957,7 +957,7 @@ function clickLink($label, $index = 0) { return $this->_failOnError($this->_browser->clickLink($label, $index)); } - + /** * Follows a link by id attribute. * @param string $id ID attribute value. @@ -967,7 +967,7 @@ function clickLinkById($id) { return $this->_failOnError($this->_browser->clickLinkById($id)); } - + /** * Will trigger a pass if the two parameters have * the same value only. Otherwise a fail. This @@ -984,7 +984,7 @@ $second, $message); } - + /** * Will trigger a pass if the two parameters have * a different value. Otherwise a fail. This @@ -1001,7 +1001,7 @@ $second, $message); } - + /** * Tests for the presence of a link label. Match is * case insensitive with normalised space. @@ -1032,7 +1032,7 @@ $this->_browser->isLink($label), sprintf($message, "Link [$label] should not exist")); } - + /** * Tests for the presence of a link id attribute. * @param string $id Id attribute value. @@ -1061,7 +1061,7 @@ $this->_browser->isLinkById($id), sprintf($message, "Link ID [$id] should not exist")); } - + /** * Sets all form fields with that label, or name if there * is no label attached. @@ -1073,7 +1073,7 @@ function setField($label, $value) { return $this->_browser->setField($label, $value); } - + /** * Sets all form fields with that name. * @param string $name Name of field in forms. @@ -1084,7 +1084,7 @@ function setFieldByName($name, $value) { return $this->_browser->setFieldByName($name, $value); } - + /** * Sets all form fields with that name. * @param string/integer $id Id of field in forms. @@ -1095,7 +1095,7 @@ function setFieldById($id, $value) { return $this->_browser->setFieldById($id, $value); } - + /** * Confirms that the form element is currently set * to the expected value. A missing form will always @@ -1113,7 +1113,7 @@ $value = $this->_browser->getField($label); return $this->_assertFieldValue($label, $value, $expected, $message); } - + /** * Confirms that the form element is currently set * to the expected value. A missing form element will always @@ -1131,7 +1131,7 @@ $value = $this->_browser->getFieldByName($name); return $this->_assertFieldValue($name, $value, $expected, $message); } - + /** * Confirms that the form element is currently set * to the expected value. A missing form will always @@ -1149,7 +1149,7 @@ $value = $this->_browser->getFieldById($id); return $this->_assertFieldValue($id, $value, $expected, $message); } - + /** * Tests the field value against the expectation. * @param string $identifier Name, ID or label. @@ -1173,7 +1173,7 @@ } return $this->assert($expected, $value, $message); } - + /** * Checks the response code against a list * of possible values. @@ -1190,7 +1190,7 @@ implode(", ", $responses) . "] got [$code]"); return $this->assertTrue(in_array($code, $responses), $message); } - + /** * Checks the mime type against a list * of possible values. @@ -1206,7 +1206,7 @@ implode(", ", $types) . "] got [$type]"); return $this->assertTrue(in_array($type, $types), $message); } - + /** * Attempt to match the authentication type within * the security realm we are currently matching. @@ -1230,7 +1230,7 @@ $message); } } - + /** * Checks that no authentication is necessary to view * the desired page. @@ -1243,7 +1243,7 @@ $this->_browser->getAuthentication() . "]"); return $this->assertFalse($this->_browser->getAuthentication(), $message); } - + /** * Attempts to match the current security realm. * @param string $realm Name of security realm. @@ -1260,7 +1260,7 @@ $this->_browser->getRealm(), "Expected realm -> $message"); } - + /** * Checks each header line for the required value. If no * value is given then only an existence check is made. @@ -1277,7 +1277,7 @@ $this->_browser->getHeaders(), $message); } - + /** * @deprecated */ @@ -1303,14 +1303,14 @@ $this->_browser->getHeaders(), $message); } - + /** * @deprecated */ function assertNoUnwantedHeader($header, $message = '%s') { return $this->assertNoHeader($header, $message); } - + /** * Tests the text between the title tags. * @param string $title Expected title. @@ -1324,7 +1324,7 @@ } return $this->assert($title, $this->_browser->getTitle(), $message); } - + /** * Will trigger a pass if the text is found in the plain * text form of the page. @@ -1339,14 +1339,14 @@ $this->_browser->getContentAsText(), $message); } - + /** * @deprecated */ function assertWantedText($text, $message = '%s') { return $this->assertText($text, $message); } - + /** * Will trigger a pass if the text is not found in the plain * text form of the page. @@ -1361,14 +1361,14 @@ $this->_browser->getContentAsText(), $message); } - + /** * @deprecated */ function assertNoUnwantedText($text, $message = '%s') { return $this->assertNoText($text, $message); } - + /** * Will trigger a pass if the Perl regex pattern * is found in the raw content. @@ -1384,14 +1384,14 @@ $this->_browser->getContent(), $message); } - + /** * @deprecated */ function assertWantedPattern($pattern, $message = '%s') { return $this->assertPattern($pattern, $message); } - + /** * Will trigger a pass if the perl regex pattern * is not present in raw content. @@ -1407,14 +1407,14 @@ $this->_browser->getContent(), $message); } - + /** * @deprecated */ function assertNoUnwantedPattern($pattern, $message = '%s') { return $this->assertNoPattern($pattern, $message); } - + /** * Checks that a cookie is set for the current page * and optionally checks the value. @@ -1437,7 +1437,7 @@ } return $this->assert($expected, $value, "Expecting cookie [$name] -> $message"); } - + /** * Checks that no cookie is present or that it has * been successfully cleared. @@ -1451,5 +1451,4 @@ $this->getCookie($name) === false, sprintf($message, "Not expecting cookie [$name]")); } - } -?>
\ No newline at end of file + }
\ No newline at end of file diff --git a/tests/test_tools/simpletest/xml.php b/tests/test_tools/simpletest/xml.php index 9d1ab3b2..54b53011 100644 --- a/tests/test_tools/simpletest/xml.php +++ b/tests/test_tools/simpletest/xml.php @@ -611,4 +611,3 @@ function _default($expat, $default) { } } -?> diff --git a/tests/unit/AllTests.php b/tests/unit/AllTests.php index 7b8027b3..eb08a5f7 100644 --- a/tests/unit/AllTests.php +++ b/tests/unit/AllTests.php @@ -50,5 +50,3 @@ class AllTests { if(PHPUnit_MAIN_METHOD == 'AllTests::main') { AllTests::main(); } - -?>
\ No newline at end of file diff --git a/tests/unit/Caching/AllTests.php b/tests/unit/Caching/AllTests.php index bffe3b2f..179840fc 100644 --- a/tests/unit/Caching/AllTests.php +++ b/tests/unit/Caching/AllTests.php @@ -12,14 +12,14 @@ class Caching_AllTests { public static function main() { PHPUnit_TextUI_TestRunner::run(self::suite()); } - + public static function suite() { $suite = new PHPUnit_Framework_TestSuite('System.Caching'); - + $suite->addTestSuite('TSqliteCacheTest'); $suite->addTestSuite('TAPCCacheTest'); $suite->addTestSuite('TMemCacheTest'); - + return $suite; } } @@ -27,4 +27,3 @@ class Caching_AllTests { if(PHPUnit_MAIN_METHOD == 'Caching_AllTests::main') { Caching_AllTests::main(); } -?> diff --git a/tests/unit/Caching/TAPCCacheTest.php b/tests/unit/Caching/TAPCCacheTest.php index 3cb04361..ccb6ee85 100644 --- a/tests/unit/Caching/TAPCCacheTest.php +++ b/tests/unit/Caching/TAPCCacheTest.php @@ -26,7 +26,7 @@ class TAPCCacheTest extends PHPUnit_Framework_TestCase { } catch(TConfigurationException $e) { self::markTestSkipped($e->getMessage()); } - + } } @@ -38,24 +38,24 @@ class TAPCCacheTest extends PHPUnit_Framework_TestCase { public function testInit() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testPrimaryCache() { self::$cache->PrimaryCache = true; self::assertEquals(true, self::$cache->PrimaryCache); self::$cache->PrimaryCache = false; self::assertEquals(false, self::$cache->PrimaryCache); } - + public function testKeyPrefix() { self::$cache->KeyPrefix = 'prefix'; self::assertEquals('prefix', self::$cache->KeyPrefix); } - + public function testSetAndGet() { self::$cache->set('key', 'value'); self::assertEquals('value', self::$cache->get('key')); } - + public function testAdd() { try { self::$cache->add('anotherkey', 'value'); @@ -65,12 +65,12 @@ class TAPCCacheTest extends PHPUnit_Framework_TestCase { } self::assertEquals('value', self::$cache->get('anotherkey')); } - + public function testDelete() { self::$cache->delete('key'); self::assertEquals(false, self::$cache->get('key')); } - + public function testFlush() { $this->testSetAndGet(); self::assertEquals(true, self::$cache->flush()); @@ -78,4 +78,3 @@ class TAPCCacheTest extends PHPUnit_Framework_TestCase { } -?> diff --git a/tests/unit/Caching/TDirectoryCacheDependencyTest.php b/tests/unit/Caching/TDirectoryCacheDependencyTest.php index c5c75dec..10da9b58 100644 --- a/tests/unit/Caching/TDirectoryCacheDependencyTest.php +++ b/tests/unit/Caching/TDirectoryCacheDependencyTest.php @@ -78,5 +78,3 @@ class TDirectoryCacheDependencyTest extends PHPUnit_Framework_TestCase @unlink($tempFile); } } - -?>
\ No newline at end of file diff --git a/tests/unit/Caching/TFileCacheDependencyTest.php b/tests/unit/Caching/TFileCacheDependencyTest.php index b4bc89d3..24f2721b 100644 --- a/tests/unit/Caching/TFileCacheDependencyTest.php +++ b/tests/unit/Caching/TFileCacheDependencyTest.php @@ -54,5 +54,3 @@ class TFileCacheDependencyTest extends PHPUnit_Framework_TestCase @unlink($tempFile); } } - -?>
\ No newline at end of file diff --git a/tests/unit/Caching/TMemCacheTest.php b/tests/unit/Caching/TMemCacheTest.php index 8c1fa934..3d0d651f 100644 --- a/tests/unit/Caching/TMemCacheTest.php +++ b/tests/unit/Caching/TMemCacheTest.php @@ -33,34 +33,34 @@ class TMemCacheTest extends PHPUnit_Framework_TestCase { public function testInit() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testPrimaryCache() { self::$cache->PrimaryCache = true; self::assertEquals(true, self::$cache->PrimaryCache); self::$cache->PrimaryCache = false; self::assertEquals(false, self::$cache->PrimaryCache); } - + public function testKeyPrefix() { self::$cache->KeyPrefix = 'prefix'; self::assertEquals('prefix', self::$cache->KeyPrefix); } - + public function testSetAndGet() { self::$cache->set('key', 'value'); self::assertEquals('value', self::$cache->get('key')); } - + public function testAdd() { self::$cache->add('anotherkey', 'value'); self::assertEquals('value', self::$cache->get('anotherkey')); } - + public function testDelete() { self::$cache->delete('key'); self::assertEquals(false, self::$cache->get('key')); } - + public function testFlush() { $this->testSetAndGet(); self::assertEquals(true, self::$cache->flush()); @@ -68,4 +68,3 @@ class TMemCacheTest extends PHPUnit_Framework_TestCase { } -?> diff --git a/tests/unit/Caching/TSqliteCacheTest.php b/tests/unit/Caching/TSqliteCacheTest.php index fd4ab1bf..b979b0ec 100644 --- a/tests/unit/Caching/TSqliteCacheTest.php +++ b/tests/unit/Caching/TSqliteCacheTest.php @@ -15,7 +15,7 @@ class TSqliteCacheTest extends PHPUnit_Framework_TestCase { self::markTestSkipped('The SQLite extension is not available'); } else { if(self::$app === null) { - + $basePath = dirname(__FILE__).'/mockapp'; $runtimePath = $basePath.'/runtime'; if(!is_writable($runtimePath)) { @@ -37,38 +37,38 @@ class TSqliteCacheTest extends PHPUnit_Framework_TestCase { public function testInit() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testPrimaryCache() { self::$cache->PrimaryCache = true; self::assertEquals(true, self::$cache->PrimaryCache); self::$cache->PrimaryCache = false; self::assertEquals(false, self::$cache->PrimaryCache); } - + public function testKeyPrefix() { self::$cache->KeyPrefix = 'prefix'; self::assertEquals('prefix', self::$cache->KeyPrefix); } - + public function testDbFile() { self::assertEquals('sqlite.cache', basename(self::$cache->DbFile)); } - + public function testSetAndGet() { self::$cache->set('key', 'value'); self::assertEquals('value', self::$cache->get('key')); } - + public function testAdd() { self::$cache->add('key', 'value'); self::assertEquals('value', self::$cache->get('key')); } - + public function testDelete() { self::$cache->delete('key'); self::assertEquals(false, self::$cache->get('key')); } - + public function testFlush() { $this->testAdd(); self::assertEquals(true, self::$cache->flush()); @@ -76,4 +76,3 @@ class TSqliteCacheTest extends PHPUnit_Framework_TestCase { } -?> diff --git a/tests/unit/Collections/AllTests.php b/tests/unit/Collections/AllTests.php index f290be31..3c286132 100644 --- a/tests/unit/Collections/AllTests.php +++ b/tests/unit/Collections/AllTests.php @@ -16,10 +16,10 @@ class Collections_AllTests { public static function main() { PHPUnit_TextUI_TestRunner::run(self::suite()); } - + public static function suite() { $suite = new PHPUnit_Framework_TestSuite('System.Collections'); - + $suite->addTestSuite('TListTest'); $suite->addTestSuite('TMapTest'); $suite->addTestSuite('TQueueTest'); @@ -27,7 +27,7 @@ class Collections_AllTests { $suite->addTestSuite('TAttributeCollectionTest'); $suite->addTestSuite('TPagedListTest'); $suite->addTestSuite('TPagedDataSourceTest'); - + return $suite; } } @@ -35,4 +35,3 @@ class Collections_AllTests { if(PHPUnit_MAIN_METHOD == 'Collections_AllTests::main') { Collections_AllTests::main(); } -?> diff --git a/tests/unit/Collections/TAttributeCollectionTest.php b/tests/unit/Collections/TAttributeCollectionTest.php index 5805f2d0..f61f58b3 100644 --- a/tests/unit/Collections/TAttributeCollectionTest.php +++ b/tests/unit/Collections/TAttributeCollectionTest.php @@ -19,7 +19,7 @@ class TAttributeCollectionTest extends PHPUnit_Framework_TestCase { self::assertEquals('value', $collection->Property); self::assertEquals(true, $collection->canGetProperty('Property')); } - + public function testCanNotGetUndefinedProperty() { $collection = new TAttributeCollection(array(), true); self::assertEquals(false, $collection->canGetProperty('Property')); @@ -37,7 +37,7 @@ class TAttributeCollectionTest extends PHPUnit_Framework_TestCase { self::assertEquals('value', $collection->itemAt('Property')); self::assertEquals(true, $collection->canSetProperty('Property')); } - + public function testCanNotSetPropertyIfReadOnly() { $collection = new TAttributeCollection(array(), true); try { @@ -47,7 +47,7 @@ class TAttributeCollectionTest extends PHPUnit_Framework_TestCase { } self::fail('An expected TInvalidOperationException was not raised'); } - + public function testGetCaseSensitive() { $collection = new TAttributeCollection(); $collection->setCaseSensitive(false); @@ -55,40 +55,40 @@ class TAttributeCollectionTest extends PHPUnit_Framework_TestCase { $collection->setCaseSensitive(true); self::assertEquals(true, $collection->getCaseSensitive()); } - + public function testSetCaseSensitive() { $collection = new TAttributeCollection(); $collection->Property = 'value'; $collection->setCaseSensitive(false); self::assertEquals('value', $collection->itemAt('property')); } - + public function testItemAt() { $collection = new TAttributeCollection(); $collection->Property = 'value'; self::assertEquals('value', $collection->itemAt('Property')); } - + public function testAdd() { $collection = new TAttributeCollection(); $collection->add('Property', 'value'); self::assertEquals('value', $collection->itemAt('Property')); } - + public function testRemove() { $collection = new TAttributeCollection(); $collection->add('Property', 'value'); $collection->remove('Property'); self::assertEquals(0, count($collection)); } - + public function testContains() { $collection = new TAttributeCollection(); self::assertEquals(false, $collection->contains('Property')); $collection->Property = 'value'; self::assertEquals(true, $collection->contains('Property')); } - + public function testHasProperty() { $collection = new TAttributeCollection(); self::assertEquals(false, $collection->hasProperty('Property')); @@ -98,4 +98,3 @@ class TAttributeCollectionTest extends PHPUnit_Framework_TestCase { } -?> diff --git a/tests/unit/Collections/TListTest.php b/tests/unit/Collections/TListTest.php index 349d87ed..9d6950b9 100644 --- a/tests/unit/Collections/TListTest.php +++ b/tests/unit/Collections/TListTest.php @@ -8,7 +8,7 @@ class ListItem { * @package System.Collections */ class TListTest extends PHPUnit_Framework_TestCase { - + protected $list; protected $item1, $item2, $item3, $item4; @@ -21,7 +21,7 @@ class TListTest extends PHPUnit_Framework_TestCase { $this->list->add($this->item1); $this->list->add($this->item2); } - + public function tearDown() { $this->list=null; $this->item1=null; @@ -29,7 +29,7 @@ class TListTest extends PHPUnit_Framework_TestCase { $this->item3=null; $this->item4=null; } - + public function testConstruct() { $a=array(1,2,3); $list=new TList($a); @@ -37,19 +37,19 @@ class TListTest extends PHPUnit_Framework_TestCase { $list2=new TList($this->list); $this->assertEquals(2,$list2->getCount()); } - + public function testGetReadOnly() { $list = new TList(null, true); self::assertEquals(true, $list->getReadOnly(), 'List is not read-only'); $list = new TList(null, false); self::assertEquals(false, $list->getReadOnly(), 'List is read-only'); } - + public function testGetCount() { $this->assertEquals(2,$this->list->getCount()); $this->assertEquals(2,$this->list->Count); } - + public function testItemAt() { $this->assertTrue($this->list->itemAt(0) === $this->item1); $this->assertTrue($this->list->itemAt(1) === $this->item2); @@ -59,14 +59,14 @@ class TListTest extends PHPUnit_Framework_TestCase { } catch(TInvalidDataValueException $e) { } } - + public function testAdd() { $this->assertEquals(2,$this->list->add(null)); $this->assertEquals(3,$this->list->add($this->item3)); $this->assertEquals(4,$this->list->getCount()); $this->assertEquals(3,$this->list->indexOf($this->item3)); } - + public function testCanNotAddWhenReadOnly() { $list = new TList(array(), true); try { @@ -75,7 +75,7 @@ class TListTest extends PHPUnit_Framework_TestCase { } catch(TInvalidOperationException $e) { } } - + public function testInsertAt() { $this->assertNull($this->list->insertAt(0,$this->item3)); $this->assertEquals(3,$this->list->getCount()); @@ -88,7 +88,7 @@ class TListTest extends PHPUnit_Framework_TestCase { } catch(TInvalidDataValueException $e) { } } - + public function testCanNotInsertAtWhenReadOnly() { $list = new TList(array(), true); try { @@ -102,7 +102,7 @@ class TListTest extends PHPUnit_Framework_TestCase { } catch(TInvalidOperationException $e) { } } - + public function testInsertBefore() { try { $this->list->insertBefore($this->item4,$this->item3); @@ -116,7 +116,7 @@ class TListTest extends PHPUnit_Framework_TestCase { $this->assertEquals(1,$this->list->indexOf($this->item1)); $this->assertEquals(2,$this->list->indexOf($this->item2)); } - + public function testCanNotInsertBeforeWhenReadOnly() { $list = new TList(array(5), true); try { @@ -130,7 +130,7 @@ class TListTest extends PHPUnit_Framework_TestCase { } catch(TInvalidOperationException $e) { } } - + public function testInsertAfter() { try { $this->list->insertAfter($this->item4,$this->item3); @@ -144,7 +144,7 @@ class TListTest extends PHPUnit_Framework_TestCase { $this->assertEquals(1,$this->list->indexOf($this->item2)); $this->assertEquals(2,$this->list->indexOf($this->item3)); } - + public function testCanNotInsertAfterWhenReadOnly() { $list = new TList(array(5), true); try { @@ -158,7 +158,7 @@ class TListTest extends PHPUnit_Framework_TestCase { } catch(TInvalidOperationException $e) { } } - + public function testRemove() { $this->assertEquals(0,$this->list->remove($this->item1)); $this->assertEquals(1,$this->list->getCount()); @@ -170,7 +170,7 @@ class TListTest extends PHPUnit_Framework_TestCase { } catch(Exception $e) { } } - + public function testCanNotRemoveWhenReadOnly() { $list = new TList(array(1, 2, 3), true); try { @@ -178,7 +178,7 @@ class TListTest extends PHPUnit_Framework_TestCase { self::fail('An expected TInvalidOperationException was not raised'); } catch(TInvalidOperationException $e) { } - + $list = new TList(array(1, 2, 3), true); try { $list->remove(10); @@ -186,7 +186,7 @@ class TListTest extends PHPUnit_Framework_TestCase { } catch(TInvalidOperationException $e) { } } - + public function testRemoveAt() { $this->list->add($this->item3); $this->assertEquals($this->item2, $this->list->removeAt(1)); @@ -199,7 +199,7 @@ class TListTest extends PHPUnit_Framework_TestCase { } catch(TInvalidDataValueException $e) { } } - + public function testCanNotRemoveAtWhenReadOnly() { $list = new TList(array(1, 2, 3), true); try { @@ -207,7 +207,7 @@ class TListTest extends PHPUnit_Framework_TestCase { self::fail('An expected TInvalidOperationException was not raised'); } catch(TInvalidOperationException $e) { } - + $list = new TList(array(1, 2, 3), true); try { $list->removeAt(10); @@ -215,14 +215,14 @@ class TListTest extends PHPUnit_Framework_TestCase { } catch(TInvalidOperationException $e) { } } - + public function testClear() { $this->list->clear(); $this->assertEquals(0,$this->list->getCount()); $this->assertEquals(-1,$this->list->indexOf($this->item1)); $this->assertEquals(-1,$this->list->indexOf($this->item2)); } - + public function testCanNotClearWhenReadOnly() { $list = new TList(array(1, 2, 3), true); try { @@ -232,19 +232,19 @@ class TListTest extends PHPUnit_Framework_TestCase { } self::fail('An expected TInvalidOperationException was not raised'); } - + public function testContains() { $this->assertTrue($this->list->contains($this->item1)); $this->assertTrue($this->list->contains($this->item2)); $this->assertFalse($this->list->contains($this->item3)); } - + public function testIndexOf() { $this->assertEquals(0,$this->list->indexOf($this->item1)); $this->assertEquals(1,$this->list->indexOf($this->item2)); $this->assertEquals(-1,$this->list->indexOf($this->item3)); } - + public function testCopyFrom() { $array=array($this->item3,$this->item1); $this->list->copyFrom($array); @@ -255,7 +255,7 @@ class TListTest extends PHPUnit_Framework_TestCase { } catch(TInvalidDataTypeException $e) { } } - + public function testMergeWith() { $array=array($this->item3,$this->item1); $this->list->mergeWith($array); @@ -266,12 +266,12 @@ class TListTest extends PHPUnit_Framework_TestCase { } catch(TInvalidDataTypeException $e) { } } - + public function testToArray() { $array=$this->list->toArray(); $this->assertTrue(count($array)==2 && $array[0]===$this->item1 && $array[1]===$this->item2); } - + public function testArrayRead() { $this->assertTrue($this->list[0]===$this->item1); $this->assertTrue($this->list[1]===$this->item2); @@ -281,7 +281,7 @@ class TListTest extends PHPUnit_Framework_TestCase { } catch(TInvalidDataValueException $e) { } } - + public function testGetIterator() { $n=0; $found=0; @@ -295,25 +295,25 @@ class TListTest extends PHPUnit_Framework_TestCase { } $this->assertTrue($n==2 && $found==2); } - + public function testArrayMisc() { $this->assertEquals($this->list->Count,count($this->list)); $this->assertTrue(isset($this->list[1])); $this->assertFalse(isset($this->list[2])); } - + public function testOffsetSetAdd() { $list = new TList(array(1, 2, 3)); $list->offsetSet(null, 4); self::assertEquals(array(1, 2, 3, 4), $list->toArray()); } - + public function testOffsetSetReplace() { $list = new TList(array(1, 2, 3)); $list->offsetSet(1, 4); self::assertEquals(array(1, 4, 3), $list->toArray()); } - + public function testOffsetUnset() { $list = new TList(array(1, 2, 3)); $list->offsetUnset(1); @@ -321,5 +321,3 @@ class TListTest extends PHPUnit_Framework_TestCase { } } - -?>
\ No newline at end of file diff --git a/tests/unit/Collections/TMapTest.php b/tests/unit/Collections/TMapTest.php index 0634a2a3..da198eb4 100644 --- a/tests/unit/Collections/TMapTest.php +++ b/tests/unit/Collections/TMapTest.php @@ -176,11 +176,10 @@ class TMapTest extends PHPUnit_Framework_TestCase { $this->assertTrue(isset($this->map['key1'])); $this->assertFalse(isset($this->map['unknown key'])); } - + public function testToArray() { $map = new TMap(array('key' => 'value')); self::assertEquals(array('key' => 'value'), $map->toArray()); } } -?> diff --git a/tests/unit/Collections/TPagedDataSourceTest.php b/tests/unit/Collections/TPagedDataSourceTest.php index 92f4061b..ebb8e60d 100644 --- a/tests/unit/Collections/TPagedDataSourceTest.php +++ b/tests/unit/Collections/TPagedDataSourceTest.php @@ -16,55 +16,54 @@ class TPagedDataSourceTest extends PHPUnit_Framework_TestCase { public function testDataSource() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testPageSize() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testCurrentPageIndex() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testAllowPaging() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testAllowCustomPaging() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testVirtualItemCount() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testCount() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testPageCount() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testIsFirstPage() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testIsLastPage() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testFirstIndexInPage() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testDataSourceCount() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testIterator() { throw new PHPUnit_Framework_IncompleteTestError(); } } -?> diff --git a/tests/unit/Collections/TPagedListTest.php b/tests/unit/Collections/TPagedListTest.php index 2d884736..a225db61 100644 --- a/tests/unit/Collections/TPagedListTest.php +++ b/tests/unit/Collections/TPagedListTest.php @@ -3,26 +3,26 @@ Prado::using('System.Collections.TPagedList'); class MyPagedList extends TPagedList { - + private $_isPageIndexChanged = false; private $_hasFetchedData = false; - + public function pageIndexChanged($sender, $param) { $this->_isPageIndexChanged = true; } - + public function fetchData($sender, $param) { $this->_hasFetchedData = true; } - + public function isPageIndexChanged() { return $this->_isPageIndexChanged; } - + public function hasFetchedData() { return $this->_hasFetchedData; } - + } /** @@ -58,7 +58,7 @@ class TPagedListTest extends PHPUnit_Framework_TestCase { $list->PageSize = 5; self::assertEquals(5, $list->PageSize); } - + public function testCanNotSetInvalidPageSize() { $list = new TPagedList(); try { @@ -68,14 +68,14 @@ class TPagedListTest extends PHPUnit_Framework_TestCase { } self::fail('An expected TInvalidDataValueException was not raised'); } - + public function testCurrentPageIndex() { $list = new TPagedList(array(1, 2, 3)); $list->PageSize = 1; $list->CurrentPageIndex = 2; self::assertEquals(2, $list->CurrentPageIndex); } - + public function testOnPageIndexChanged() { $list = new TPagedList(array(1, 2, 3, 4, 5)); $list->PageSize = 1; @@ -87,7 +87,7 @@ class TPagedListTest extends PHPUnit_Framework_TestCase { $list->onPageIndexChanged(new TPagedListPageChangedEventParameter($oldPage)); self::assertEquals(true, $myList->isPageIndexChanged()); } - + public function testOnFetchData() { $list = new TPagedList(array(1, 2, 3, 4)); $list->CustomPaging = true; @@ -95,18 +95,18 @@ class TPagedListTest extends PHPUnit_Framework_TestCase { $list->gotoPage(0); $myList = new MyPagedList(); $list->attachEventHandler('OnFetchData', array($myList, 'fetchData')); - self::assertEquals(false, $myList->hasFetchedData()); + self::assertEquals(false, $myList->hasFetchedData()); $list->onFetchData(new TPagedListFetchDataEventParameter($list->CurrentPageIndex, $list->PageSize*$list->CurrentPageIndex, $list->PageSize)); self::assertEquals(true, $myList->hasFetchedData()); } - + public function testGotoPage() { $list = new TPagedList(array(1, 2, 3)); $list->PageSize = 1; self::assertEquals(2, $list->gotoPage(2)); self::assertEquals(false, $list->gotoPage(4)); } - + public function testNextPage() { $list = new TPagedList(array(1, 2)); $list->PageSize = 1; @@ -114,7 +114,7 @@ class TPagedListTest extends PHPUnit_Framework_TestCase { self::assertEquals(1, $list->nextPage()); self::assertEquals(false, $list->nextPage()); } - + public function testPreviousPage() { $list = new TPagedList(array(1, 2)); $list->PageSize = 1; @@ -122,7 +122,7 @@ class TPagedListTest extends PHPUnit_Framework_TestCase { self::assertEquals(0, $list->previousPage()); self::assertEquals(false, $list->previousPage()); } - + public function testVirtualCount() { $list = new TPagedList(array(1, 2)); $list->VirtualCount = -10; @@ -130,7 +130,7 @@ class TPagedListTest extends PHPUnit_Framework_TestCase { $list->VirtualCount = 5; self::assertEquals(5, $list->VirtualCount); } - + public function testPageCount() { $list = new TPagedList(array(1, 2, 3)); $list->PageSize = 1; @@ -141,7 +141,7 @@ class TPagedListTest extends PHPUnit_Framework_TestCase { $list->CustomPaging = false; self::assertEquals(3, $list->PageCount); } - + public function testIsFirstPage() { $list = new TPagedList(array(1, 2, 3)); $list->PageSize = 1; @@ -150,7 +150,7 @@ class TPagedListTest extends PHPUnit_Framework_TestCase { $list->gotoPage(1); self::assertEquals(false, $list->IsFirstPage); } - + public function testIsLastPage() { $list = new TPagedList(array(1, 2, 3)); $list->PageSize = 1; @@ -159,7 +159,7 @@ class TPagedListTest extends PHPUnit_Framework_TestCase { $list->gotoPage(2); self::assertEquals(true, $list->IsLastPage); } - + public function testGetCount() { $list = new TPagedList(array(1, 2, 3)); $list->PageSize = 1; @@ -167,7 +167,7 @@ class TPagedListTest extends PHPUnit_Framework_TestCase { $list->CustomPaging = true; self::assertEquals(3, $list->Count); } - + public function testGetIterator() { $list = new TPagedList(array(1, 2)); $list->CustomPaging = true; @@ -181,12 +181,12 @@ class TPagedListTest extends PHPUnit_Framework_TestCase { $found++; } if($index === 1 && $item === 2) { - $found++; + $found++; } } self::assertTrue($n == 2 && $found == 2); } - + public function testItemAt() { $list = new TPagedList(array(1, 2, 3)); $list->CustomPaging = true; @@ -196,27 +196,27 @@ class TPagedListTest extends PHPUnit_Framework_TestCase { $list->CurrentPageIndex = 0; self::assertEquals(1, $list[0]); } - + public function testIndexOf() { $list = new TPagedList(array(1, 2, 3)); $list->CustomPaging = true; self::assertEquals(0, $list->indexOf(1)); self::assertEquals(-1, $list->indexOf(0)); } - + public function testOffsetExists() { $list = new TPagedList(array(1, 2, 3)); $list->CustomPaging = true; self::assertEquals(true, isset($list[0])); self::assertEquals(false, isset($list[4])); } - + public function testOffsetGet() { $list = new TPagedList(array(1, 2, 3)); $list->CustomPaging = true; self::assertEquals(2, $list[1]); } - + public function testToArray() { $list = new TPagedList(array(1, 2, 3)); $list->CustomPaging = true; @@ -225,4 +225,3 @@ class TPagedListTest extends PHPUnit_Framework_TestCase { } -?> diff --git a/tests/unit/Collections/TPriorityMapTest.php b/tests/unit/Collections/TPriorityMapTest.php index 7c6ed498..847e09fe 100644 --- a/tests/unit/Collections/TPriorityMapTest.php +++ b/tests/unit/Collections/TPriorityMapTest.php @@ -22,10 +22,10 @@ class TPriorityMapTest extends PHPUnit_Framework_TestCase { $this->item5=new TPriorityMapTest_MapItem; $this->map->add('key1',$this->item1); $this->map->add('key2',$this->item2); - + //Test the priority capabilities } - + public function setUpPriorities() { $this->map->add('key3', $this->item3, 0); $this->map->add('key4', $this->item4, 100); @@ -45,16 +45,16 @@ class TPriorityMapTest extends PHPUnit_Framework_TestCase { $this->assertEquals(3,$map->getCount()); $map2=new TPriorityMap($this->map); $this->assertEquals(2,$map2->getCount()); - + /* Test the priority functionality of TPriorityMap */ - + $map3=new TPriorityMap($this->map, false, 100, -1); $this->assertEquals(100,$map3->getDefaultPriority()); $this->assertEquals(-1,$map3->getPrecision()); } - + /* Test that TPriorityMap complies with TMap */ - + public function testGetReadOnly() { $map = new TPriorityMap(null, true); @@ -202,46 +202,46 @@ class TPriorityMapTest extends PHPUnit_Framework_TestCase { $this->assertTrue(isset($this->map['key1'])); $this->assertFalse(isset($this->map['unknown key'])); } - + public function testToArray() { $map = new TPriorityMap(array('key' => 'value')); self::assertEquals(array('key' => 'value'), $map->toArray()); } - - - - + + + + /* Test the priority functionality of TPriorityMap */ - - + + public function testDefaultPriorityAndPrecision() { - + $this->assertEquals(10, $this->map->DefaultPriority); - + $this->map->DefaultPriority = 5; $this->assertEquals(5, $this->map->getDefaultPriority()); - + $this->assertEquals(8, $this->map->Precision); - + $this->map->Precision = 0; $this->assertEquals(0, $this->map->getPrecision()); - + ; - + $this->assertEquals(5, $this->map->add('key3', $this->item3)); $this->assertEquals(10, $this->map->add('key4', $this->item1, 10)); $this->assertTrue(10 == $this->map->add('key4', $this->item1, 10.01)); $this->assertTrue(100 == $this->map->add('key4', $this->item1, 100)); $this->map->Precision = 1; $this->assertTrue(10.1 == $this->map->add('key5', $this->item1, 10.1)); - + $this->assertEquals(5, $this->map->getCount()); } - + public function testAddWithPriorityAndPriorityOfAt() { - + $this->setUpPriorities(); - + $this->assertEquals(5, $this->map->getCount()); $this->assertEquals(10, $this->map->priorityOf($this->item1)); $this->assertEquals(0, $this->map->priorityOf($this->item3)); @@ -249,74 +249,74 @@ class TPriorityMapTest extends PHPUnit_Framework_TestCase { $this->assertEquals(1, $this->map->priorityOf($this->item5)); $this->assertEquals(false, $this->map->priorityOf(null)); $this->assertEquals(false, $this->map->priorityOf('foo')); - + $this->assertEquals(10, $this->map->priorityAt('key1')); $this->assertEquals(0, $this->map->priorityAt('key3')); $this->assertEquals(100, $this->map->priorityAt('key4')); $this->assertEquals(1, $this->map->priorityAt('key5')); $this->assertEquals(false, $this->map->priorityAt(null)); $this->assertEquals(false, $this->map->priorityAt('foo')); - + } - + public function testRemoveWithPriorityAndItemsAtWithPriority() { - + $this->setUpPriorities(); - + $this->assertEquals(5, $this->map->getCount()); $this->map->remove('key6'); $this->assertEquals(5, $this->map->getCount()); $this->map->remove('key6', null); $this->assertEquals(5, $this->map->getCount()); - - + + // key5 is at priority 1... not the default priority defined by null... nothing should happen here $this->map->remove('key5', null); $this->assertEquals(5, $this->map->getCount()); - + // key5 is at priority 1... not 50... nothing should happen here $this->map->remove('key5', 50); $this->assertEquals(5, $this->map->getCount()); - - - + + + $this->assertEquals(array('key3'=>$this->item3), $this->map->itemsAtPriority(0)); $this->assertEquals(array('key1'=>$this->item1, 'key2'=>$this->item2), $this->map->itemsAtPriority($this->map->DefaultPriority)); - + $this->assertEquals($this->item2, $this->map->itemAt('key2')); $this->assertEquals($this->item2, $this->map->itemAt('key2', 10)); $this->assertNull($this->map->itemAt('key2', 11)); //'key2' doesn't exist and priority 11... it is only at priority 10 $this->assertNull($this->map->itemAt('key2', 10.1)); //'key2' doesn't exist and priority 10.1... it is only at priority 10 - + $this->assertEquals($this->item4, $this->map->remove('key4')); $this->assertEquals(4, $this->map->getCount()); - + $this->assertEquals($this->item5, $this->map->remove('key5')); $this->assertEquals(3, $this->map->getCount()); } public function testIteratorAndArrayWithPriorities() { - + $this->setUpPriorities(); - + // This is the primary reason for a TPriorityMap $array = $this->map->toArray(); - + $ordered_keys = array_keys($array); $this->assertEquals('key3', $ordered_keys[0]); $this->assertEquals('key5', $ordered_keys[1]); $this->assertEquals('key1', $ordered_keys[2]); $this->assertEquals('key2', $ordered_keys[3]); $this->assertEquals('key4', $ordered_keys[4]); - + $ordered_values = array_values($array); $this->assertEquals($this->item3, $ordered_values[0]); $this->assertEquals($this->item5, $ordered_values[1]); $this->assertEquals($this->item1, $ordered_values[2]); $this->assertEquals($this->item2, $ordered_values[3]); $this->assertEquals($this->item4, $ordered_values[4]); - + $iter = $this->map->getIterator(); - + $this->assertTrue($iter->valid()); $this->assertEquals('key3', $iter->key()); $this->assertEquals($this->item1, $iter->current()); @@ -341,31 +341,31 @@ class TPriorityMapTest extends PHPUnit_Framework_TestCase { $this->assertEquals(null, $iter->key()); $this->assertEquals(null, $iter->current()); } - - + + public function testGetPriorities() { $this->setUpPriorities(); - + $priorities = $this->map->getPriorities(); - + $this->assertEquals(0, $priorities[0]); $this->assertEquals(1, $priorities[1]); $this->assertEquals(10, $priorities[2]); $this->assertEquals(100, $priorities[3]); $this->assertEquals(false, isset($priorities[4])); } - - + + public function testCopyAndMergeWithPriorities() { $this->setUpPriorities(); - + $map1 = new TPriorityMap(); $map1->add('key1', $this->item1); $map1->add('keyc', 'valuec'); $map1->copyFrom($this->map); - + $this->assertEquals(5, $map1->getCount()); - + $array = $map1->toArray(); $ordered_keys = array_keys($array); $this->assertEquals('key3', $ordered_keys[0]); @@ -373,24 +373,24 @@ class TPriorityMapTest extends PHPUnit_Framework_TestCase { $this->assertEquals('key1', $ordered_keys[2]); $this->assertEquals('key2', $ordered_keys[3]); $this->assertEquals('key4', $ordered_keys[4]); - + $ordered_values = array_values($array); $this->assertEquals($this->item3, $ordered_values[0]); $this->assertEquals($this->item5, $ordered_values[1]); $this->assertEquals($this->item1, $ordered_values[2]); $this->assertEquals($this->item2, $ordered_values[3]); $this->assertEquals($this->item4, $ordered_values[4]); - - - + + + $map2 = new TPriorityMap(); $map2->add('startkey', 'startvalue', -1000); $map2->add('key5', 'value5', 40); $map2->add('endkey', 'endvalue', 1000); $map2->mergeWith($this->map); - + $this->assertEquals(7, $map2->getCount()); - + $array = $map2->toArray(); $ordered_keys = array_keys($array); $this->assertEquals('startkey', $ordered_keys[0]); @@ -400,7 +400,7 @@ class TPriorityMapTest extends PHPUnit_Framework_TestCase { $this->assertEquals('key2', $ordered_keys[4]); $this->assertEquals('key4', $ordered_keys[5]); $this->assertEquals('endkey', $ordered_keys[6]); - + $ordered_values = array_values($array); $this->assertEquals('startvalue', $ordered_values[0]); $this->assertEquals($this->item3, $ordered_values[1]); @@ -409,81 +409,80 @@ class TPriorityMapTest extends PHPUnit_Framework_TestCase { $this->assertEquals($this->item2, $ordered_values[4]); $this->assertEquals($this->item4, $ordered_values[5]); $this->assertEquals('endvalue', $ordered_values[6]); - + $this->assertEquals(1, $map2->priorityAt('key5')); $this->assertEquals(1, $map2->priorityOf($this->item5)); } - + public function testSetPriorityAt() { - + $this->assertEquals(10, $this->map->priorityAt('key2')); $this->assertEquals(10, $this->map->setPriorityAt('key2', 1)); $this->assertEquals(1, $this->map->priorityAt('key2')); $this->assertEquals(1, $this->map->setPriorityAt('key2')); $this->assertEquals(10, $this->map->priorityAt('key2')); } - + public function testToArrayBelowPriority() { $this->setUpPriorities(); - + $array = $this->map->toArrayBelowPriority(1); $this->assertEquals(array('key3'=> $this->item3), $array); $this->assertEquals(1, count($array)); - + $array = $this->map->toArrayBelowPriority(1, true); $this->assertEquals(array('key3'=> $this->item3, 'key5'=> $this->item5), $array); $this->assertEquals(2, count($array)); - + $array = $this->map->toArrayBelowPriority(2); $this->assertEquals(array('key3'=> $this->item3, 'key5'=> $this->item5), $array); $this->assertEquals(2, count($array)); - + $array = $this->map->toArrayBelowPriority(10); $this->assertEquals(array('key3'=> $this->item3, 'key5'=> $this->item5), $array); $this->assertEquals(2, count($array)); - + $array = $this->map->toArrayBelowPriority(10, true); $this->assertEquals(array('key3'=> $this->item3, 'key5'=> $this->item5, 'key1' => $this->item1, 'key2' => $this->item2), $array); $this->assertEquals(4, count($array)); - + $array = $this->map->toArrayBelowPriority(100); $this->assertEquals(array('key3'=> $this->item3, 'key5'=> $this->item5, 'key1' => $this->item1, 'key2' => $this->item2), $array); $this->assertEquals(4, count($array)); - + $array = $this->map->toArrayBelowPriority(100, true); $this->assertEquals(array('key3'=> $this->item3, 'key5'=> $this->item5, 'key1' => $this->item1, 'key2' => $this->item2, 'key4' => $this->item4), $array); $this->assertEquals(5, count($array)); } - + public function testToArrayAbovePriority() { $this->setUpPriorities(); - + $array = $this->map->toArrayAbovePriority(100, false); $this->assertEquals(0, count($array)); - + $array = $this->map->toArrayAbovePriority(100, true); $this->assertEquals(1, count($array)); $this->assertEquals(array('key4' => $this->item4), $array); - + $array = $this->map->toArrayAbovePriority(11); $this->assertEquals(array('key4' => $this->item4), $array); $this->assertEquals(1, count($array)); - + $array = $this->map->toArrayAbovePriority(10, false); $this->assertEquals(array('key4' => $this->item4), $array); $this->assertEquals(1, count($array)); - + $array = $this->map->toArrayAbovePriority(10); $this->assertEquals(array('key1' => $this->item1, 'key2' => $this->item2, 'key4' => $this->item4), $array); $this->assertEquals(3, count($array)); - + $array = $this->map->toArrayAbovePriority(0); $this->assertEquals(array('key3' => $this->item3, 'key5' => $this->item5, 'key1' => $this->item1, 'key2' => $this->item2, 'key4' => $this->item4), $array); $this->assertEquals(5, count($array)); } - - - + + + } -?> diff --git a/tests/unit/Collections/TQueueTest.php b/tests/unit/Collections/TQueueTest.php index efee7cb7..da60eae3 100644 --- a/tests/unit/Collections/TQueueTest.php +++ b/tests/unit/Collections/TQueueTest.php @@ -31,7 +31,7 @@ class TQueueTest extends PHPUnit_Framework_TestCase { $queue->copyFrom($data); self::assertEquals(array(4, 5, 6), $queue->toArray()); } - + public function testCanNotCopyFromNonTraversableTypes() { $queue = new TQueue(); $data = new stdClass(); @@ -42,7 +42,7 @@ class TQueueTest extends PHPUnit_Framework_TestCase { } self::fail('An expected TInvalidDataTypeException was not raised'); } - + public function testClear() { $queue = new TQueue(array(1, 2, 3)); $queue->clear(); @@ -59,7 +59,7 @@ class TQueueTest extends PHPUnit_Framework_TestCase { $queue = new TQueue(array(1,2,3)); self::assertEquals(1, $queue->peek()); } - + public function testCanNotPeekAnEmptyQueue() { $queue = new TQueue(); try { @@ -76,7 +76,7 @@ class TQueueTest extends PHPUnit_Framework_TestCase { self::assertEquals(1, $first); self::assertEquals(array(2, 3), $queue->toArray()); } - + public function testCanNotDequeueAnEmptyQueue() { $queue = new TQueue(); try { @@ -105,7 +105,7 @@ class TQueueTest extends PHPUnit_Framework_TestCase { $found++; } if($index === 1 && $item === 2) { - $found++; + $found++; } } self::assertTrue($n == 2 && $found == 2); @@ -117,7 +117,7 @@ class TQueueTest extends PHPUnit_Framework_TestCase { $queue = new TQueue(array(1, 2, 3)); self::assertEquals(3, $queue->getCount()); } - + public function testCountable() { $queue = new TQueue(); self::assertEquals(0, count($queue)); @@ -127,4 +127,3 @@ class TQueueTest extends PHPUnit_Framework_TestCase { } -?> diff --git a/tests/unit/Collections/TStackTest.php b/tests/unit/Collections/TStackTest.php index 89a42749..80dc77c3 100644 --- a/tests/unit/Collections/TStackTest.php +++ b/tests/unit/Collections/TStackTest.php @@ -31,7 +31,7 @@ class TStackTest extends PHPUnit_Framework_TestCase { $stack->copyFrom($data); self::assertEquals(array(4, 5, 6), $stack->toArray()); } - + public function testCanNotCopyFromNonTraversableTypes() { $stack = new TStack(); $data = new stdClass(); @@ -42,7 +42,7 @@ class TStackTest extends PHPUnit_Framework_TestCase { } self::fail('An expected TInvalidDataTypeException was not raised'); } - + public function testClear() { $stack = new TStack(array(1, 2, 3)); $stack->clear(); @@ -59,7 +59,7 @@ class TStackTest extends PHPUnit_Framework_TestCase { $stack = new TStack(array(1)); self::assertEquals(1, $stack->peek()); } - + public function testCanNotPeekAnEmptyStack() { $stack = new TStack(); try { @@ -76,7 +76,7 @@ class TStackTest extends PHPUnit_Framework_TestCase { self::assertEquals(3, $last); self::assertEquals(array(1, 2), $stack->toArray()); } - + public function testCanNotPopAnEmptyStack() { $stack = new TStack(); try { @@ -105,7 +105,7 @@ class TStackTest extends PHPUnit_Framework_TestCase { $found++; } if($index === 1 && $item === 2) { - $found++; + $found++; } } self::assertTrue($n == 2 && $found == 2); @@ -117,7 +117,7 @@ class TStackTest extends PHPUnit_Framework_TestCase { $stack = new TStack(array(1, 2, 3)); self::assertEquals(3, $stack->getCount()); } - + public function testCount() { $stack = new TStack(); self::assertEquals(0, count($stack)); @@ -127,4 +127,3 @@ class TStackTest extends PHPUnit_Framework_TestCase { } -?> diff --git a/tests/unit/Data/DataGateway/AllTests.php b/tests/unit/Data/DataGateway/AllTests.php index f9ba1ddc..6007ae70 100644 --- a/tests/unit/Data/DataGateway/AllTests.php +++ b/tests/unit/Data/DataGateway/AllTests.php @@ -12,12 +12,12 @@ class Data_DataGateway_AllTests { public static function main() { PHPUnit_TextUI_TestRunner::run(self::suite()); } - + public static function suite() { $suite = new PHPUnit_Framework_TestSuite('System.Data.DataGateway'); - + $suite->addTestSuite('TSqlCriteriaTest'); - + return $suite; } } @@ -25,4 +25,3 @@ class Data_DataGateway_AllTests { if(PHPUnit_MAIN_METHOD == 'Data_DataGateway_AllTests::main') { Data_DataGateway_AllTests::main(); } -?> diff --git a/tests/unit/Data/DataGateway/TSqlCriteriaTest.php b/tests/unit/Data/DataGateway/TSqlCriteriaTest.php index fb9c72b2..ce22ef1d 100644 --- a/tests/unit/Data/DataGateway/TSqlCriteriaTest.php +++ b/tests/unit/Data/DataGateway/TSqlCriteriaTest.php @@ -17,7 +17,7 @@ class TSqlCriteriaTest extends PHPUnit_Framework_TestCase { public function testConstruct() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testConditionWithOrderByColumnNames() { $criteria = new TSqlCriteria(); $criteria->Condition = "SELECT * FROM table_references ORDER BY field1 ASC, field2 DESC"; @@ -27,7 +27,7 @@ class TSqlCriteriaTest extends PHPUnit_Framework_TestCase { self::assertEquals(true, isset($criteria->OrdersBy['field2'])); self::assertEquals('DESC', $criteria->OrdersBy['field2']); } - + public function testConditionWithOrderByExpression() { $criteria = new TSqlCriteria(); $criteria->Condition = "SELECT * FROM table_references ORDER BY RAND()"; @@ -42,7 +42,7 @@ class TSqlCriteriaTest extends PHPUnit_Framework_TestCase { self::assertEquals("SELECT * FROM table_references", $criteria->Condition); self::assertEquals(2, $criteria->Limit); } - + public function testConditionWithOrderByAndLimitAndOffset() { $criteria = new TSqlCriteria(); $criteria->Condition = "SELECT * FROM table_references ORDER BY field1 ASC, field2 DESC LIMIT 3, 2"; @@ -50,7 +50,7 @@ class TSqlCriteriaTest extends PHPUnit_Framework_TestCase { self::assertEquals(2, $criteria->Limit); self::assertEquals(3, $criteria->Offset); } - + public function testConditionWithOrderByAndLimitAndOffsetVariant() { $criteria = new TSqlCriteria(); $criteria->Condition = "SELECT * FROM table_references ORDER BY field1 ASC, field2 DESC LIMIT 2 OFFSET 3"; @@ -58,14 +58,14 @@ class TSqlCriteriaTest extends PHPUnit_Framework_TestCase { self::assertEquals(2, $criteria->Limit); self::assertEquals(3, $criteria->Offset); } - + public function testConditionWithLimit() { $criteria = new TSqlCriteria(); $criteria->Condition = "SELECT * FROM table_references LIMIT 2"; self::assertEquals("SELECT * FROM table_references", $criteria->Condition); self::assertEquals(2, $criteria->Limit); } - + public function testConditionWithLimitAndOffset() { $criteria = new TSqlCriteria(); $criteria->Condition = "SELECT * FROM table_references LIMIT 3, 2"; @@ -73,7 +73,7 @@ class TSqlCriteriaTest extends PHPUnit_Framework_TestCase { self::assertEquals(2, $criteria->Limit); self::assertEquals(3, $criteria->Offset); } - + public function testConditionWithLimitAndOffsetVariant() { $criteria = new TSqlCriteria(); $criteria->Condition = "SELECT * FROM table_references LIMIT 2 OFFSET 3"; @@ -85,27 +85,26 @@ class TSqlCriteriaTest extends PHPUnit_Framework_TestCase { public function testParameters() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testIsNamedParameters() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testOrdersBy() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testLimit() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testOffset() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testToString() { throw new PHPUnit_Framework_IncompleteTestError(); } } -?> diff --git a/tests/unit/Data/SqlMap/AllTests.php b/tests/unit/Data/SqlMap/AllTests.php index 3adaa29c..08870eb3 100644 --- a/tests/unit/Data/SqlMap/AllTests.php +++ b/tests/unit/Data/SqlMap/AllTests.php @@ -27,4 +27,3 @@ class Data_SqlMap_AllTests { if(PHPUnit_MAIN_METHOD == 'Data_SqlMap_AllTests::main') { Data_SqlMap_AllTests::main(); } -?> diff --git a/tests/unit/Data/SqlMap/DataMapper/AllTests.php b/tests/unit/Data/SqlMap/DataMapper/AllTests.php index 47b8522f..d685d474 100644 --- a/tests/unit/Data/SqlMap/DataMapper/AllTests.php +++ b/tests/unit/Data/SqlMap/DataMapper/AllTests.php @@ -24,5 +24,4 @@ class Data_SqlMap_DataMapper_AllTests { if(PHPUnit_MAIN_METHOD == 'Data_SqlMap_DataMapper_AllTests::main') { Data_SqlMap_DataMapper_AllTests::main(); -} -?>
\ No newline at end of file +}
\ No newline at end of file diff --git a/tests/unit/Data/SqlMap/DataMapper/TPropertyAccessTest.php b/tests/unit/Data/SqlMap/DataMapper/TPropertyAccessTest.php index 61747c6b..3f5493c7 100644 --- a/tests/unit/Data/SqlMap/DataMapper/TPropertyAccessTest.php +++ b/tests/unit/Data/SqlMap/DataMapper/TPropertyAccessTest.php @@ -265,5 +265,3 @@ class _PropertyAccessTestHelperDynamicProperties } } } - -?>
\ No newline at end of file diff --git a/tests/unit/Data/SqlMap/DynamicParameterTest.php b/tests/unit/Data/SqlMap/DynamicParameterTest.php index 64f5e35c..136111db 100644 --- a/tests/unit/Data/SqlMap/DynamicParameterTest.php +++ b/tests/unit/Data/SqlMap/DynamicParameterTest.php @@ -105,5 +105,3 @@ class DynamicParameterTest extends PHPUnit_Framework_TestCase } } - -?>
\ No newline at end of file diff --git a/tests/unit/Data/TDbCommandTest.php b/tests/unit/Data/TDbCommandTest.php index a75674bf..55d7d559 100644 --- a/tests/unit/Data/TDbCommandTest.php +++ b/tests/unit/Data/TDbCommandTest.php @@ -216,5 +216,3 @@ class TDbCommandTest extends PHPUnit_Framework_TestCase } } } - -?>
\ No newline at end of file diff --git a/tests/unit/Data/TDbConnectionTest.php b/tests/unit/Data/TDbConnectionTest.php index 8f6ff34f..e7e3ef74 100644 --- a/tests/unit/Data/TDbConnectionTest.php +++ b/tests/unit/Data/TDbConnectionTest.php @@ -121,5 +121,3 @@ class TDbConnectionTest extends PHPUnit_Framework_TestCase $this->assertEquals(TDbNullConversionMode::NullToEmptyString,$this->_connection1->NullConversion); } } - -?>
\ No newline at end of file diff --git a/tests/unit/Data/TDbDataReaderTest.php b/tests/unit/Data/TDbDataReaderTest.php index 98aa0385..0595f3e2 100644 --- a/tests/unit/Data/TDbDataReaderTest.php +++ b/tests/unit/Data/TDbDataReaderTest.php @@ -174,5 +174,3 @@ class TDbDataReaderTest extends PHPUnit_Framework_TestCase $this->assertEquals($name,'my name 2'); } } - -?>
\ No newline at end of file diff --git a/tests/unit/Data/TDbTransactionTest.php b/tests/unit/Data/TDbTransactionTest.php index c608bce1..a901394d 100644 --- a/tests/unit/Data/TDbTransactionTest.php +++ b/tests/unit/Data/TDbTransactionTest.php @@ -68,5 +68,3 @@ class TDbTransactionTest extends PHPUnit_Framework_TestCase $this->assertEquals(count($result),2); } } - -?>
\ No newline at end of file diff --git a/tests/unit/I18N/core/AllTests.php b/tests/unit/I18N/core/AllTests.php index 43bbdb36..bf5fb813 100644 --- a/tests/unit/I18N/core/AllTests.php +++ b/tests/unit/I18N/core/AllTests.php @@ -15,16 +15,16 @@ class I18N_core_AllTests { public static function main() { PHPUnit_TextUI_TestRunner::run(self::suite()); } - + public static function suite() { $suite = new PHPUnit_Framework_TestSuite('System.I18N.core'); - + $suite->addTestSuite('CultureInfoTest'); $suite->addTestSuite('DateFormatTest'); $suite->addTestSuite('DateTimeFormatInfoTest'); $suite->addTestSuite('NumberFormatInfoTest'); $suite->addTestSuite('NumberFormatTest'); - + return $suite; } } @@ -32,4 +32,3 @@ class I18N_core_AllTests { if(PHPUnit_MAIN_METHOD == 'I18N_core_AllTests::main') { I18N_core_AllTests::main(); } -?> diff --git a/tests/unit/I18N/core/ChoiceFormatTest.php b/tests/unit/I18N/core/ChoiceFormatTest.php index ef397e05..2c8ab5cb 100644 --- a/tests/unit/I18N/core/ChoiceFormatTest.php +++ b/tests/unit/I18N/core/ChoiceFormatTest.php @@ -97,5 +97,3 @@ class ChoiceFormatTest extends PHPUnit_Framework_TestCase } } } - -?>
\ No newline at end of file diff --git a/tests/unit/I18N/core/CultureInfoTest.php b/tests/unit/I18N/core/CultureInfoTest.php index 6c1eda06..58c8f235 100644 --- a/tests/unit/I18N/core/CultureInfoTest.php +++ b/tests/unit/I18N/core/CultureInfoTest.php @@ -8,16 +8,16 @@ Prado::using('System.I18N.core.CultureInfo'); */ class CultureInfoTest extends PHPUnit_Framework_TestCase { protected $culture; - + function setUp() { $this->culture = CultureInfo::getInvariantCulture(); } - + function testCultureName() { $name = 'en'; - + $this->assertEquals($name, $this->culture->Name); - + //the default/invariant culture should be neutral $this->assertTrue($this->culture->IsNeutralCulture); } @@ -26,18 +26,18 @@ class CultureInfoTest extends PHPUnit_Framework_TestCase { $allCultures = CultureInfo::getCultures(); $neutralCultures = CultureInfo::getCultures(CultureInfo::NEUTRAL); $specificCultures = CultureInfo::getCultures(CultureInfo::SPECIFIC); - + //there should be 246 cultures all together. $this->assertEquals(count($allCultures),246); $this->assertEquals(count($neutralCultures),76); - $this->assertEquals(count($specificCultures),170); + $this->assertEquals(count($specificCultures),170); } function testParentCultures() { $zh_CN = new CultureInfo('zh_CN'); $parent = $zh_CN->Parent; $grandparent = $parent->Parent; - + $this->assertEquals($zh_CN->Name, 'zh_CN'); $this->assertEquals($parent->Name, 'zh'); $this->assertEquals($grandparent->Name, 'en'); @@ -54,17 +54,17 @@ class CultureInfoTest extends PHPUnit_Framework_TestCase { $au = array('$', 'Australian Dollar'); $this->assertEquals($au, $culture->Currencies['AUD']); } - + function testLanguages() { $culture = new CultureInfo('fr_BE'); $this->assertEquals($culture->Languages['fr'], 'français'); } - + function testScripts() { $culture = new CultureInfo('fr'); $this->assertEquals($culture->Scripts['Armn'], 'arménien'); } - + function testTimeZones() { $culture = new CultureInfo('fi'); $zone = array( @@ -83,5 +83,3 @@ class CultureInfoTest extends PHPUnit_Framework_TestCase { $this->assertEquals($culture->getEnglishName(), 'iw'); } } - -?>
\ No newline at end of file diff --git a/tests/unit/I18N/core/DateFormatTest.php b/tests/unit/I18N/core/DateFormatTest.php index 8015bd74..d8350204 100644 --- a/tests/unit/I18N/core/DateFormatTest.php +++ b/tests/unit/I18N/core/DateFormatTest.php @@ -10,86 +10,84 @@ class DateFormatTest extends PHPUnit_Framework_TestCase { public function testStandardPatterns() { $dateFormatter = new DateFormat(); - + $time = @mktime(9, 9, 9, 9, 1, 2004); $zone = @date('T', $time); //var_dump(date('c',$time)); //for ShortDatePattern "M/d/yy" $this->assertEquals('9/1/04', $dateFormatter->format($time, 'd')); //var_dump(date('c',strtotime($dateFormatter->format($time,'d')))); - + //for LongDatePattern "MMMM d, yyyy" $wants = 'September 1, 2004'; $this->assertEquals($wants, $dateFormatter->format($time, 'D')); //var_dump(date('c',strtotime($dateFormatter->format($time,'D')))); - + //for Full date and time "MMMM d, yyyy h:mm a" $wants = 'September 1, 2004 9:09 AM'; $this->assertEquals($wants, $dateFormatter->format($time, 'f')); //var_dump(date('c',strtotime($dateFormatter->format($time,'f')))); - + //for FullDateTimePattern "MMMM d, yyyy h:mm:ss a z" $wants = 'September 1, 2004 9:09:09 AM '.$zone; $this->assertEquals($wants, $dateFormatter->format($time, 'F')); - + //for General "M/d/yy h:mm a" $wants = '9/1/04 9:09 AM'; $this->assertEquals($wants, $dateFormatter->format($time, 'g')); //var_dump(date('c',strtotime($dateFormatter->format($time,'g')))); - + //for General "M/d/yy h:mm:ss a z" $wants = '9/1/04 9:09:09 AM '.$zone; - $this->assertEquals($wants, $dateFormatter->format($time, 'G')); - + $this->assertEquals($wants, $dateFormatter->format($time, 'G')); + //for MonthDayPattern "MMMM dd" (invariant) $wants = 'September 01'; $this->assertEquals($wants, $dateFormatter->format($time, 'm')); //var_dump(date('c',strtotime($dateFormatter->format($time,'m')))); - + //for RFC1123Pattern "EEE, dd MMM yyyy HH:mm:ss" (invariant) $wants = 'Wed, 01 Sep 2004 09:09:09'; - $this->assertEquals($wants, $dateFormatter->format($time, 'r')); + $this->assertEquals($wants, $dateFormatter->format($time, 'r')); //var_dump(date('c',strtotime($dateFormatter->format($time,'r')))); - + //for SortableDateTimePattern "yyyy-MM-ddTHH:mm:ss" (invariant) $wants = '2004-09-01T09:09:09'; - $this->assertEquals($wants, $dateFormatter->format($time, 's')); + $this->assertEquals($wants, $dateFormatter->format($time, 's')); //var_dump(date('c',strtotime($dateFormatter->format($time,'s')))); - + //for ShortTimePattern "H:mm a" $wants = '9:09 AM'; - $this->assertEquals($wants, $dateFormatter->format($time, 't')); + $this->assertEquals($wants, $dateFormatter->format($time, 't')); //(date('c',strtotime($dateFormatter->format($time,'t')))); - + //for LongTimePattern "H:mm:ss a z" $wants = '9:09:09 AM '.$zone; - $this->assertEquals($wants, $dateFormatter->format($time, 'T')); - - //for UniversalSortableDateTimePattern "yyyy-MM-dd HH:mm:ss z" + $this->assertEquals($wants, $dateFormatter->format($time, 'T')); + + //for UniversalSortableDateTimePattern "yyyy-MM-dd HH:mm:ss z" //(invariant) $wants = '2004-09-01 09:09:09 '.$zone; - $this->assertEquals($wants, $dateFormatter->format($time, 'u')); - + $this->assertEquals($wants, $dateFormatter->format($time, 'u')); + //for Full date and time "EEEE dd MMMM yyyy HH:mm:ss" (invariant) $wants = 'Wednesday 01 September 2004 09:09:09'; - $this->assertEquals($wants, $dateFormatter->format($time, 'U')); + $this->assertEquals($wants, $dateFormatter->format($time, 'U')); //var_dump(date('c',strtotime($dateFormatter->format($time,'U')))); - + //for YearMonthPattern "yyyy MMMM" (invariant) $wants = '2004 September'; - $this->assertEquals($wants, $dateFormatter->format($time, 'y')); + $this->assertEquals($wants, $dateFormatter->format($time, 'y')); //var_dump(date('c',strtotime($dateFormatter->format($time,'y')))); } - + public function testCustomPatterns() { $dateFormatter = new DateFormat(); - + $time = @mktime(9, 9, 9, 9, 1, 2004); - + $pattern = "'Hello' EEEE, 'it should be' MMM yyyy HH:mm:ss!!!"; $wants = 'Hello Wednesday, it should be Sep 2004 09:09:09!!!'; - $this->assertEquals($wants, $dateFormatter->format($time, $pattern)); + $this->assertEquals($wants, $dateFormatter->format($time, $pattern)); } } - -?>
\ No newline at end of file diff --git a/tests/unit/I18N/core/DateTimeFormatInfoTest.php b/tests/unit/I18N/core/DateTimeFormatInfoTest.php index 442a6b85..ac93e1c7 100644 --- a/tests/unit/I18N/core/DateTimeFormatInfoTest.php +++ b/tests/unit/I18N/core/DateTimeFormatInfoTest.php @@ -9,20 +9,20 @@ Prado::using('System.I18N.core.DateTimeFormatInfo'); class DateTimeFormatInfoTest extends PHPUnit_Framework_TestCase { protected $format; - + function setUp() { $this->format = DateTimeFormatInfo::getInstance('en'); } - + function testAbbreviatedDayNames() { $names = $this->format->AbbreviatedDayNames; $this->assertTrue(is_array($names),'Must be an array!'); $this->assertEquals(count($names),7,'Must have 7 day names'); - + //assuming invariant culture. $days = array("Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"); $this->assertEquals($names, $days); - + //try to set the data $data = array('Hel', 'wor'); $this->format->AbbreviatedDayNames = $data; @@ -31,16 +31,16 @@ class DateTimeFormatInfoTest extends PHPUnit_Framework_TestCase { $this->assertEquals(count($newNames),2,'Must have 2 entries'); $this->assertEquals($newNames, $data); } - + function testNarrowDayNames() { $names = $this->format->NarrowDayNames; $this->assertTrue(is_array($names),'Must be an array!'); $this->assertEquals(count($names),7,'Must have 7 day names'); - + //assuming invariant culture. $days = array("S", "M", "T", "W", "T", "F", "S"); $this->assertEquals($names, $days); - + //try to set the data $data = array('H', 'w'); $this->format->NarrowDayNames = $data; @@ -49,17 +49,17 @@ class DateTimeFormatInfoTest extends PHPUnit_Framework_TestCase { $this->assertEquals(count($newNames),2,'Must have 2 entries'); $this->assertEquals($newNames, $data); } - + function testDayNames() { $names = $this->format->DayNames; $this->assertTrue(is_array($names),'Must be an array!'); $this->assertEquals(count($names),7,'Must have 7 day names'); - + //assuming invariant culture. $days = array( "Sunday","Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"); $this->assertEquals($names, $days); - + //try to set the data $data = array('Hello', 'world'); $this->format->DayNames = $data; @@ -68,18 +68,18 @@ class DateTimeFormatInfoTest extends PHPUnit_Framework_TestCase { $this->assertEquals(count($newNames),2,'Must have 2 entries'); $this->assertEquals($newNames, $data); } - + function testMonthNames() { $names = $this->format->MonthNames; $this->assertTrue(is_array($names),'Must be an array!'); $this->assertEquals(count($names),12,'Must have 12 month names'); - + //assuming invariant culture. $days = array( "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"); $this->assertEquals($names, $days); - + //try to set the data $data = array('Hello', 'world'); $this->format->MonthNames = $data; @@ -88,17 +88,17 @@ class DateTimeFormatInfoTest extends PHPUnit_Framework_TestCase { $this->assertEquals(count($newNames),2,'Must have 2 entries'); $this->assertEquals($newNames, $data); } - + function testNarrowMonthNames() { $names = $this->format->NarrowMonthNames; $this->assertTrue(is_array($names),'Must be an array!'); $this->assertEquals(count($names),12,'Must have 12 month names'); - + //assuming invariant culture. $days = array( "J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"); $this->assertEquals($names, $days); - + //try to set the data $data = array('Hello', 'world'); $this->format->NarrowMonthNames = $data; @@ -112,13 +112,13 @@ class DateTimeFormatInfoTest extends PHPUnit_Framework_TestCase { $names = $this->format->AbbreviatedMonthNames; $this->assertTrue(is_array($names),'Must be an array!'); $this->assertEquals(count($names),12,'Must have 12 month names'); - + //assuming invariant culture. $days = array( "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"); $this->assertEquals($names, $days); - + //try to set the data $data = array('Hello', 'world'); $this->format->AbbreviatedMonthNames = $data; @@ -134,7 +134,7 @@ class DateTimeFormatInfoTest extends PHPUnit_Framework_TestCase { $this->assertEquals('AD', $this->format->getEra(1)); $this->assertEquals('BC', $this->format->getEra(0)); } - + function testAMPMMarkers() { $am_pm = array('AM','PM'); $data = $this->format->AMPMMarkers; @@ -142,7 +142,7 @@ class DateTimeFormatInfoTest extends PHPUnit_Framework_TestCase { $this->assertEquals($am_pm, $data); $this->assertEquals('AM', $this->format->AMDesignator); $this->assertEquals('PM', $this->format->PMDesignator); - + //try to set the data $data = array('Hello', 'world'); $this->format->AMPMMarkers = $data; @@ -150,10 +150,10 @@ class DateTimeFormatInfoTest extends PHPUnit_Framework_TestCase { $this->assertTrue(is_array($newNames),'Must be an array!'); $this->assertEquals(count($newNames),2,'Must have 2 entries'); $this->assertEquals($newNames, $data); - + $this->format->AMDesignator = 'TTTT'; $this->assertEquals('TTTT',$this->format->AMDesignator); - + $this->format->PMDesignator = 'SSS'; $this->assertEquals('SSS',$this->format->PMDesignator); } @@ -171,37 +171,36 @@ class DateTimeFormatInfoTest extends PHPUnit_Framework_TestCase { 'ShortDatePattern' => 'M/d/yy', 'DateTimeOrderPattern' => '{1} {0}' ); - + foreach($patterns as $property => $pattern) { $this->assertEquals($pattern, $this->format->$property); } - + $hello = 'Hello'; $world = 'world'; $expectedResult = $hello.' '.$world; $this->assertEquals($expectedResult, $this->format->formatDateTime($hello, $world)); } - + function testInvariantInfo() { $format = DateTimeFormatInfo::getInstance(); - + //the variant datetime format for medium date //should be the follow $pattern = 'MMM d, yyyy'; - + $this->assertEquals($pattern, $format->MediumDatePattern); - + $invariant = $format->getInvariantInfo(); - + $this->assertSame($format, $invariant); } - + function testGetInstance() { $format = DateTimeFormatInfo::getInstance('zh_CN'); - + $pattern = 'yyyy-M-d'; $this->assertEquals($pattern, $format->MediumDatePattern); - } -} -?>
\ No newline at end of file + } +}
\ No newline at end of file diff --git a/tests/unit/I18N/core/NumberFormatInfoTest.php b/tests/unit/I18N/core/NumberFormatInfoTest.php index d522144f..6243095a 100644 --- a/tests/unit/I18N/core/NumberFormatInfoTest.php +++ b/tests/unit/I18N/core/NumberFormatInfoTest.php @@ -8,27 +8,27 @@ Prado::using('System.I18N.core.NumberFormatInfo'); * @package System.I18N.core */ class NumberFormatInfoTest extends PHPUnit_Framework_TestCase { - + function testCurrencyPatterns() { $numberInfo = NumberFormatInfo::getCurrencyInstance(); - + //there should be 2 decimal places. $this->assertEquals($numberInfo->DecimalDigits,2); $this->assertEquals($numberInfo->DecimalSeparator,'.'); $this->assertEquals($numberInfo->GroupSeparator,','); - + //there should be only 1 grouping of size 3 $groupsize = array(3,false); $this->assertEquals($numberInfo->GroupSizes, $groupsize); - + //the default negative pattern prefix and postfix $negPattern = array('-¤',''); $this->assertEquals($numberInfo->NegativePattern, $negPattern); - + //the default positive pattern prefix and postfix $negPattern = array('¤',''); $this->assertEquals($numberInfo->PositivePattern, $negPattern); - + //the default currency symbol $this->assertEquals($numberInfo->CurrencySymbol, 'US$'); $this->assertEquals($numberInfo->getCurrencySymbol('JPY'), '¥'); @@ -38,51 +38,49 @@ class NumberFormatInfoTest extends PHPUnit_Framework_TestCase { $this->assertEquals($numberInfo->PositiveSign, '+'); $this->assertEquals($numberInfo->NaNSymbol, '�'); $this->assertEquals($numberInfo->PercentSymbol, '%'); - $this->assertEquals($numberInfo->PerMilleSymbol, '‰'); + $this->assertEquals($numberInfo->PerMilleSymbol, '‰'); } function testPatternsSet() { $numberInfo = NumberFormatInfo::getInstance(); - + $numberInfo->DecimalDigits = 0; $this->assertEquals($numberInfo->DecimalDigits,0); - + $numberInfo->DecimalSeparator = ','; $this->assertEquals($numberInfo->DecimalSeparator,','); - + $numberInfo->GroupSeparator = ' '; $this->assertEquals($numberInfo->GroupSeparator,' '); - + $numberInfo->GroupSizes = array(2,3); $groupsize = array(2,3); $this->assertEquals($numberInfo->GroupSizes, $groupsize); - + $numberInfo->NegativePattern = array('-$$','.'); $negPattern = array('-$$','.'); $this->assertEquals($numberInfo->NegativePattern, $negPattern); - + $numberInfo->PositivePattern = array('YY','.'); $negPattern = array('YY','.'); $this->assertEquals($numberInfo->PositivePattern, $negPattern); - + //the default CurrencySymbol symbol $numberInfo->CurrencySymbol = '$$$'; $this->assertEquals($numberInfo->CurrencySymbol, '$$$'); } - + function testLocalizedPatterns() { $fr = NumberFormatInfo::getInstance('fr'); $de = NumberFormatInfo::getInstance('de'); $en = NumberFormatInfo::getInstance('en_US'); - + $this->assertEquals($fr->DecimalSeparator, ','); $this->assertEquals($de->DecimalSeparator, ','); $this->assertEquals($en->DecimalSeparator, '.'); - + $this->assertEquals($fr->GroupSeparator, ' '); $this->assertEquals($de->GroupSeparator, '.'); $this->assertEquals($en->GroupSeparator, ','); } } - -?>
\ No newline at end of file diff --git a/tests/unit/I18N/core/NumberFormatTest.php b/tests/unit/I18N/core/NumberFormatTest.php index 958f05f4..ef8add77 100644 --- a/tests/unit/I18N/core/NumberFormatTest.php +++ b/tests/unit/I18N/core/NumberFormatTest.php @@ -14,7 +14,7 @@ class NumberFormatTest extends PHPUnit_Framework_TestCase { $wanted = '123,456,789.125156'; $this->assertEquals($wanted, $formatter->format($number)); - + //currency $wanted = 'US$123,456,789.13'; $this->assertEquals($wanted, $formatter->format($number,'c')); @@ -25,21 +25,21 @@ class NumberFormatTest extends PHPUnit_Framework_TestCase { $de = new NumberFormat('de'); $ja = new NumberFormat('ja_JP'); $it = new NumberFormat('it_IT'); - + $number = '123456789.125156'; - + //french $wanted = '123 456 789,13 F'; $this->assertEquals($wanted, $fr->format($number,'c','FRF')); - + //german $wanted = 'DES 123.456.789,13'; $this->assertEquals($wanted, $de->format($number,'c','DES')); - + //japanese $wanted = '¥123,456,789'; $this->assertEquals($wanted, $ja->format($number,'c','JPY')); - + //custom/unkown currency $wanted = 'DLL123,456,789'; $this->assertEquals($wanted, $ja->format($number,'c','DLL')); @@ -52,54 +52,54 @@ class NumberFormatTest extends PHPUnit_Framework_TestCase { function testCustomFormat() { $formatter = new NumberFormat(); $number = '123456789.125156'; - + //primay and secondary grouping test $pattern = '#,###,##.###'; $wanted = '1,234,567,89.125156'; $this->assertEquals($wanted, $formatter->format($number, $pattern)); - + //4 digits grouping test $pattern = '#,####.###'; $wanted = '1,2345,6789.125156'; $this->assertEquals($wanted, $formatter->format($number, $pattern)); - + //custom percentage $pattern = '#,###.00%'; $wanted = '123,456,789.13%'; $this->assertEquals($wanted, $formatter->format($number, $pattern)); } - + function testPercentageFormat() { $formatter = new NumberFormat(); $number = '0.125156'; $wanted = '12%'; $this->assertEquals($wanted, $formatter->format($number, 'p')); } - + function testQuotes() { $formatter = new NumberFormat(); $number = '123456789.125156'; - + $pattern = "# o'clock"; $wanted = "123456789 o'clock"; $this->assertEquals($wanted, $formatter->format($number, $pattern)); - + } - + function testPadding() { $formatter = new NumberFormat(); $number = '5'; - + $pattern = '0000'; $wanted = '0005'; - + $this->assertEquals($wanted, $formatter->format($number, $pattern)); } - + function testFormatWithANegativeValue() { $formatter = new NumberFormat(); $number = "-1.2"; - + $wanted = "-1.2"; $this->assertEquals($wanted, $formatter->format($number)); } @@ -110,33 +110,33 @@ class NumberFormatTest extends PHPUnit_Framework_TestCase { $expected = "10E"; $this->assertEquals('10E', $formatter->format($number, 'e')); } - + function testRounding() { $formatter = new NumberFormat(); - + $number = 349.999; $pattern = '#.00'; $expected = '350.00'; - + $this->assertEquals($expected, $formatter->format($number, $pattern)); } function testRounding2() { $formatter = new NumberFormat(); - + $number = 349.99; $pattern = '#.00'; $expected = '349.99'; - + $this->assertEquals($expected, $formatter->format($number, $pattern)); } function testLocalizedCurrencyFormats2() { $it = new NumberFormat('it_IT'); - + $number = 12.41; $wanted = '12,41'; $this->assertEquals($wanted, $it->format($number,'d')); @@ -149,7 +149,7 @@ class NumberFormatTest extends PHPUnit_Framework_TestCase { $wanted = '10.010,23'; $this->assertEquals($wanted, $it->format($number,'d')); - $old= setlocale(LC_ALL,"0"); + $old= setlocale(LC_ALL,"0"); setlocale(LC_ALL,"it_IT"); $number = 12.41; @@ -167,5 +167,3 @@ class NumberFormatTest extends PHPUnit_Framework_TestCase { setlocale(LC_ALL,$old); } } - -?>
\ No newline at end of file diff --git a/tests/unit/IO/AllTests.php b/tests/unit/IO/AllTests.php index 01bbd95d..c789169f 100644 --- a/tests/unit/IO/AllTests.php +++ b/tests/unit/IO/AllTests.php @@ -11,13 +11,13 @@ class IO_AllTests { public static function main() { PHPUnit_TextUI_TestRunner::run(self::suite()); } - + public static function suite() { $suite = new PHPUnit_Framework_TestSuite('System.IO'); - + $suite->addTestSuite('TTarFileExtractorTest'); $suite->addTestSuite('TTextWriterTest'); - + return $suite; } } @@ -25,4 +25,3 @@ class IO_AllTests { if(PHPUnit_MAIN_METHOD == 'IO_AllTests::main') { IO_AllTests::main(); } -?> diff --git a/tests/unit/IO/TTarFileExtractorTest.php b/tests/unit/IO/TTarFileExtractorTest.php index 66b66831..860560b1 100644 --- a/tests/unit/IO/TTarFileExtractorTest.php +++ b/tests/unit/IO/TTarFileExtractorTest.php @@ -14,10 +14,9 @@ class TTarFileExtractorTest extends PHPUnit_Framework_TestCase { public function testDestruct() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testExtract() { throw new PHPUnit_Framework_IncompleteTestError(); } -} -?>
\ No newline at end of file +}
\ No newline at end of file diff --git a/tests/unit/IO/TTextWriterTest.php b/tests/unit/IO/TTextWriterTest.php index d23fec36..087812d7 100644 --- a/tests/unit/IO/TTextWriterTest.php +++ b/tests/unit/IO/TTextWriterTest.php @@ -20,7 +20,7 @@ class TTextWriterTest extends PHPUnit_Framework_TestCase { $writer->write("more text\n"); self::assertEquals("some text\nmore text\n", $writer->flush()); } - + public function testWriteLine() { $writer = new TTextWriter(); $writer->writeLine('some text'); @@ -28,4 +28,3 @@ class TTextWriterTest extends PHPUnit_Framework_TestCase { } } -?> diff --git a/tests/unit/Security/AllTests.php b/tests/unit/Security/AllTests.php index 40316719..e71307a9 100644 --- a/tests/unit/Security/AllTests.php +++ b/tests/unit/Security/AllTests.php @@ -14,16 +14,16 @@ class Security_AllTests { public static function main() { PHPUnit_TextUI_TestRunner::run(self::suite()); } - + public static function suite() { $suite = new PHPUnit_Framework_TestSuite('System.Security'); - + $suite->addTestSuite('TAuthManagerTest'); $suite->addTestSuite('TAuthorizationRuleTest'); $suite->addTestSuite('TSecurityManagerTest'); $suite->addTestSuite('TUserManagerTest'); $suite->addTestSuite('TUserTest'); - + return $suite; } } @@ -31,4 +31,3 @@ class Security_AllTests { if(PHPUnit_MAIN_METHOD == 'Security_AllTests::main') { Security_AllTests::main(); } -?> diff --git a/tests/unit/Security/TAuthManagerTest.php b/tests/unit/Security/TAuthManagerTest.php index 03244a22..3b8b9305 100644 --- a/tests/unit/Security/TAuthManagerTest.php +++ b/tests/unit/Security/TAuthManagerTest.php @@ -8,7 +8,7 @@ Prado::using('System.Xml.TXmlDocument'); * @package System.Security */ class TAuthManagerTest extends PHPUnit_Framework_TestCase { - + public static $app = null; public static $usrMgr = null; @@ -18,7 +18,7 @@ class TAuthManagerTest extends PHPUnit_Framework_TestCase { if(self::$app === null) { self::$app = new TApplication(dirname(__FILE__).'/app'); } - + // Make a fake user manager module if (self::$usrMgr === null) { self::$usrMgr=new TUserManager (); @@ -39,26 +39,26 @@ class TAuthManagerTest extends PHPUnit_Framework_TestCase { $authManager->init(null); self::fail ('Expected TConfigurationException not thrown'); } catch (TConfigurationException $e) {} - + $authManager->setUserManager('users'); $authManager->init (null); self::assertEquals(self::$usrMgr, $authManager->getUserManager()); } - + public function testUserManager() { $authManager=new TAuthManager (); $authManager->setUserManager('users'); $authManager->init(null); self::assertEquals(self::$usrMgr, $authManager->getUserManager()); - + // test change try { $authManager->setUserManager('invalid'); self::fail ('Expected TInvalidOperationException not thrown'); } catch (TInvalidOperationException $e) {} - + } - + public function testLoginPage() { $authManager=new TAuthManager (); $authManager->setUserManager('users'); @@ -66,7 +66,7 @@ class TAuthManagerTest extends PHPUnit_Framework_TestCase { $authManager->setLoginPage ('LoginPage'); self::assertEquals('LoginPage', $authManager->getLoginPage()); } - + public function testDoAuthentication() { throw new PHPUnit_Framework_IncompleteTestError(); // Not yet finished, Session won't start because of headers :( :( @@ -76,41 +76,40 @@ class TAuthManagerTest extends PHPUnit_Framework_TestCase { $authManager->init(null); $authManager->setLoginPage ('LoginPage'); self::$app->raiseEvent ('onAuthentication', self::$app, null); - + } - + public function testDoAuthorization() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testLeave() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testReturnUrl() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testOnAuthenticate() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testOnAuthorize() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testUpdateSessionUser() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testLogin() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testLogout() { throw new PHPUnit_Framework_IncompleteTestError(); } } -?> diff --git a/tests/unit/Security/TAuthorizationRuleTest.php b/tests/unit/Security/TAuthorizationRuleTest.php index 5d5f2d97..5bfa6c2c 100644 --- a/tests/unit/Security/TAuthorizationRuleTest.php +++ b/tests/unit/Security/TAuthorizationRuleTest.php @@ -16,35 +16,34 @@ class TAuthorizationRuleTest extends PHPUnit_Framework_TestCase { public function testConstruct() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testAction() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testUsers() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testRoles() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testVerb() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testGuestApplied() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testEveryoneApplied() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testIsUserAllowed() { throw new PHPUnit_Framework_IncompleteTestError(); } } -?> diff --git a/tests/unit/Security/TSecurityManagerTest.php b/tests/unit/Security/TSecurityManagerTest.php index 09c261cf..9c319a5a 100644 --- a/tests/unit/Security/TSecurityManagerTest.php +++ b/tests/unit/Security/TSecurityManagerTest.php @@ -22,39 +22,39 @@ class TSecurityManagerTest extends PHPUnit_Framework_TestCase { $sec->init(null); self::assertEquals ($sec, self::$app->getSecurityManager()); } - + public function testValidationKey() { $sec=new TSecurityManager (); $sec->init (null); // Random validation key $valkey=$sec->getValidationKey (); self::assertEquals($valkey, self::$app->getGlobalState(TSecurityManager::STATE_VALIDATION_KEY)); - + $sec->setValidationKey ('aKey'); self::assertEquals('aKey',$sec->getValidationKey()); - + try { $sec->setValidationKey (''); self::fail ('Expected TInvalidDataValueException not thrown'); } catch (TInvalidDataValueException $e) {} } - + public function testEncryptionKey() { $sec=new TSecurityManager (); $sec->init (null); // Random encryption key $valkey=$sec->getEncryptionKey (); self::assertEquals($valkey, self::$app->getGlobalState(TSecurityManager::STATE_ENCRYPTION_KEY)); - + $sec->setEncryptionKey ('aKey'); self::assertEquals('aKey',$sec->getEncryptionKey()); - + try { $sec->setEncryptionKey (''); self::fail ('Expected TInvalidDataValueException not thrown'); } catch (TInvalidDataValueException $e) {} } - + public function testValidation() { $sec=new TSecurityManager (); $sec->init (null); @@ -67,7 +67,7 @@ class TSecurityManagerTest extends PHPUnit_Framework_TestCase { self::fail ('Expected TInvalidDataValueException not thrown'); } catch (TInvalidDataValueException $e) {} } - + public function testEncryption() { $sec=new TSecurityManager (); $sec->init (null); @@ -79,7 +79,7 @@ class TSecurityManagerTest extends PHPUnit_Framework_TestCase { self::assertEquals('NotExisting', $sec->getCryptAlgorithm()); } } - + public function testEncryptDecrypt() { $sec=new TSecurityManager (); $sec->init (null); @@ -101,13 +101,13 @@ class TSecurityManagerTest extends PHPUnit_Framework_TestCase { self::assertEquals($plainText,$decrypted); - // try change key + // try change key $sec->setEncryptionKey ('anotherKey'); self::assertNotEquals($plainText, $sec->decrypt($encrypted)); } } - - + + public function testHashData() { $sec=new TSecurityManager (); $sec->init (null); @@ -118,7 +118,7 @@ class TSecurityManagerTest extends PHPUnit_Framework_TestCase { self::assertEquals (54, strlen($hashed)); // The initial text should be after the initial hash self::assertEquals ('A text to hash', substr($hashed,40)); - + // Same tests with MD5 $sec->setValidationKey('AnotherKey'); $sec->setValidation('MD5'); @@ -128,7 +128,7 @@ class TSecurityManagerTest extends PHPUnit_Framework_TestCase { // The initial text should be after the initial hash self::assertEquals ('A text to hash', substr($hashed,32)); } - + public function testValidateData() { $sec=new TSecurityManager (); $sec->init (null); @@ -142,8 +142,7 @@ class TSecurityManagerTest extends PHPUnit_Framework_TestCase { // and a test without tampered data self::assertFalse($sec->validateData('bad')); } - + } -?> diff --git a/tests/unit/Security/TUserManagerTest.php b/tests/unit/Security/TUserManagerTest.php index edb7ea6f..91b9d0c6 100644 --- a/tests/unit/Security/TUserManagerTest.php +++ b/tests/unit/Security/TUserManagerTest.php @@ -6,18 +6,18 @@ Prado::using('System.Security.TUserManager'); * @package System.Security */ class TUserManagerTest extends PHPUnit_Framework_TestCase { - + public static $app=null; public static $config=null; - + public function setUp() { - + if(self::$app === null) { self::$app = new TApplication(dirname(__FILE__).'/app'); prado::setPathofAlias('App', dirname(__FILE__)); } - + if (self::$config === null) { // Simulate a config file self::$config=new TXmlDocument('1.0','utf8'); @@ -41,21 +41,21 @@ class TUserManagerTest extends PHPUnit_Framework_TestCase { $userManager->init (new TXmlDocument()); // Empty config self::assertEquals(array('joe'=>'demo','john'=>'demo', 'test' => 'test'), $userManager->getUsers()); unlink (dirname(__FILE__).'/users.xml'); - } + } } - + public function testUsers() { $userManager=new TUserManager (); $userManager->init (self::$config); self::assertEquals(array('joe'=>'demo','john'=>'demo', 'test' => 'test'), $userManager->getUsers()); } - + public function testRoles() { $userManager=new TUserManager (); $userManager->init (self::$config); self::assertEquals(array('joe'=>array ('Writer'), 'john'=>array ('Administrator','Writer'), 'test' => array ('Reader', 'User')), $userManager->getRoles()); } - + public function testUserFile() { $userManager=new TUserManager (); try { @@ -71,7 +71,7 @@ class TUserManagerTest extends PHPUnit_Framework_TestCase { self::assertEquals(dirname(__FILE__).'/users.xml', $userManager->getUserFile()); unlink (dirname(__FILE__).'/users.xml'); $userManager=null; - } + } $userManager=new TUserManager (); $userManager->init (self::$config); try { @@ -79,14 +79,14 @@ class TUserManagerTest extends PHPUnit_Framework_TestCase { self::fail ('Exception TInvalidOperationException not thrown'); } catch (TInvalidOperationException $e) {} } - + public function testGuestName() { $userManager=new TUserManager (); self::assertEquals('Guest', $userManager->getGuestName()); $userManager->setGuestName('Invite'); self::assertEquals('Invite', $userManager->getGuestName()); } - + public function testPasswordMode() { $userManager=new TUserManager (); $userManager->setPasswordMode('Clear'); @@ -99,9 +99,9 @@ class TUserManagerTest extends PHPUnit_Framework_TestCase { $userManager->setPasswordMode('Invalid'); self::fail ('Exception TInvalidDataValueException not thrown'); } catch (TInvalidDataValueException $e) {} - + } - + public function testValidateUser() { $userManager=new TUserManager (); $userManager->init (self::$config); @@ -109,7 +109,7 @@ class TUserManagerTest extends PHPUnit_Framework_TestCase { self::assertTrue($userManager->validateUser('Joe', 'demo')); self::assertFalse($userManager->validateUser('John', 'bad')); } - + public function testUser() { $userManager=new TUserManager (); $userManager->init (self::$config); @@ -123,7 +123,7 @@ class TUserManagerTest extends PHPUnit_Framework_TestCase { self::assertFalse($user->getIsGuest()); self::assertNull($userManager->getUser('badUser')); } - + public function testSwitchToGuest() { $userManager=new TUserManager (); $userManager->init (self::$config); @@ -134,4 +134,3 @@ class TUserManagerTest extends PHPUnit_Framework_TestCase { } -?> diff --git a/tests/unit/Security/TUserTest.php b/tests/unit/Security/TUserTest.php index 6fa337e0..3692b97c 100644 --- a/tests/unit/Security/TUserTest.php +++ b/tests/unit/Security/TUserTest.php @@ -32,18 +32,18 @@ class TUserTest extends PHPUnit_Framework_TestCase { self::assertEquals('Guest', $user->getName()); self::assertEquals(self::$mgr, $user->getManager()); } - + public function testManager() { $user = new TUser (self::$mgr); self::assertEquals(self::$mgr, $user->getManager()); } - + public function testName() { $user = new TUser (self::$mgr); $user->setName('joe'); self::assertEquals('joe', $user->getName()); } - + public function testIsGuest() { $user = new TUser (self::$mgr); $user->setName('John'); @@ -54,7 +54,7 @@ class TUserTest extends PHPUnit_Framework_TestCase { self::assertTrue($user->getIsGuest()); self::assertEquals(array(),$user->getRoles()); } - + public function testRoles() { $user=new TUser(self::$mgr); $user->setRoles(array('Administrator','Writer')); @@ -62,7 +62,7 @@ class TUserTest extends PHPUnit_Framework_TestCase { $user->setRoles('Reader,User'); self::assertEquals(array('Reader','User'), $user->getRoles()); } - + public function testIsInRole() { $user=new TUser(self::$mgr); $user->setRoles(array('Administrator','Writer')); @@ -71,7 +71,7 @@ class TUserTest extends PHPUnit_Framework_TestCase { self::assertTrue($user->IsInRole('Writer')); self::assertFalse($user->isInRole('Reader')); } - + public function testSaveToString() { $user = new TUser (self::$mgr); $user->setName('John'); @@ -81,20 +81,20 @@ class TUserTest extends PHPUnit_Framework_TestCase { $assumedState=array ('Name' => 'John', 'IsGuest' => false, 'Roles' => array ('Administrator', 'Writer')); self::assertEquals(serialize($assumedState), $user->saveToString()); } - + public function testLoadFromString() { $user = new TUser (self::$mgr); $user->setName('John'); $user->setIsGuest(false); $user->setRoles('Administrator, Writer'); $save=$user->saveToString(); - + $user2 = new TUser (self::$mgr); $user2->loadFromString($save); - + self::assertEquals($user, $user2); } - + /* getState & setState are protected methods, will be tested with other tests. public function testState() { throw new PHPUnit_Framework_IncompleteTestError(); @@ -111,4 +111,3 @@ class TUserTest extends PHPUnit_Framework_TestCase { } -?> diff --git a/tests/unit/TComponentTest.php b/tests/unit/TComponentTest.php index 93668dc0..9a2299da 100644 --- a/tests/unit/TComponentTest.php +++ b/tests/unit/TComponentTest.php @@ -13,24 +13,24 @@ class NewComponent extends TComponent { public function getAutoGlobalListen() { return true; - } + } public function getText() { return $this->_text; } - + public function setText($value) { $this->_text=$value; } - + public function getReadOnlyProperty() { return 'read only'; } - + public function getJsReadOnlyJsProperty() { return 'js read only'; } - + public function getObject() { if(!$this->_object) { $this->_object=new NewComponent; @@ -38,19 +38,19 @@ class NewComponent extends TComponent { } return $this->_object; } - + public function onMyEvent($param) { $this->raiseEvent('OnMyEvent',$this,$param); } - + public function myEventHandler($sender,$param) { $this->_eventHandled=true; } - + public function eventReturnValue($sender,$param) { return $param->Return; } - + public function isEventHandled() { return $this->_eventHandled; } @@ -82,14 +82,14 @@ class NewComponentNoListen extends NewComponent { class DynamicCatchingComponent extends NewComponentNoListen implements IDynamicMethods { public function __dycall($method, $args) { - + } } class GlobalRaiseComponent extends NewComponent implements IDynamicMethods { private $_callorder = array(); - + public function getCallOrders() { return $this->_callorder; @@ -128,7 +128,7 @@ class FooClassBehavior extends TClassBehavior { class FooFooClassBehavior extends FooClassBehavior { public function faafaaEverMore($object, $laa, $sol) { - + } } @@ -146,7 +146,7 @@ class FooBehavior extends TBehavior { } } class FooFooBehavior extends FooBehavior { - + public function faafaaEverMore($laa, $sol) { return sqrt($laa * $laa + $sol * $sol); } @@ -162,11 +162,11 @@ class PreBarBehavior extends TBehavior { class BarBehavior extends PreBarBehavior implements IInstanceCheck { private $_instanceReturn = null; - + public function moreFunction($laa, $sol) { return pow($laa+$sol+1, 2); } - + public function isinstanceof($class, $instance=null) { return $this->_instanceReturn; } @@ -200,7 +200,7 @@ class BehaviorTestBehavior extends TBehavior { public function getReadOnly() { return true; } - + public function onBehaviorEvent($sender, $param,$responsetype=null,$postfunction=null) { return $this->getOwner()->raiseEvent('onBehaviorEvent',$sender,$param,$responsetype,$postfunction); } @@ -264,40 +264,40 @@ class dy3ClassTextReplace extends dy1ClassTextReplace { class IntraObjectExtenderBehavior extends TBehavior { - + private $lastCall = null; private $arglist = null; - + public function getLastCall() { $v = $this->lastCall; $this->lastCall = null; return $v; } - + public function getLastArgumentList() { $v = $this->arglist; $this->arglist = null; return $v; } - - - + + + public function dyListen($fx, $chain) { $this->lastCall = 1; $this->arglist = func_get_args(); - + return $chain->dyListen($fx); // Calls the next event, within a chain } public function dyUnlisten($fx, $chain) { $this->lastCall = 2; $this->arglist = func_get_args(); - + return $chain->dyUnlisten($fx); } public function dyPreRaiseEvent($name,$sender,$param,$responsetype,$postfunction, $chain) { $this->lastCall = 3; $this->arglist = func_get_args(); - + return $chain->dyPreRaiseEvent($name);// Calls the next event, within a chain, if parameters are left off, they are filled in with // the original parameters passed to the dynamic event. Parameters can be passed if they are changed. } @@ -409,7 +409,7 @@ class TDynamicClassBehavior extends TClassBehavior implements IDynamicMethods { * @package System */ class TComponentTest extends PHPUnit_Framework_TestCase { - + protected $component; public function setUp() { @@ -424,21 +424,21 @@ class TComponentTest extends PHPUnit_Framework_TestCase { $this->component->unlisten(); $this->component = null; } - - + + public function testGetListeningToGlobalEvents() { $this->assertEquals(true, $this->component->getListeningToGlobalEvents()); $this->component->unlisten(); $this->assertEquals(false, $this->component->getListeningToGlobalEvents()); } - - + + public function testConstructorAutoListen() { // the default object auto installs class behavior hooks $this->assertEquals(1, $this->component->getEventHandlers('fxAttachClassBehavior')->getCount()); $this->assertEquals(1, $this->component->getEventHandlers('fxDetachClassBehavior')->getCount()); $this->assertTrue($this->component->getListeningToGlobalEvents()); - + // this object does not auto install class behavior hooks, thus not changing the global event structure. // Creating a new instance should _not_ influence the fxAttachClassBehavior and fxDetachClassBehavior // count. @@ -447,655 +447,655 @@ class TComponentTest extends PHPUnit_Framework_TestCase { $this->assertEquals(1, $this->component->getEventHandlers('fxDetachClassBehavior')->getCount()); $this->assertEquals(1, $component_nolisten->getEventHandlers('fxAttachClassBehavior')->getCount()); $this->assertEquals(1, $component_nolisten->getEventHandlers('fxDetachClassBehavior')->getCount()); - - // tests order of class behaviors when a parent and class have class behavior. + + // tests order of class behaviors when a parent and class have class behavior. // The child should override the parent object-oriented programming style $this->component->attachClassBehavior('Bar', 'BarBehavior', 'NewComponentNoListen'); $this->component->attachClassBehavior('FooBar', 'FooBarBehavior', 'NewComponent'); - + //create new object with new class behaviors built in, defined in the two lines above $component = new NewComponentNoListen; - + $this->assertEquals(25, $component->moreFunction(2, 2)); - + $this->assertEquals(25, $component->Bar->moreFunction(2, 2)); $this->assertEquals(8, $component->FooBar->moreFunction(2, 2)); - + $component->unlisten();// unwind object and class behaviors $this->component->detachClassBehavior('FooBar', 'NewComponent'); $this->component->detachClassBehavior('Bar', 'NewComponentNoListen'); - + } - - + + public function testListenAndUnlisten() { - + $component = new NewComponentNoListen(); - + $this->assertEquals(false, $component->getListeningToGlobalEvents()); - + //This is from $this->component being instanced and listening. $component is accessing the global event structure $this->assertEquals(1, $component->getEventHandlers('fxAttachClassBehavior')->getCount()); - + $this->assertEquals(2, $component->listen()); - + $this->assertEquals(true, $component->getListeningToGlobalEvents()); - + //This is from $this->component being instanced and listening. $component is accessing the global event structure $this->assertEquals(2, $component->getEventHandlers('fxAttachClassBehavior')->getCount()); - + $this->assertEquals(2, $component->unlisten()); - + $this->assertEquals(false, $component->getListeningToGlobalEvents()); - + //This is from $this->component being instanced and listening. $component is accessing the global event structure $this->assertEquals(1, $component->getEventHandlers('fxAttachClassBehavior')->getCount()); } - - + + public function testListenAndUnlistenWithDynamicEventCatching() { - + $component = new DynamicCatchingComponent(); - + $this->assertEquals(false, $component->getListeningToGlobalEvents()); - + //This is from $this->component being instanced and listening. $component is accessing the global event structure $this->assertEquals(0, $component->getEventHandlers(TComponent::GLOBAL_RAISE_EVENT_LISTENER)->getCount()); - + // this adds the fxAttachClassBehavior, fxDetachClassBehavior, and __dycall of the component $this->assertEquals(3, $component->listen()); - + $this->assertEquals(true, $component->getListeningToGlobalEvents()); - + //This is from $this->component being instanced and listening. $component is accessing the global event structure $this->assertEquals(1, $component->getEventHandlers(TComponent::GLOBAL_RAISE_EVENT_LISTENER)->getCount()); - + $this->assertEquals(3, $component->unlisten()); - + $this->assertEquals(false, $component->getListeningToGlobalEvents()); - + //This is from $this->component being instanced and listening. $component is accessing the global event structure $this->assertEquals(0, $component->getEventHandlers(TComponent::GLOBAL_RAISE_EVENT_LISTENER)->getCount()); } - - - + + + //Test Class behaviors public function testAttachClassBehavior() { - + // ensure that the class is listening $this->assertEquals(1, $this->component->getEventHandlers('fxAttachClassBehavior')->getCount()); - + //Test that the component is not a FooClassBehavior $this->assertNull($this->component->asa('FooClassBehavior'), "Component is already a FooClassBehavior and should not have this behavior"); - + //Add the FooClassBehavior $this->component->attachClassBehavior('FooClassBehavior', new FooClassBehavior); - + //Test that the existing listening component can be a FooClassBehavior $this->assertNotNull($this->component->asa('FooClassBehavior'), "Component is does not have the FooClassBehavior and should have this behavior"); - + // test if the function modifies new instances of the object $anothercomponent = new NewComponent(); - + //The new component should be a FooClassBehavior $this->assertNotNull($anothercomponent->asa('FooClassBehavior'), "anothercomponent does not have the FooClassBehavior"); - + // test when overwriting an existing class behavior, it should throw an TInvalidOperationException try { $this->component->attachClassBehavior('FooClassBehavior', new BarClassBehavior); $this->fail('TInvalidOperationException not raised when overwriting an existing behavior'); } catch(TInvalidOperationException $e) { } - - + + // test when overwriting an existing class behavior, it should throw an TInvalidOperationException try { $this->component->attachClassBehavior('FooBarBehavior', 'FooBarBehavior', 'TComponent'); $this->fail('TInvalidOperationException not raised when trying to place a behavior on the root object TComponent'); } catch(TInvalidOperationException $e) { } - - + + // test if the function does not modify any existing objects that are not listening // The FooClassBehavior is already a part of the class behaviors thus the new instance gets the behavior. $nolistencomponent = new NewComponentNoListen(); - + // test if the function modifies all existing objects that are listening // Adding a behavior to the first object, the second instance should automatically get the class behavior. // This is because the second object is listening to the global events of class behaviors $this->component->attachClassBehavior('BarClassBehavior', new BarClassBehavior); $this->assertNotNull($anothercomponent->asa('BarClassBehavior'), "anothercomponent is does not have the BarClassBehavior"); - + // The no listen object should not have the BarClassBehavior because it was added as a class behavior after the object was instanced $this->assertNull($nolistencomponent->asa('BarClassBehavior'), "nolistencomponent has the BarClassBehavior and should not"); - + // But the no listen object should have the FooClassBehavior because the class behavior was installed before the object was instanced $this->assertNotNull($nolistencomponent->asa('FooClassBehavior'), "nolistencomponent is does not have the FooClassBehavior"); - + //Clear out what was done during this test $anothercomponent->unlisten(); $this->component->detachClassBehavior('FooClassBehavior'); $this->component->detachClassBehavior('BarClassBehavior'); - + // Test attaching of single object behaviors as class-wide behaviors $this->component->attachClassBehavior('BarBehaviorObject', 'BarBehavior'); $this->assertTrue($this->component->asa('BarBehaviorObject') instanceof BarBehavior); $this->assertEquals($this->component->BarBehaviorObject->Owner, $this->component); $this->component->detachClassBehavior('BarBehaviorObject'); } - - - - - + + + + + public function testDetachClassBehavior() { // ensure that the component is listening $this->assertEquals(1, $this->component->getEventHandlers('fxDetachClassBehavior')->getCount()); - + $prenolistencomponent = new NewComponentNoListen(); - + //Attach a class behavior $this->component->attachClassBehavior('FooClassBehavior', new FooClassBehavior); - + //Create new components that listen and don't listen to global events $anothercomponent = new NewComponent(); $postnolistencomponent = new NewComponentNoListen(); - + //ensures that all the Components are properly initialized $this->assertEquals(2, $this->component->getEventHandlers('fxDetachClassBehavior')->getCount()); $this->assertNotNull($this->component->asa('FooClassBehavior'), "Component does not have the FooClassBehavior and should have this behavior"); $this->assertNull($prenolistencomponent->asa('FooClassBehavior'), "Component has the FooClassBehavior and should _not_ have this behavior"); $this->assertNotNull($anothercomponent->asa('FooClassBehavior'), "Component does not have the FooClassBehavior and should have this behavior"); $this->assertNotNull($postnolistencomponent->asa('FooClassBehavior'), "Component does not have the FooClassBehavior and should have this behavior"); - - + + $this->component->detachClassBehavior('FooClassBehavior'); - + $this->assertNull($this->component->asa('FooClassBehavior'), "Component has the FooClassBehavior and should _not_ have this behavior"); $this->assertNull($prenolistencomponent->asa('FooClassBehavior'), "Component has the FooClassBehavior and should _not_ have this behavior"); $this->assertNull($anothercomponent->asa('FooClassBehavior'), "Component has the FooClassBehavior and should _not_ have this behavior"); $this->assertNotNull($postnolistencomponent->asa('FooClassBehavior'), "Component does not have the FooClassBehavior and should have this behavior"); - - + + //tear down function variables $anothercomponent->unlisten(); } - + public function testGetClassHierarchy() { $component = new DynamicCatchingComponent; $this->assertEquals(array('TComponent', 'NewComponent', 'NewComponentNoListen', 'DynamicCatchingComponent'), $component->getClassHierarchy()); $this->assertEquals(array('TComponent', 'NewComponent', 'NewComponentNoListen', 'DynamicCatchingComponent'), $component->getClassHierarchy(false)); $this->assertEquals(array('tcomponent', 'newcomponent', 'newcomponentnolisten', 'dynamiccatchingcomponent'), $component->getClassHierarchy(true)); } - - + + public function testAsA() { $anothercomponent = new NewComponent(); - + // ensure the component does not have the FooClassBehavior $this->assertNull($this->component->asa('FooClassBehavior')); $this->assertNull($this->component->asa('FooFooClassBehavior')); $this->assertNull($this->component->asa('BarClassBehavior')); $this->assertNull($this->component->asa('NonExistantClassBehavior')); - + $this->assertNull($anothercomponent->asa('FooClassBehavior')); $this->assertNull($anothercomponent->asa('FooFooClassBehavior')); $this->assertNull($anothercomponent->asa('BarClassBehavior')); $this->assertNull($anothercomponent->asa('NonExistantClassBehavior')); - + // add the class behavior $this->component->attachClassBehavior('FooClassBehavior', new FooClassBehavior); - + //Check that the component has only the class behavior assigned $this->assertNotNull($this->component->asa('FooClassBehavior')); $this->assertNull($this->component->asa('FooFooClassBehavior')); $this->assertNull($this->component->asa('BarClassBehavior')); $this->assertNull($this->component->asa('NonExistantClassBehavior')); - + //Check that the component has only the class behavior assigned $this->assertNotNull($anothercomponent->asa('FooClassBehavior')); $this->assertNull($anothercomponent->asa('FooFooClassBehavior')); $this->assertNull($anothercomponent->asa('BarClassBehavior')); $this->assertNull($anothercomponent->asa('NonExistantClassBehavior')); - + // remove the class behavior $this->component->detachClassBehavior('FooClassBehavior'); - + // Check the function doesn't have the behavior any more $this->assertNull($this->component->asa('FooClassBehavior')); $this->assertNull($this->component->asa('FooFooClassBehavior')); $this->assertNull($this->component->asa('BarClassBehavior')); $this->assertNull($this->component->asa('NonExistantClassBehavior')); - + $this->assertNull($anothercomponent->asa('FooClassBehavior')); $this->assertNull($anothercomponent->asa('FooFooClassBehavior')); $this->assertNull($anothercomponent->asa('BarClassBehavior')); $this->assertNull($anothercomponent->asa('NonExistantClassBehavior')); - - - - + + + + $this->component->attachBehavior('BarBehavior', new BarBehavior); - + //Check that the component has only the object behavior assigned $this->assertNull($this->component->asa('FooBehavior')); $this->assertNull($this->component->asa('FooFooBehavior')); $this->assertNotNull($this->component->asa('BarBehavior')); $this->assertNull($this->component->asa('NonExistantBehavior')); - + //Check that the component has the behavior assigned $this->assertNull($anothercomponent->asa('FooBehavior')); $this->assertNull($anothercomponent->asa('FooFooBehavior')); $this->assertNull($anothercomponent->asa('BarBehavior')); $this->assertNull($anothercomponent->asa('NonExistantBehavior')); - + $this->component->detachBehavior('BarBehavior'); - + //Check that the component has no object behaviors assigned $this->assertNull($this->component->asa('FooBehavior')); $this->assertNull($this->component->asa('FooFooBehavior')); $this->assertNull($this->component->asa('BarBehavior')); $this->assertNull($this->component->asa('NonExistantBehavior')); - + //Check that the component has no behavior assigned $this->assertNull($anothercomponent->asa('FooBehavior')); $this->assertNull($anothercomponent->asa('FooFooBehavior')); $this->assertNull($anothercomponent->asa('BarBehavior')); $this->assertNull($anothercomponent->asa('NonExistantBehavior')); - + $anothercomponent->unlisten(); } - + public function testIsA() { //This doesn't check the IInstanceCheck functionality, separate function - + $this->assertTrue($this->component->isa('TComponent')); $this->assertTrue($this->component->isa('NewComponent')); $this->assertFalse($this->component->isa(new FooBehavior)); $this->assertFalse($this->component->isa('FooBehavior')); - + //Ensure there is no BarBehavior $this->assertNull($this->component->asa('FooFooBehavior')); - + $this->assertFalse($this->component->isa('FooBehavior')); $this->assertFalse($this->component->isa('FooFooBehavior')); - + $this->component->attachBehavior('FooFooBehavior', new FooFooBehavior); - + $this->assertNotNull($this->component->asa('FooFooBehavior')); - + $this->assertTrue($this->component->isa('FooBehavior')); $this->assertTrue($this->component->isa('FooFooBehavior')); - + $this->component->disableBehaviors(); // It still has the behavior $this->assertNotNull($this->component->asa('FooFooBehavior')); - + // But it is not expressed $this->assertFalse($this->component->isa('FooBehavior')); $this->assertFalse($this->component->isa('FooFooBehavior')); - + $this->component->enableBehaviors(); $this->assertNotNull($this->component->asa('FooFooBehavior')); - + $this->assertTrue($this->component->isa('FooFooBehavior')); - - - + + + $this->component->attachBehavior('FooBarBehavior', new FooBarBehavior); - + $this->assertTrue($this->component->isa('FooBehavior')); $this->assertTrue($this->component->isa('FooBarBehavior')); - + $this->component->disableBehavior('FooBarBehavior'); - + $this->assertTrue($this->component->isa('FooBehavior')); $this->assertFalse($this->component->isa('FooBarBehavior')); - + $this->component->enableBehavior('FooBarBehavior'); $this->component->disableBehavior('FooFooBehavior'); $this->assertFalse($this->component->isa('FooBehavior')); $this->assertFalse($this->component->isa('FooFooBehavior')); $this->assertTrue($this->component->isa('FooBarBehavior')); - + $this->component->disableBehavior('FooBarBehavior'); $this->component->disableBehavior('FooFooBehavior'); - + $this->assertFalse($this->component->isa('FooBehavior')); $this->assertFalse($this->component->isa('FooFooBehavior')); $this->assertFalse($this->component->isa('FooBarBehavior')); - + $this->component->enableBehavior('FooBarBehavior'); $this->component->enableBehavior('FooFooBehavior'); - + $this->assertTrue($this->component->isa('FooFooBehavior')); $this->assertTrue($this->component->isa('FooBarBehavior')); - - + + $this->component->detachBehavior('FooFooBehavior'); $this->component->detachBehavior('FooBarBehavior'); - + $this->assertFalse($this->component->isa(new FooBehavior)); $this->assertFalse($this->component->isa('FooBehavior')); $this->assertFalse($this->component->isa(new FooFooBehavior)); $this->assertFalse($this->component->isa('FooFooBehavior')); $this->assertFalse($this->component->isa(new FooBarBehavior)); $this->assertFalse($this->component->isa('FooBarBehavior')); - + } - + public function testIsA_with_IInstanceCheck() { - + $this->assertTrue($this->component->isa('NewComponent')); $this->assertFalse($this->component->isa('PreBarBehavior')); - + $this->component->attachBehavior('BarBehavior', $behavior = new BarBehavior); - + $behavior->setInstanceReturn(null); - + $this->assertTrue($this->component->isa('NewComponent')); $this->assertTrue($this->component->isa('PreBarBehavior')); $this->assertFalse($this->component->isa('FooBehavior')); - + // This forces the iso on the BarBehavior to respond to any class with false $behavior->setInstanceReturn(false); $this->assertFalse($this->component->isa('PreBarBehavior')); $this->assertFalse($this->component->isa('FooBehavior')); - + //This forces the isa on the BarBehavior to respond to any class with true $behavior->setInstanceReturn(true); $this->assertTrue($this->component->isa('FooBehavior')); - - + + } - + public function testAttachDetachBehavior() { - + try { $this->component->faaEverMore(true, true); $this->fail('TApplicationException not raised trying to execute a undefined class method'); } catch(TApplicationException $e) {} - + $this->assertNull($this->component->asa('FooBehavior')); $this->assertFalse($this->component->isa('FooBehavior')); $this->assertNull($this->component->asa('BarBehavior')); $this->assertFalse($this->component->isa('BarBehavior')); - + try { $this->component->attachBehavior('FooBehavior', new TComponent); $this->fail('TApplicationException not raised trying to execute a undefined class method'); } catch(TInvalidDataTypeException $e) {} - + $this->component->attachBehavior('FooBehavior', new FooBehavior); - + $this->assertNotNull($this->component->asa('FooBehavior')); $this->assertTrue($this->component->isa('FooBehavior')); $this->assertNull($this->component->asa('BarBehavior')); $this->assertFalse($this->component->isa('BarBehavior')); - + try { $this->assertTrue($this->component->faaEverMore(true, true)); } catch(TApplicationException $e) { $this->fail('TApplicationException raised while trying to execute a behavior class method'); } - + try { $this->component->noMethodHere(true); $this->fail('TApplicationException not raised trying to execute a undefined class method'); } catch(TApplicationException $e) {} - + $this->assertTrue($this->component->disableBehavior('FooBehavior')); - + //BarBehavior is not a behavior at this time $this->assertNull($this->component->disableBehavior('BarBehavior')); - + try { $this->component->faaEverMore(true, true); $this->fail('TApplicationException not raised trying to execute a undefined class method'); } catch(TApplicationException $e) {} - + $this->assertTrue($this->component->enableBehavior('FooBehavior')); - + //BarBehavior is not a behavior at this time $this->assertNull($this->component->enableBehavior('BarBehavior')); - + try { $this->assertTrue($this->component->faaEverMore(true, true)); } catch(TApplicationException $e) { $this->fail('TApplicationException raised while trying to execute a behavior class method'); } - + $this->component->detachBehavior('FooBehavior'); - + $this->assertNull($this->component->asa('FooBehavior')); $this->assertFalse($this->component->isa('FooBehavior')); $this->assertNull($this->component->asa('BarBehavior')); $this->assertFalse($this->component->isa('BarBehavior')); - + } - + public function testAttachDetachBehaviors() { $this->assertNull($this->component->asa('FooBehavior')); $this->assertNull($this->component->asa('BarBehavior')); $this->assertNull($this->component->asa('FooBarBehavior')); $this->assertNull($this->component->asa('PreBarBehavior')); - + $this->component->attachBehaviors(array('FooFooBehavior' => new FooFooBehavior, 'BarBehavior' => new BarBehavior, 'PreBarBehavior' => new PreBarBehavior)); - + $this->assertNull($this->component->asa('FooBehavior')); $this->assertNotNull($this->component->asa('FooFooBehavior')); $this->assertNotNull($this->component->asa('BarBehavior')); $this->assertNull($this->component->asa('FooBarBehavior')); $this->assertNotNull($this->component->asa('PreBarBehavior')); - + $this->assertTrue($this->component->isa('FooFooBehavior')); $this->assertTrue($this->component->isa('FooBehavior')); $this->assertTrue($this->component->isa('BarBehavior')); $this->assertTrue($this->component->isa('PreBarBehavior')); $this->assertFalse($this->component->isa('FooBarBehavior')); - + $this->component->detachBehaviors(array('FooFooBehavior' => new FooFooBehavior, 'BarBehavior' => new BarBehavior)); - + $this->assertNull($this->component->asa('FooBehavior')); $this->assertNull($this->component->asa('FooFooBehavior')); $this->assertNull($this->component->asa('BarBehavior')); $this->assertNull($this->component->asa('FooBarBehavior')); $this->assertNotNull($this->component->asa('PreBarBehavior')); - + $this->assertFalse($this->component->isa('FooFooBehavior')); $this->assertFalse($this->component->isa('FooBehavior')); $this->assertFalse($this->component->isa('BarBehavior')); $this->assertFalse($this->component->isa('FooBarBehavior')); $this->assertTrue($this->component->isa('PreBarBehavior')); - - - + + + // testing if we can detachBehaviors just by the name of the behavior instead of an array of the behavior $this->component->attachBehaviors(array('FooFooBehavior' => new FooFooBehavior, 'BarBehavior' => new BarBehavior)); - + $this->assertTrue($this->component->isa('FooBehavior')); $this->assertTrue($this->component->isa('BarBehavior')); - + $this->component->detachBehaviors(array('FooFooBehavior', 'BarBehavior')); - + $this->assertNull($this->component->asa('FooBehavior')); $this->assertNull($this->component->asa('FooFooBehavior')); $this->assertNull($this->component->asa('BarBehavior')); $this->assertNull($this->component->asa('FooBarBehavior')); - + $this->assertFalse($this->component->isa('FooFooBehavior')); $this->assertFalse($this->component->isa('FooBehavior')); $this->assertFalse($this->component->isa('BarBehavior')); $this->assertFalse($this->component->isa('FooBarBehavior')); } - - + + public function testClearBehaviors() { - + $this->assertNull($this->component->asa('FooBehavior')); $this->assertNull($this->component->asa('BarBehavior')); $this->assertNull($this->component->asa('FooBarBehavior')); $this->assertNull($this->component->asa('PreBarBehavior')); - + $this->component->attachBehaviors(array('FooFooBehavior' => new FooFooBehavior, 'BarBehavior' => new BarBehavior, 'PreBarBehavior' => new PreBarBehavior)); - + $this->assertNull($this->component->asa('FooBehavior')); $this->assertNotNull($this->component->asa('FooFooBehavior')); $this->assertNotNull($this->component->asa('BarBehavior')); $this->assertNull($this->component->asa('FooBarBehavior')); $this->assertNotNull($this->component->asa('PreBarBehavior')); - + $this->component->clearBehaviors(); - + $this->assertNull($this->component->asa('FooBehavior')); $this->assertNull($this->component->asa('BarBehavior')); $this->assertNull($this->component->asa('FooBarBehavior')); $this->assertNull($this->component->asa('PreBarBehavior')); } - + public function testEnableDisableBehavior() { - + $this->assertNull($this->component->enableBehavior('FooBehavior')); $this->assertNull($this->component->disableBehavior('FooBehavior')); - + try { $this->component->faaEverMore(true, true); $this->fail('TApplicationException not raised trying to execute a undefined class method'); } catch(TApplicationException $e) {} - + $this->component->attachBehavior('FooBehavior', new FooBehavior); - + $this->assertTrue($this->component->isa('FooBehavior')); try { $this->assertTrue($this->component->faaEverMore(true, true)); } catch(TApplicationException $e) { $this->fail('TApplicationException raised while trying to execute a behavior class method'); } - + $this->assertTrue($this->component->disableBehavior('FooBehavior')); - + $this->assertFalse($this->component->isa('FooBehavior')); - + try { $this->component->faaEverMore(true, true); $this->fail('TApplicationException not raised trying to execute a undefined class method'); } catch(TApplicationException $e) {} - + $this->assertTrue($this->component->enableBehavior('FooBehavior')); - + $this->assertTrue($this->component->isa('FooBehavior')); try { $this->assertTrue($this->component->faaEverMore(true, true)); } catch(TApplicationException $e) { $this->fail('TApplicationException raised while trying to execute a behavior class method'); } - - - + + + $this->assertNull($this->component->enableBehavior('BarClassBehavior')); $this->assertNull($this->component->disableBehavior('BarClassBehavior')); - + try { $this->component->moreFunction(true, true); $this->fail('TApplicationException not raised trying to execute an undefined class method'); } catch(TApplicationException $e) {} - + $this->component->attachClassBehavior('BarClassBehavior', new BarClassBehavior); - + $this->assertFalse($this->component->enableBehavior('BarClassBehavior')); $this->assertFalse($this->component->disableBehavior('BarClassBehavior')); - + try { $this->assertTrue($this->component->moreFunction(true, true)); } catch(TApplicationException $e) { $this->fail('TApplicationException raised while trying to execute a behavior class method'); } - + $this->component->detachClassBehavior('BarClassBehavior'); } - - + + public function testBehaviorFunctionCalls() { - + $this->component->attachBehavior('FooBarBehavior', $behavior = new FooBarBehavior); $this->component->attachClassBehavior('FooClassBehavior', $classbehavior = new FooClassBehavior); - + // Test the Class Methods $this->assertEquals(12, $this->component->faaEverMore(3, 4)); - + // Check that the called object is shifted in front of the array of a class behavior call $this->assertEquals($this->component, $this->component->getLastClassObject()); - - + + //Test the FooBarBehavior $this->assertEquals(27, $this->component->moreFunction(3, 3)); - + $this->assertTrue($this->component->disableBehavior('FooBarBehavior')); try { $this->assertNull($this->component->moreFunction(3, 4)); $this->fail('TApplicationException not raised trying to execute a disabled behavior'); } catch(TApplicationException $e) {} $this->assertTrue($this->component->enableBehavior('FooBarBehavior')); - + // Test the global event space, this should work and return false because no function implements these methods $this->assertNull($this->component->fxSomeUndefinedGlobalEvent()); $this->assertNull($this->component->dySomeUndefinedIntraObjectEvent()); - + $this->component->detachClassBehavior('FooClassBehavior'); - - - + + + // test object instance behaviors implemented through class-wide behaviors $this->component->attachClassBehavior('FooFooBehaviorAsClass', 'FooFooBehavior'); - + $component = new NewComponent; - + $this->assertEquals(5, $this->component->faafaaEverMore(3, 4)); $this->assertEquals(10, $component->faafaaEverMore(6, 8)); - + $this->component->detachClassBehavior('FooFooBehaviorAsClass'); $component->unlisten(); $component = null; - + try { $this->component->faafaaEverMore(3, 4); $this->fail('TApplicationException not raised trying to execute a disabled behavior'); } catch(TApplicationException $e) {} - - - + + + // make a call to an unpatched fx and dy call so that it's passed through to the __dycall function $dynamicComponent = new DynamicCallComponent; - + $this->assertNull($dynamicComponent->fxUndefinedEvent()); $this->assertNull($dynamicComponent->dyUndefinedEvent()); - + //This tests the dynamic __dycall function $this->assertEquals(1024, $dynamicComponent->dyPowerFunction(2, 10)); $this->assertEquals(5, $dynamicComponent->dyDivisionFunction(10, 2)); - + $this->assertEquals(2048, $dynamicComponent->fxPowerFunction(2, 10)); $this->assertEquals(10, $dynamicComponent->fxDivisionFunction(10, 2)); - + $dynamicComponent->unlisten(); - + } - + public function testHasProperty() { $this->assertTrue($this->component->hasProperty('Text'), "Component hasn't property Text"); $this->assertTrue($this->component->hasProperty('text'), "Component hasn't property text"); $this->assertFalse($this->component->hasProperty('Caption'), "Component has property Caption"); - + $this->assertTrue($this->component->hasProperty('ColorAttribute'), "Component hasn't property JsColorAttribute"); $this->assertTrue($this->component->hasProperty('colorattribute'), "Component hasn't property JsColorAttribute"); $this->assertFalse($this->component->canGetProperty('PastelAttribute'), "Component has property JsPastelAttribute"); - + $this->assertTrue($this->component->hasProperty('JSColorAttribute'), "Component hasn't property JsColorAttribute"); $this->assertTrue($this->component->hasProperty('jscolorattribute'), "Component hasn't property JsColorAttribute"); $this->assertFalse($this->component->hasProperty('jsPastelAttribute'), "Component has property JsPastelAttribute"); - + $this->assertFalse($this->component->hasProperty('Excitement'), "Component has property Excitement"); $this->component->attachBehavior('ExcitementPropBehavior', new BehaviorTestBehavior); $this->assertTrue($this->component->hasProperty('Excitement'), "Component hasn't property Excitement"); @@ -1107,27 +1107,27 @@ class TComponentTest extends PHPUnit_Framework_TestCase { $this->assertFalse($this->component->hasProperty('Excitement'), "Component has property Excitement"); $this->component->enableBehavior('ExcitementPropBehavior'); $this->assertTrue($this->component->hasProperty('Excitement'), "Component hasn't property Excitement"); - + $this->component->detachBehavior('ExcitementPropBehavior'); - + $this->assertFalse($this->component->hasProperty('Excitement'), "Component has property Excitement"); - + } public function testCanGetProperty() { $this->assertTrue($this->component->canGetProperty('Text')); $this->assertTrue($this->component->canGetProperty('text')); $this->assertFalse($this->component->canGetProperty('Caption')); - + $this->assertTrue($this->component->canGetProperty('ColorAttribute')); $this->assertTrue($this->component->canGetProperty('colorattribute')); $this->assertFalse($this->component->canGetProperty('PastelAttribute')); - + $this->assertTrue($this->component->canGetProperty('JSColorAttribute')); $this->assertTrue($this->component->canGetProperty('jscolorattribute')); $this->assertFalse($this->component->canGetProperty('jsPastelAttribute')); - - + + $this->assertFalse($this->component->canGetProperty('Excitement'), "Component has property Excitement"); $this->component->attachBehavior('ExcitementPropBehavior', new BehaviorTestBehavior); $this->assertTrue($this->component->canGetProperty('Excitement'), "Component hasn't property Excitement"); @@ -1139,9 +1139,9 @@ class TComponentTest extends PHPUnit_Framework_TestCase { $this->assertFalse($this->component->canGetProperty('Excitement'), "Component has property Excitement"); $this->component->enableBehavior('ExcitementPropBehavior'); $this->assertTrue($this->component->canGetProperty('Excitement'), "Component hasn't property Excitement"); - + $this->component->detachBehavior('ExcitementPropBehavior'); - + $this->assertFalse($this->component->canGetProperty('Excitement'), "Component has property Excitement"); } @@ -1149,15 +1149,15 @@ class TComponentTest extends PHPUnit_Framework_TestCase { $this->assertTrue($this->component->canSetProperty('Text')); $this->assertTrue($this->component->canSetProperty('text')); $this->assertFalse($this->component->canSetProperty('Caption')); - + $this->assertTrue($this->component->canSetProperty('ColorAttribute')); $this->assertTrue($this->component->canSetProperty('colorattribute')); $this->assertFalse($this->component->canSetProperty('PastelAttribute')); - + $this->assertTrue($this->component->canSetProperty('JSColorAttribute')); $this->assertTrue($this->component->canSetProperty('jscolorattribute')); $this->assertFalse($this->component->canSetProperty('jsPastelAttribute')); - + $this->assertFalse($this->component->canSetProperty('Excitement'), "Component has property Excitement"); $this->component->attachBehavior('ExcitementPropBehavior', new BehaviorTestBehavior); $this->assertTrue($this->component->canSetProperty('Excitement'), "Component hasn't property Excitement"); @@ -1169,7 +1169,7 @@ class TComponentTest extends PHPUnit_Framework_TestCase { $this->assertFalse($this->component->canSetProperty('Excitement'), "Component has property Excitement"); $this->component->enableBehavior('ExcitementPropBehavior'); $this->assertTrue($this->component->canSetProperty('Excitement'), "Component hasn't property Excitement"); - + $this->component->detachBehavior('ExcitementPropBehavior'); } @@ -1180,55 +1180,55 @@ class TComponentTest extends PHPUnit_Framework_TestCase { $this->fail('exception not raised when getting undefined property'); } catch(TInvalidOperationException $e) { } - + $this->assertTrue($this->component->OnMyEvent instanceof TPriorityList); try { $value2=$this->component->onUndefinedEvent; $this->fail('exception not raised when getting undefined property'); } catch(TInvalidOperationException $e) { } - - //Without the function parenthesis, the function is _not_ called but the __get + + //Without the function parenthesis, the function is _not_ called but the __get // method is called and the global events (list) are accessed $this->assertTrue($this->component->fxAttachClassBehavior instanceof TPriorityList); $this->assertTrue($this->component->fxDetachClassBehavior instanceof TPriorityList); - + // even undefined global events have a list as every object is able to access every event $this->assertTrue($this->component->fxUndefinedEvent instanceof TPriorityList); - - + + // Test the behaviors within the __get function $this->component->enableBehaviors(); - + try { $value2=$this->component->Excitement; $this->fail('exception not raised when getting undefined property'); } catch(TInvalidOperationException $e) { } - + $this->component->attachBehavior('BehaviorTestBehavior', $behavior = new BehaviorTestBehavior); $this->assertEquals('faa', $this->component->Excitement); - + $this->component->disableBehaviors(); - + try { $this->assertEquals('faa', $this->component->Excitement); $this->fail('exception not raised when getting undefined property'); } catch(TInvalidOperationException $e) { } - + $this->component->enableBehaviors(); $this->assertEquals('faa', $this->component->getExcitement()); - + $this->component->disableBehavior('BehaviorTestBehavior'); - + $this->assertEquals($behavior, $this->component->BehaviorTestBehavior); try { $behavior = $this->component->BehaviorTestBehavior2; $this->fail('exception not raised when getting undefined property'); } catch(TInvalidOperationException $e) { } - + try { $this->assertEquals('faa', $this->component->Excitement); $this->fail('exception not raised when getting undefined property'); @@ -1236,13 +1236,13 @@ class TComponentTest extends PHPUnit_Framework_TestCase { } $this->component->enableBehavior('BehaviorTestBehavior'); $this->assertEquals('faa', $this->component->getExcitement()); - - + + // behaviors allow on and fx events to be passed through. $this->assertTrue($this->component->onBehaviorEvent instanceof TPriorityList); - + } - + public function testSetProperty() { $value='new value'; $this->component->Text=$value; @@ -1253,64 +1253,64 @@ class TComponentTest extends PHPUnit_Framework_TestCase { $this->fail('exception not raised when setting undefined property'); } catch(TInvalidOperationException $e) { } - + // Test get only properties is a set function try { $this->component->ReadOnlyProperty = 'setting read only'; $this->fail('a property without a set function was set to a new value without error'); } catch(TInvalidOperationException $e) { } - + try { $this->component->ReadOnlyJsProperty = 'jssetting read only'; $this->fail('a js property without a set function was set to a new value without error'); } catch(TInvalidOperationException $e) { } - + try { $this->component->JsReadOnlyJsProperty = 'jssetting read only'; $this->fail('a js property without a set function was set to a new value without error'); } catch(TInvalidOperationException $e) { } - + $this->assertEquals(0, $this->component->getEventHandlers('onMyEvent')->getCount()); $this->component->onMyEvent = array($this->component,'myEventHandler'); $this->assertEquals(1, $this->component->getEventHandlers('onMyEvent')->getCount()); $this->component->onMyEvent[] = array($this->component,'Object.myEventHandler'); $this->assertEquals(2, $this->component->getEventHandlers('onMyEvent')->getCount()); - + $this->component->getEventHandlers('onMyEvent')->clear(); - + // Test the behaviors within the __get function $this->component->enableBehaviors(); - + try { $this->component->Excitement = 'laa'; $this->fail('exception not raised when getting undefined property'); } catch(TInvalidOperationException $e) { } - + $this->component->attachBehavior('BehaviorTestBehavior', $behavior1 = new BehaviorTestBehavior); $this->component->Excitement = 'laa'; $this->assertEquals('laa', $this->component->Excitement); $this->assertEquals('sol', $this->component->Excitement = 'sol'); - - + + $this->component->disableBehaviors(); - + try { $this->component->Excitement = false; $this->assertEquals(false, $this->component->Excitement); $this->fail('exception not raised when getting undefined property'); } catch(TInvalidOperationException $e) { } - + $this->component->enableBehaviors(); $this->component->Excitement = 'faa'; $this->assertEquals('faa', $this->component->getExcitement()); - + $this->component->disableBehavior('BehaviorTestBehavior'); - + try { $this->component->Excitement = false; $this->assertEquals(false, $this->component->Excitement); @@ -1320,82 +1320,82 @@ class TComponentTest extends PHPUnit_Framework_TestCase { $this->component->enableBehavior('BehaviorTestBehavior'); $this->component->Excitement = 'sol'; $this->assertEquals('sol', $this->component->Excitement); - - + + $this->component->attachBehavior('BehaviorTestBehavior2', $behavior2 = new BehaviorTestBehavior); - + $this->assertEquals('sol', $this->component->Excitement); $this->assertEquals('faa', $behavior2->Excitement); - + // this sets Excitement for both because they are not uniquely named $this->component->Excitement = 'befaad'; - + $this->assertEquals('befaad', $this->component->Excitement); $this->assertEquals('befaad', $behavior1->Excitement); $this->assertEquals('befaad', $behavior2->Excitement); - - + + $this->component->detachBehavior('BehaviorTestBehavior2'); - + // behaviors allow on and fx events to be passed through. $this->assertTrue($this->component->BehaviorTestBehavior->onBehaviorEvent instanceof TPriorityList); - + $this->assertEquals(0, $this->component->BehaviorTestBehavior->getEventHandlers('onBehaviorEvent')->getCount()); $this->component->onBehaviorEvent = array($this->component,'myEventHandler'); $this->assertEquals(1, $this->component->BehaviorTestBehavior->getEventHandlers('onBehaviorEvent')->getCount()); $this->component->onBehaviorEvent[] = array($this->component,'Object.myEventHandler'); $this->assertEquals(2, $this->component->BehaviorTestBehavior->getEventHandlers('onBehaviorEvent')->getCount()); - + $this->component->BehaviorTestBehavior->getEventHandlers('onBehaviorEvent')->clear(); } - - + + public function testIsSetFunction() { $this->assertTrue(isset($this->component->fxAttachClassBehavior)); $this->component->unlisten(); - + $this->assertFalse(isset($this->component->onMyEvent)); $this->assertFalse(isset($this->component->undefinedEvent)); $this->assertFalse(isset($this->component->fxAttachClassBehavior)); - + $this->assertFalse(isset($this->component->BehaviorTestBehavior)); $this->assertFalse(isset($this->component->onBehaviorEvent)); - + $this->component->attachBehavior('BehaviorTestBehavior', new BehaviorTestBehavior); - + $this->assertTrue(isset($this->component->BehaviorTestBehavior)); $this->assertFalse(isset($this->component->onBehaviorEvent)); - + $this->component->attachEventHandler('onBehaviorEvent','foo'); $this->assertTrue(isset($this->component->onBehaviorEvent)); - + $this->component->attachEventHandler('onMyEvent','foo'); $this->assertTrue(isset($this->component->onMyEvent)); - + $this->assertTrue(isset($this->component->Excitement)); $this->component->Excitement = null; $this->assertFalse(isset($this->component->Excitement)); $this->assertFalse(isset($this->component->UndefinedBehaviorProperty)); - - + + } - - + + public function testUnsetFunction() { - + $this->assertEquals('default', $this->component->getText()); unset($this->component->Text); $this->assertNull($this->component->getText()); - + unset($this->component->UndefinedProperty); - + // object events $this->assertEquals(0, $this->component->onMyEvent->Count); $this->component->attachEventHandler('onMyEvent','foo'); $this->assertEquals(1, $this->component->onMyEvent->Count); unset($this->component->onMyEvent); $this->assertEquals(0, $this->component->onMyEvent->Count); - + //global events $this->assertEquals(1, $this->component->fxAttachClassBehavior->Count); $component = new NewComponent(); @@ -1404,22 +1404,22 @@ class TComponentTest extends PHPUnit_Framework_TestCase { // retain the other object event $this->assertEquals(1, $this->component->fxAttachClassBehavior->Count); $component->unlisten(); - + try { unset($this->component->Object); $this->fail('TInvalidOperationException not raised when unsetting get only property'); } catch(TInvalidOperationException $e) {} - + $this->component->attachBehavior('BehaviorTestBehavior', new BehaviorTestBehavior); $this->assertTrue($this->component->asa('BehaviorTestBehavior') instanceof BehaviorTestBehavior); $this->assertFalse($this->component->asa('BehaviorTestBehavior2') instanceof BehaviorTestBehavior); - + $this->assertEquals('faa', $this->component->Excitement); unset($this->component->Excitement); $this->assertNull($this->component->Excitement); $this->component->Excitement = 'sol'; $this->assertEquals('sol', $this->component->Excitement); - + // Test the disabling of unset within behaviors $this->component->disableBehaviors(); unset($this->component->Excitement); @@ -1430,60 +1430,60 @@ class TComponentTest extends PHPUnit_Framework_TestCase { unset($this->component->Excitement); $this->component->enableBehavior('BehaviorTestBehavior'); $this->assertEquals('sol', $this->component->Excitement); - + unset($this->component->Excitement); $this->assertNull($this->component->Excitement); - + try { unset($this->component->ReadOnly); $this->fail('TInvalidOperationException not raised when unsetting get only property'); } catch(TInvalidOperationException $e) {} - + $this->component->onBehaviorEvent = 'foo'; $this->assertEquals(1, count($this->component->onBehaviorEvent)); $this->assertEquals(1, count($this->component->BehaviorTestBehavior->onBehaviorEvent)); unset($this->component->onBehaviorEvent); $this->assertEquals(0, count($this->component->onBehaviorEvent)); $this->assertEquals(0, count($this->component->BehaviorTestBehavior->onBehaviorEvent)); - + // Remove behavior via unset unset($this->component->BehaviorTestBehavior); $this->assertFalse($this->component->asa('BehaviorTestBehavior') instanceof BehaviorTestBehavior); - + } public function testGetSubProperty() { $this->assertTrue('object text'===$this->component->getSubProperty('Object.Text')); } - + public function testSetSubProperty() { $this->component->setSubProperty('Object.Text','new object text'); $this->assertEquals('new object text',$this->component->getSubProperty('Object.Text')); } - + public function testHasEvent() { $this->assertTrue($this->component->hasEvent('OnMyEvent')); $this->assertTrue($this->component->hasEvent('onmyevent')); $this->assertFalse($this->component->hasEvent('onYourEvent')); - + // fx won't throw an error if any of these fx function are called on an object. // It is a special prefix event designation that every object responds to all events. $this->assertTrue($this->component->hasEvent('fxAttachClassBehavior')); $this->assertTrue($this->component->hasEvent('fxattachclassbehavior')); - + $this->assertTrue($this->component->hasEvent('fxNonExistantGlobalEvent')); $this->assertTrue($this->component->hasEvent('fxnonexistantglobalevent')); - + $this->assertTrue($this->component->hasEvent('dyNonExistantLocalEvent')); $this->assertTrue($this->component->hasEvent('fxnonexistantlocalevent')); - - + + //Test behavior events $this->assertFalse($this->component->hasEvent('onBehaviorEvent')); $this->component->attachBehavior('BehaviorTestBehavior', new BehaviorTestBehavior); $this->assertTrue($this->component->hasEvent('onBehaviorEvent')); $this->assertTrue($this->component->BehaviorTestBehavior->hasEvent('onBehaviorEvent')); - + $this->component->disableBehavior('BehaviorTestBehavior'); $this->assertFalse($this->component->hasEvent('onBehaviorEvent')); $this->component->enableBehavior('BehaviorTestBehavior'); @@ -1494,20 +1494,20 @@ class TComponentTest extends PHPUnit_Framework_TestCase { $this->assertFalse($this->component->hasEventHandler('OnMyEvent')); $this->component->attachEventHandler('OnMyEvent','foo'); $this->assertTrue($this->component->hasEventHandler('OnMyEvent')); - + $this->assertFalse($this->component->hasEventHandler('fxNonExistantGlobalEvent')); $this->component->attachEventHandler('fxNonExistantGlobalEvent','foo'); $this->assertTrue($this->component->hasEventHandler('fxNonExistantGlobalEvent')); - + //Test behavior events $this->assertFalse($this->component->hasEventHandler('onBehaviorEvent')); $this->component->attachBehavior('BehaviorTestBehavior', new BehaviorTestBehavior); $this->assertFalse($this->component->hasEventHandler('onBehaviorEvent')); $this->assertFalse($this->component->BehaviorTestBehavior->hasEventHandler('onBehaviorEvent')); - + $this->component->attachEventHandler('onBehaviorEvent','foo'); $this->assertTrue($this->component->hasEventHandler('onBehaviorEvent')); - + $this->component->disableBehavior('BehaviorTestBehavior'); $this->assertFalse($this->component->hasEvent('onBehaviorEvent')); $this->assertFalse($this->component->hasEventHandler('onBehaviorEvent')); @@ -1526,7 +1526,7 @@ class TComponentTest extends PHPUnit_Framework_TestCase { $this->fail('exception not raised when getting event handlers for undefined event'); } catch(TInvalidOperationException $e) { } - + $list=$this->component->getEventHandlers('fxRandomEvent'); $this->assertTrue(($list instanceof TPriorityList) && ($list->getCount()===0)); $this->component->attachEventHandler('fxRandomEvent','foo'); @@ -1536,9 +1536,9 @@ class TComponentTest extends PHPUnit_Framework_TestCase { } catch(TInvalidOperationException $e) { $this->fail('exception raised when getting event handlers for universal global event'); } - - - + + + //Test behavior events try { $list=$this->component->getEventHandlers('onBehaviorEvent'); @@ -1546,13 +1546,13 @@ class TComponentTest extends PHPUnit_Framework_TestCase { } catch(TInvalidOperationException $e) { } $this->assertFalse($this->component->hasEventHandler('onBehaviorEvent')); - + $this->component->attachBehavior('BehaviorTestBehavior', new BehaviorTestBehavior); $list=$this->component->getEventHandlers('onBehaviorEvent'); $this->assertTrue(($list instanceof TPriorityList) && ($list->getCount()===0)); $this->component->attachEventHandler('onBehaviorEvent','foo'); $this->assertTrue(($list instanceof TPriorityList) && ($list->getCount()===1)); - + $this->component->disableBehavior('BehaviorTestBehavior'); try { $list=$this->component->getEventHandlers('onBehaviorEvent'); @@ -1561,11 +1561,11 @@ class TComponentTest extends PHPUnit_Framework_TestCase { } $this->component->enableBehavior('BehaviorTestBehavior'); $this->assertTrue(($this->component->getEventHandlers('onBehaviorEvent') instanceof TPriorityList) && ($list->getCount()===1)); - + } public function testAttachEventHandler() { - + $this->component->attachEventHandler('OnMyEvent','foo'); $this->assertEquals(1, $this->component->getEventHandlers('OnMyEvent')->getCount()); try { @@ -1573,7 +1573,7 @@ class TComponentTest extends PHPUnit_Framework_TestCase { $this->fail('exception not raised when attaching event handlers for undefined event'); } catch(TInvalidOperationException $e) { } - + //Testing the priorities of attaching events $this->component->attachEventHandler('OnMyEvent','foopre', 5); $this->component->attachEventHandler('OnMyEvent','foopost', 15); @@ -1584,8 +1584,8 @@ class TComponentTest extends PHPUnit_Framework_TestCase { $this->assertEquals('foo', $list[1]); $this->assertEquals('foobar', $list[2]); $this->assertEquals('foopost', $list[3]); - - + + //Test attaching behavior events try { $this->component->attachEventHandler('onBehaviorEvent','foo'); @@ -1593,9 +1593,9 @@ class TComponentTest extends PHPUnit_Framework_TestCase { } catch(TInvalidOperationException $e) { } $this->component->attachBehavior('BehaviorTestBehavior', new BehaviorTestBehavior); - + $this->component->attachEventHandler('onBehaviorEvent','foo'); - + //Testing the priorities of attaching behavior events $this->component->attachEventHandler('onBehaviorEvent','foopre', 5); $this->component->attachEventHandler('onBehaviorEvent','foopost', 15); @@ -1608,7 +1608,7 @@ class TComponentTest extends PHPUnit_Framework_TestCase { $this->assertEquals('foobar', $list[2]); $this->assertEquals('foobarfoobar', $list[3]); $this->assertEquals('foopost', $list[4]); - + $this->component->disableBehavior('BehaviorTestBehavior'); try { $this->component->attachEventHandler('onBehaviorEvent','bar'); @@ -1616,37 +1616,37 @@ class TComponentTest extends PHPUnit_Framework_TestCase { } catch(TInvalidOperationException $e) { } $this->component->enableBehavior('BehaviorTestBehavior'); - + } public function testDetachEventHandler() { - + $this->component->attachEventHandler('OnMyEvent','foo'); $this->assertEquals(1, $this->component->getEventHandlers('OnMyEvent')->getCount()); - + $this->component->attachEventHandler('OnMyEvent','foopre', 5); $this->component->attachEventHandler('OnMyEvent','foopost', 15); $this->component->attachEventHandler('OnMyEvent','foobar', 10); $this->component->attachEventHandler('OnMyEvent','foobarfoobar', 10); - - - + + + $this->component->detachEventHandler('OnMyEvent','foo'); $list = $this->component->getEventHandlers('OnMyEvent'); $this->assertEquals(4, $list->getCount()); - + $this->assertEquals('foopre', $list[0]); $this->assertEquals('foobar', $list[1]); $this->assertEquals('foobarfoobar', $list[2]); $this->assertEquals('foopost', $list[3]); - + $this->component->detachEventHandler('OnMyEvent','foopre', null); $this->assertEquals(4, $list->getCount()); - + $this->component->detachEventHandler('OnMyEvent','foopre', 5); $this->assertEquals(3, $list->getCount()); - - + + // Now do detaching of behavior on events try { $this->component->attachEventHandler('onBehaviorEvent','foo'); @@ -1654,29 +1654,29 @@ class TComponentTest extends PHPUnit_Framework_TestCase { } catch(TInvalidOperationException $e) { } $this->component->attachBehavior('BehaviorTestBehavior', new BehaviorTestBehavior); - + $this->component->attachEventHandler('onBehaviorEvent','foo'); $this->assertEquals(1, $this->component->getEventHandlers('onBehaviorEvent')->getCount()); - + $this->component->attachEventHandler('onBehaviorEvent','foopre', 5); $this->component->attachEventHandler('onBehaviorEvent','foopost', 15); $this->component->attachEventHandler('onBehaviorEvent','foobar', 10); $this->component->attachEventHandler('onBehaviorEvent','foobarfoobar', 10); - - - + + + $this->component->detachEventHandler('onBehaviorEvent','foo'); $list = $this->component->getEventHandlers('onBehaviorEvent'); $this->assertEquals(4, $list->getCount()); - + $this->assertEquals('foopre', $list[0]); $this->assertEquals('foobar', $list[1]); $this->assertEquals('foobarfoobar', $list[2]); $this->assertEquals('foopost', $list[3]); - + $this->component->detachEventHandler('onBehaviorEvent','foopre', null); $this->assertEquals(4, $list->getCount()); - + $this->component->detachEventHandler('onBehaviorEvent','foopre', 5); $this->assertEquals(3, $list->getCount()); } @@ -1693,14 +1693,14 @@ class TComponentTest extends PHPUnit_Framework_TestCase { $this->assertFalse($this->component->Object->isEventHandled()); $this->component->raiseEvent('OnMyEvent',$this,null); $this->assertTrue($this->component->Object->isEventHandled()); - + $this->component->resetEventHandled(); $this->component->Object->resetEventHandled(); - - + + // Test a behavior on event $this->component->attachBehavior('test', new BehaviorTestBehavior); - + $this->component->attachEventHandler('onBehaviorEvent',array($this->component,'myEventHandler')); $this->assertFalse($this->component->isEventHandled()); $this->component->raiseEvent('onBehaviorEvent',$this,null); @@ -1709,13 +1709,13 @@ class TComponentTest extends PHPUnit_Framework_TestCase { $this->assertFalse($this->component->Object->isEventHandled()); $this->component->raiseEvent('onBehaviorEvent',$this,null); $this->assertTrue($this->component->Object->isEventHandled()); - + //test behavior enabled/disabled events $this->component->disableBehavior('test'); - + $this->component->resetEventHandled(); $this->component->Object->resetEventHandled(); - + try { $this->component->attachEventHandler('onBehaviorEvent',array($this->component,'myEventHandler')); $this->fail('exception not raised when getting event handlers for undefined event'); @@ -1726,172 +1726,172 @@ class TComponentTest extends PHPUnit_Framework_TestCase { $this->fail('exception not raised when getting event handlers for undefined event'); } catch(TInvalidOperationException $e) {} $this->assertFalse($this->component->isEventHandled()); - + $this->component->enableBehavior('test'); - - - + + + //Test the return types of this function - + $this->assertFalse($this->component->isEventHandled()); $this->assertFalse($this->component->Object->isEventHandled()); $this->assertEquals(array(), $this->component->onBehaviorEvent($this,$this->component)); $this->assertTrue($this->component->isEventHandled()); $this->assertTrue($this->component->Object->isEventHandled()); - + // This accumulates all the responses from each of the events $arr=$this->component->onBehaviorEvent($this, $this->component, TEventResults::EVENT_RESULT_ALL); $this->assertEquals($this, $arr[0]['sender']); $this->assertEquals($this->component, $arr[0]['param']); $this->assertTrue(null === $arr[0]['response']); - + $this->assertEquals($this, $arr[1]['sender']); $this->assertEquals($this->component, $arr[1]['param']); $this->assertTrue(null === $arr[1]['response']); - + $this->assertEquals(2, count($arr)); - + // This tests without the default filtering-out of null $arr=$this->component->onBehaviorEvent($this, $this->component, false); $this->assertEquals(array(null, null), $arr); - - + + unset($this->component->onBehaviorEvent); $this->assertEquals(0, $this->component->onBehaviorEvent->Count); - + $this->component->onBehaviorEvent = array($this, 'returnValue4'); $this->component->onBehaviorEvent = array($this, 'returnValue1'); - + // Test the per event post processing function $arr=$this->component->onBehaviorEvent($this, $this->component, array($this, 'postEventFunction')); $this->assertEquals(array(exp(4), exp(1)), $arr); $arr=$this->component->onBehaviorEvent($this, $this->component, array($this, 'postEventFunction2')); $this->assertEquals(array(sin(4), sin(1)), $arr); - - + + //Testing Feed-forward functionality unset($this->component->onBehaviorEvent); - + $this->component->onBehaviorEvent = array($this, 'ffValue4'); $this->component->onBehaviorEvent = array($this, 'ffValue2'); $arr=$this->component->onBehaviorEvent($this, 5, TEventResults::EVENT_RESULT_FEED_FORWARD); $this->assertEquals(array(20, 40), $arr); - - + + unset($this->component->onBehaviorEvent); - + //Order of these events affects the response order in feed forward $this->component->onBehaviorEvent = array($this, 'ffValue2'); $this->component->onBehaviorEvent = array($this, 'ffValue4'); $arr=$this->component->onBehaviorEvent($this, 5, TEventResults::EVENT_RESULT_FEED_FORWARD); $this->assertEquals(array(10, 40), $arr); } - + public function returnValue1(){return 1;} public function returnValue4(){return 4;} public function postEventFunction($sender, $param, $caller, $response){return exp($response);} public function postEventFunction2($sender, $param, $caller, $response){return sin($response);} public function ffValue2($sender, $param){return $param*2;} public function ffValue4($sender, $param){return $param*4;} - - + + public function testGlobalEventListenerInRaiseEvent() { //TODO Test the Global Event Listener } - - + + public function testIDynamicMethodsOnBehavior() { - + //Add Behavior with dynamic call $this->component->attachBehavior('TDynamicBehavior', new TDynamicBehavior); - + //Check that the behavior is working as it should $this->assertTrue($this->component->isa('TDynamicBehavior')); $this->assertNull($this->component->getLastBehaviorDynamicMethodCalled()); - + // call basic behavior implemented method from object (containing behavior) $this->assertEquals(42, $this->component->TestBehaviorMethod(6, 7)); - + //Test out undefined behavior/host object method try { $this->component->objectAndBehaviorUndefinedMethod(); $this->fail('exception not raised when evaluating an undefined method by the object and behavior'); } catch(TApplicationException $e) { } - + // calling undefined dynamic method, caught by the __dycall method in the behavior and implemented // this behavior catches undefined dynamic event and divides param1 by param 2 $this->assertEquals(22, $this->component->dyTestDynamicBehaviorMethod(242, 11)); $this->assertEquals('dyTestDynamicBehaviorMethod', $this->component->getLastBehaviorDynamicMethodCalled()); - + // calling undefined dynamic method, caught by the __dycall in the behavior and ignored $this->assertNull($this->component->dyUndefinedIntraEvent(242, 11)); $this->assertEquals('dyUndefinedIntraEvent', $this->component->getLastBehaviorDynamicMethodCalled()); - + //call behavior defined dynamic event // param1 * 2 * param2 $this->assertEquals(2420, $this->component->dyTestIntraEvent(121, 10)); - + $this->component->detachBehavior('TDynamicBehavior'); $this->assertFalse($this->component->isa('TDynamicBehavior')); - - - + + + //Add Class Behavior with dynamic call $this->component->attachBehavior('TDynamicClassBehavior', new TDynamicClassBehavior); - + //Check that the behavior is working as it should $this->assertTrue($this->component->isa('TDynamicClassBehavior')); $this->assertNull($this->component->getLastBehaviorDynamicMethodCalled()); - + // call basic behavior implemented method from object (containing behavior) $this->assertEquals(42, $this->component->TestBehaviorMethod(6, 7)); - + //Test out undefined behavior/host object method try { $this->component->objectAndBehaviorUndefinedMethod(); $this->fail('exception not raised when evaluating an undefined method by the object and behavior'); } catch(TApplicationException $e) { } - + // calling undefined dynamic method, caught by the __dycall method in the behavior and implemented // this behavior catches undefined dynamic event and divides param1 by param 2 $this->assertEquals(22, $this->component->dyTestDynamicClassBehaviorMethod(242, 11)); $this->assertEquals('dyTestDynamicClassBehaviorMethod', $this->component->getLastBehaviorDynamicMethodCalled()); - + // calling undefined dynamic method, caught by the __dycall in the behavior and ignored $this->assertNull($this->component->dyUndefinedIntraEvent(242, 11)); $this->assertEquals('dyUndefinedIntraEvent', $this->component->getLastBehaviorDynamicMethodCalled()); - + //call behavior defined dynamic event // param1 * 2 * param2 $this->assertEquals(2420, $this->component->dyTestIntraEvent(121, 10)); - + $this->component->detachBehavior('TDynamicClassBehavior'); $this->assertFalse($this->component->isa('TDynamicClassBehavior')); - + } - + // This also tests the priority of the common global raiseEvent events public function testIDynamicMethodsOnBehaviorGlobalEvents() { $component = new GlobalRaiseComponent(); - + // common function has a default priority of 10 $component->attachEventHandler(TComponent::GLOBAL_RAISE_EVENT_LISTENER, array($component, 'commonRaiseEventListener')); $component->attachEventHandler(TComponent::GLOBAL_RAISE_EVENT_LISTENER, array($component, 'postglobalRaiseEventListener'), 1); $component->attachEventHandler(TComponent::GLOBAL_RAISE_EVENT_LISTENER, array($component, 'preglobalRaiseEventListener'), -1); - + $this->assertEquals(5, $this->component->fxGlobalListener->getCount()); $this->assertEquals(1, $this->component->fxPrimaryGlobalEvent->getCount()); $this->assertEquals(1, $this->component->fxPrimaryGlobalEvent->getCount(), 'fxPrimaryGlobalEvent is not installed on test object'); - + // call the global event on a different object than the test object $res = $this->component->raiseEvent('fxPrimaryGlobalEvent', $this, null, TEventResults::EVENT_RESULT_ALL); - + $this->assertEquals(6, count($res)); $this->assertEquals(array('pregl', 'primary', 'postgl', 'fxGL', 'fxcall', 'com'), $component->getCallOrders()); - + $component->unlisten(); } @@ -1907,10 +1907,10 @@ class TComponentTest extends PHPUnit_Framework_TestCase { } catch(Exception $e) { } } - - - - + + + + public function testEvaluateStatements() { $statements='$a="test string"; echo $a;'; $this->assertEquals('test string',$this->component->evaluateStatements($statements)); @@ -1921,169 +1921,167 @@ class TComponentTest extends PHPUnit_Framework_TestCase { } catch(Exception $e) { } } - - + + public function testDynamicFunctionCall() { - + $this->assertEquals(' aa bb cc __ .. ++ || !! ?? ', $this->component->dyTextFilter(' aa bb cc __ .. ++ || !! ?? ')); - + $this->component->attachBehavior('dy1', new dy1TextReplace); $this->assertFalse($this->component->dy1->isCalled()); $this->assertEquals(' aa bb cc __ __ ++ || !! ?? ', $this->component->dyTextFilter(' aa bb cc __ .. ++ || !! ?? ')); $this->assertTrue($this->component->dy1->isCalled()); - + $this->component->attachBehavior('dy2', new dy2TextReplace); $this->assertFalse($this->component->dy2->isCalled()); $this->assertEquals(' aa bb cc __ __ || || !! ?? ', $this->component->dyTextFilter(' aa bb cc __ .. ++ || !! ?? ')); $this->assertTrue($this->component->dy2->isCalled()); - + $this->component->attachBehavior('dy3', new dy3TextReplace); $this->assertFalse($this->component->dy3->isCalled()); $this->assertEquals(' aa bb cc __ __ || || ?? ?? ', $this->component->dyTextFilter(' aa bb cc __ .. ++ || !! ?? ')); $this->assertTrue($this->component->dy3->isCalled()); - + $this->assertEquals(' aa bb cc __ .. ++ || !! ?? ', $this->component->dyUndefinedEvent(' aa bb cc __ .. ++ || !! ?? ')); - + $this->assertEquals(0.25, $this->component->dyPowerFunction(2,2)); - - + + $this->component->detachBehavior('dy1'); $this->component->detachBehavior('dy2'); $this->component->detachBehavior('dy3'); - + //test class behaviors of dynamic events and the argument list order - + $this->assertEquals(' aa bb cc __ .. ++ || !! ?? ', $this->component->dyTextFilter(' aa bb cc __ .. ++ || !! ?? ')); - + $this->component->attachBehavior('dy1', new dy1ClassTextReplace); $this->assertFalse($this->component->dy1->isCalled()); $this->assertEquals(' aa bb cc .. .. ++ || !! ?? ', $this->component->dyTextFilter(' aa bb cc __ .. ++ || !! ?? ')); $this->assertTrue($this->component->dy1->isCalled()); - + $this->component->attachBehavior('dy2', new dy2ClassTextReplace); $this->assertFalse($this->component->dy2->isCalled()); $this->assertEquals(' aa bb cc .. .. ++ ++ !! ?? ', $this->component->dyTextFilter(' aa bb cc __ .. ++ || !! ?? ')); $this->assertTrue($this->component->dy2->isCalled()); - + $this->component->attachBehavior('dy3', new dy3ClassTextReplace); $this->assertFalse($this->component->dy3->isCalled()); $this->assertEquals(' aa bb cc .. .. ++ ++ !! ^_^ ', $this->component->dyTextFilter(' aa bb cc __ .. ++ || !! ?? ')); $this->assertTrue($this->component->dy3->isCalled()); - + $this->assertEquals(' aa bb cc __ .. ++ || !! ?? ', $this->component->dyUndefinedEvent(' aa bb cc __ .. ++ || !! ?? ')); - + $this->assertEquals(0.25, $this->component->dyPowerFunction(2,2)); - - + + } - - - - + + + + public function testDynamicIntraObjectEvents() { - + $this->component->attachBehavior('IntraEvents', new IntraObjectExtenderBehavior); - + $this->assertNull($this->component->IntraEvents->LastCall); - + //unlisten first, this object listens upon instantiation. $this->component->unlisten(); $this->assertEquals(2, $this->component->IntraEvents->LastCall); - + // ensures that IntraEvents nulls the last call variable when calling this getter $this->assertNull($this->component->IntraEvents->LastCall); - + //listen next to undo the unlisten $this->component->listen(); $this->assertEquals(1, $this->component->IntraEvents->LastCall); - - + + $this->assertEquals(3, $this->component->evaluateExpression('1+2')); $this->assertEquals(7, $this->component->IntraEvents->LastCall); - + $statements='$a="test string"; echo $a;'; $this->assertEquals('test string', $this->component->evaluateStatements($statements)); $this->assertEquals(8, $this->component->IntraEvents->LastCall); - + $component2 = new NewComponentNoListen(); $this->assertNull($this->component->createdOnTemplate($component2)); $this->assertEquals(9, $this->component->IntraEvents->LastCall); - + $this->assertNull($this->component->addParsedObject($component2)); $this->assertEquals(10, $this->component->IntraEvents->LastCall); - - - + + + $behavior = new BarBehavior; $this->assertEquals($behavior, $this->component->attachBehavior('BarBehavior', $behavior)); $this->assertEquals(11, $this->component->IntraEvents->LastCall); - + $this->assertNull($this->component->disableBehaviors()); $this->assertNull($this->component->enableBehaviors()); $this->assertEquals(27, $this->component->IntraEvents->LastCall); - + $this->assertTrue($this->component->disableBehavior('BarBehavior')); $this->assertEquals(16, $this->component->IntraEvents->LastCall); - + $this->assertTrue($this->component->enableBehavior('BarBehavior')); $this->assertEquals(15, $this->component->IntraEvents->LastCall); - + $this->assertEquals($behavior, $this->component->detachBehavior('BarBehavior')); $this->assertEquals(12, $this->component->IntraEvents->LastCall); - - + + $this->component->attachEventHandler('OnMyEvent',array($this->component,'myEventHandler')); $this->component->raiseEvent('OnMyEvent',$this,null); - + //3 + 4 + 5 + 6 = 18 (the behavior adds these together when each raiseEvent dynamic intra event is called) $this->assertEquals(18, $this->component->IntraEvents->LastCall); } - - - + + + public function testJavascriptGetterSetter() { - + $this->assertFalse(isset($this->component->ColorAttribute)); $this->assertFalse(isset($this->component->JsColorAttribute)); - + $this->component->ColorAttribute = "('#556677', '#abcdef', 503987)"; $this->assertEquals("('#556677', '#abcdef', 503987)", $this->component->ColorAttribute); - + $this->assertTrue(isset($this->component->ColorAttribute)); $this->assertTrue(isset($this->component->JsColorAttribute)); - + $this->component->ColorAttribute = "new Array(1, 2, 3, 4, 5)"; $this->assertEquals("new Array(1, 2, 3, 4, 5)", $this->component->JsColorAttribute); - + $this->component->JsColorAttribute = "['#112233', '#fedcba', 22009837]"; $this->assertEquals("['#112233', '#fedcba', 22009837]", $this->component->ColorAttribute); } - - + + public function testJavascriptIssetUnset() { - + $this->component->JsColorAttribute = "['#112233', '#fedcba', 22009837]"; $this->assertEquals("['#112233', '#fedcba', 22009837]", $this->component->ColorAttribute); - + unset($this->component->ColorAttribute); - + $this->assertFalse(isset($this->component->ColorAttribute)); $this->assertFalse(isset($this->component->JsColorAttribute)); - + $this->component->JsColorAttribute = "['#112233', '#fedcba', 22009837]"; - + $this->assertTrue(isset($this->component->ColorAttribute)); $this->assertTrue(isset($this->component->JsColorAttribute)); - + unset($this->component->JsColorAttribute); - + $this->assertFalse(isset($this->component->ColorAttribute)); $this->assertFalse(isset($this->component->JsColorAttribute)); - + } - - - -} -?>
\ No newline at end of file + + +} diff --git a/tests/unit/Util/AllTests.php b/tests/unit/Util/AllTests.php index 8ab99a50..a6a217d7 100644 --- a/tests/unit/Util/AllTests.php +++ b/tests/unit/Util/AllTests.php @@ -11,13 +11,13 @@ class Util_AllTests { public static function main() { PHPUnit_TextUI_TestRunner::run(self::suite()); } - + public static function suite() { $suite = new PHPUnit_Framework_TestSuite('System.Util'); - + $suite->addTestSuite('TDateTimeStampTest'); $suite->addTestSuite('TLoggerTest'); - + return $suite; } } @@ -25,4 +25,3 @@ class Util_AllTests { if(PHPUnit_MAIN_METHOD == 'Util_AllTests::main') { Util_AllTests::main(); } -?> diff --git a/tests/unit/Util/TDateTimeStampTest.php b/tests/unit/Util/TDateTimeStampTest.php index 6ae4b128..37784ef3 100644 --- a/tests/unit/Util/TDateTimeStampTest.php +++ b/tests/unit/Util/TDateTimeStampTest.php @@ -7,7 +7,7 @@ Prado::using('System.Util.TDateTimeStamp'); * @package System.Util */ class TDateTimeStampTest extends PHPUnit_Framework_TestCase { - + public function testGetTimeStampAndFormat() { $s = new TDateTimeStamp; $t = $s->getTimeStamp(0,0,0); @@ -126,4 +126,3 @@ class TDateTimeStampTest extends PHPUnit_Framework_TestCase { } } -?> diff --git a/tests/unit/Util/TLoggerTest.php b/tests/unit/Util/TLoggerTest.php index 49d5d316..03b36c5b 100644 --- a/tests/unit/Util/TLoggerTest.php +++ b/tests/unit/Util/TLoggerTest.php @@ -16,11 +16,10 @@ class TLoggerTest extends PHPUnit_Framework_TestCase { public function testLog() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testGetLogs() { throw new PHPUnit_Framework_IncompleteTestError(); } } -?> diff --git a/tests/unit/Util/TSimpleDateFormatterTest.php b/tests/unit/Util/TSimpleDateFormatterTest.php index b989fcf5..ce6f1234 100644 --- a/tests/unit/Util/TSimpleDateFormatterTest.php +++ b/tests/unit/Util/TSimpleDateFormatterTest.php @@ -16,49 +16,48 @@ class TSimpleDateFormatterTest extends PHPUnit_Framework_TestCase { public function testConstruct() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testPattern() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testCharset() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testFormat() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testMonthPattern() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testDayPattern() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testYearPattern() { $formatter = new TSimpleDateFormatter("yyyy"); self::assertEquals("2008-01-01", date('Y-m-d', $formatter->parse("2008"))); } - + public function testMissingYearPattern() { $formatter = new TSimpleDateFormatter("MM/dd"); self::assertEquals(date("Y-10-22"), date('Y-m-d', $formatter->parse("10/22"))); } - + public function testDayMonthYearOrdering() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testIsValidDate() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testParse() { throw new PHPUnit_Framework_IncompleteTestError(); } } -?> diff --git a/tests/unit/Web/AllTests.php b/tests/unit/Web/AllTests.php index f9b3b91d..ffd98978 100644 --- a/tests/unit/Web/AllTests.php +++ b/tests/unit/Web/AllTests.php @@ -20,10 +20,10 @@ class Web_AllTests { public static function main() { PHPUnit_TextUI_TestRunner::run(self::suite()); } - + public static function suite() { $suite = new PHPUnit_Framework_TestSuite('System.Web'); - + $suite->addTestSuite('TAssetManagerTest'); $suite->addTestSuite('TCacheHttpSessionTest'); $suite->addTestSuite('THttpCookieCollectionTest'); @@ -33,9 +33,9 @@ class Web_AllTests { $suite->addTestSuite('THttpSessionTest'); $suite->addTestSuite('THttpUtilityTest'); $suite->addTestSuite('TUriTest'); - + $suite->addTest(Web_UI_AllTests::suite()); - + return $suite; } } @@ -43,4 +43,3 @@ class Web_AllTests { if(PHPUnit_MAIN_METHOD == 'Web_AllTests::main') { Web_AllTests::main(); } -?> diff --git a/tests/unit/Web/TAssetManagerTest.php b/tests/unit/Web/TAssetManagerTest.php index 89349a0d..13d2d6c1 100644 --- a/tests/unit/Web/TAssetManagerTest.php +++ b/tests/unit/Web/TAssetManagerTest.php @@ -26,26 +26,26 @@ class TAssetManagerTest extends PHPUnit_Framework_TestCase { $_SERVER['REMOTE_ADDR'] = '127.0.0.1'; $_SERVER['HTTP_USER_AGENT'] = 'Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.1.3) Gecko/20070309 Firefox/2.0.0.3'; $_SERVER['REMOTE_HOST'] = 'localhost'; - + if (self::$app===null) { self::$app=new TApplication(dirname(__FILE__).'/app'); } - + if (self::$assetDir===null) self::$assetDir= dirname(__FILE__).'/assets'; - // Make asset directory if not exists + // Make asset directory if not exists if (!file_exists (self::$assetDir)) { - if (is_writable(dirname(self::$assetDir))) + if (is_writable(dirname(self::$assetDir))) mkdir (self::$assetDir) ; - else + else throw new Exception ('Directory '.dirname(self::$assetDir).' is not writable'); } elseif (!is_dir (self::$assetDir)) { throw new Exception (self::$assetDir.' exists and is not a directory'); } // Define an alias to asset directory prado::setPathofAlias('AssetAlias', self::$assetDir); - + } - + private function removeDirectory ($dir) { // Let's be sure $dir is a directory to avoir any error. Clear the cache ! clearstatcache(); @@ -53,7 +53,7 @@ class TAssetManagerTest extends PHPUnit_Framework_TestCase { foreach (scandir($dir) as $content) { if ($content==='.' or $content==='..') continue; // skip . and .. $content=$dir.'/'.$content; - if (is_dir($content)) + if (is_dir($content)) $this->removeDirectory ($content); // Recursivly remove directories else unlink ($content); // Remove file @@ -62,21 +62,21 @@ class TAssetManagerTest extends PHPUnit_Framework_TestCase { rmdir ($dir); } } - + public function tearDown () { // Make some cleaning :) - $this->removeDirectory(self::$assetDir); + $this->removeDirectory(self::$assetDir); } - + public function testInit() { - + $manager=new TAssetManager (); $manager->init (null); - + self::assertEquals(self::$assetDir, $manager->getBasePath()); self::assertEquals($manager, self::$app->getAssetManager()); - + // No, remove asset directory, and catch the exception if (is_dir(self::$assetDir)) $this->removeDirectory (self::$assetDir); try { @@ -92,12 +92,12 @@ class TAssetManagerTest extends PHPUnit_Framework_TestCase { $manager->setBasePath('invalid'); self::fail('Expected TInvalidDataValueException not thrown'); } catch (TInvalidDataValueException $e) {} - + // Next, standard asset directory, should work - + $manager->setBasePath ('AssetAlias'); self::assertEquals(self::$assetDir, $manager->getBasePath()); - + // Finally, test to change after init $manager->init (null); try { @@ -111,20 +111,20 @@ class TAssetManagerTest extends PHPUnit_Framework_TestCase { $manager=new TAssetManager (); $manager->setBaseUrl ('/assets/'); self::assertEquals("/assets", $manager->getBaseUrl()); - + $manager->init (null); try { $manager->setBaseUrl ('/test'); self::fail ('Expected TInvalidOperationException not thrown'); } catch (TInvalidOperationException $e) {} - + } public function testPublishFilePath() { $manager=new TAssetManager(); $manager->setBaseUrl('/'); $manager->init (null); - + // Try to publish a single file $fileToPublish=dirname(__FILE__).'/data/pradoheader.gif'; $publishedUrl = $manager->publishFilePath($fileToPublish); @@ -132,19 +132,19 @@ class TAssetManagerTest extends PHPUnit_Framework_TestCase { self::assertEquals($publishedFile, $manager->getPublishedPath($fileToPublish)); self::assertEquals($publishedUrl, $manager->getPublishedUrl($fileToPublish)); self::assertTrue(is_file($publishedFile)); - + // try to publish invalid file try { $manager->publishFilePath('invalid_file'); self::fail('Expected TInvalidDataValueException not thrown'); } catch (TInvalidDataValueException $e) {} } - + public function testPublishFilePathWithDirectory () { $manager=new TAssetManager(); $manager->setBaseUrl('/'); $manager->init (null); - + // Try to publish a directory $dirToPublish=dirname(__FILE__).'/data'; $publishedUrl = $manager->publishFilePath($dirToPublish); @@ -153,23 +153,23 @@ class TAssetManagerTest extends PHPUnit_Framework_TestCase { self::assertEquals($publishedUrl, $manager->getPublishedUrl($dirToPublish)); self::assertTrue(is_dir($publishedDir)); self::assertTrue(is_file($publishedDir.'/pradoheader.gif')); - + } public function testPublishTarFile() { $manager=new TAssetManager(); $manager->setBaseUrl('/'); $manager->init (null); - + $tarFile=dirname(__FILE__).'/data/aTarFile.tar'; $md5File=dirname(__FILE__).'/data/aTarFile.md5'; - + // First, try with bad md5 try { $manager->publishTarFile($tarFile, 'badMd5File'); self::fail('Expected TInvalidDataValueException not thrown'); } catch (TInvalidDataValueException $e) {} - + // Then, try with real md5 file $publishedUrl=$manager->publishTarFile($tarFile, $md5File); $publishedDir=self::$assetDir.$publishedUrl; @@ -178,5 +178,4 @@ class TAssetManagerTest extends PHPUnit_Framework_TestCase { self::assertTrue(is_file($publishedDir.'/aTarFile.md5')); } -} -?>
\ No newline at end of file +}
\ No newline at end of file diff --git a/tests/unit/Web/TCacheHttpSessionTest.php b/tests/unit/Web/TCacheHttpSessionTest.php index 15c2a382..8475cd37 100644 --- a/tests/unit/Web/TCacheHttpSessionTest.php +++ b/tests/unit/Web/TCacheHttpSessionTest.php @@ -11,14 +11,14 @@ class TCacheHttpSessionTest extends PHPUnit_Framework_TestCase protected $app = null; protected static $cache = null; protected static $session = null; - + protected function setUp() { if(!extension_loaded('memcache')) { self::markTestSkipped('The memcache extension is not available'); } - else + else { $basePath = dirname(__FILE__).'/app'; $runtimePath = $basePath.'/runtime'; @@ -33,14 +33,14 @@ class TCacheHttpSessionTest extends PHPUnit_Framework_TestCase $this->app->setModule('MyCache',self::$cache); } } - + protected function tearDown() { $this->app = null; $this->cache = null; $this->session = null; } - + public function testInit() { $session = new TCacheHttpSession(); @@ -53,7 +53,7 @@ class TCacheHttpSessionTest extends PHPUnit_Framework_TestCase { } unset($session); - + $session = new TCacheHttpSession(); try { @@ -66,12 +66,12 @@ class TCacheHttpSessionTest extends PHPUnit_Framework_TestCase { } unset($session); - + self::$session = new TCacheHttpSession(); try { self::$session->setCacheModuleID('MyCache'); - self::$session->init(null); + self::$session->init(null); } catch(TConfigurationException $e) { @@ -79,50 +79,49 @@ class TCacheHttpSessionTest extends PHPUnit_Framework_TestCase self::markTestSkipped('Cannot continue this test'); } } - + public function testGetCache() { $cache = self::$session->getCache(); $this->assertEquals(true, $cache instanceof TMemCache); } - + public function testCacheModuleID() { $id = 'value'; self::$session->setCacheModuleID($id); self::assertEquals($id, self::$session->getCacheModuleID()); } - + public function testKeyPrefix() { $id = 'value'; self::$session->setKeyPrefix($id); self::assertEquals($id, self::$session->getKeyPrefix()); } - + public function testSetAndGet() { self::$session['key'] = 'value'; self::assertEquals('value', self::$session['key']); } - + public function testAdd() { self::$session->add('anotherkey', 'value'); self::assertEquals('value', self::$session['anotherkey']); } - + public function testRemove() { self::$session->remove('key'); self::assertEquals(false, self::$session['key']); } - + public function testDestroyAndIsStarted() { $this->testSetAndGet(); self::$session->destroy(); self::assertEquals(false, self::$session->getIsStarted()); } -} -?>
\ No newline at end of file +}
\ No newline at end of file diff --git a/tests/unit/Web/THttpCookieCollectionTest.php b/tests/unit/Web/THttpCookieCollectionTest.php index 68ea8777..aa091788 100644 --- a/tests/unit/Web/THttpCookieCollectionTest.php +++ b/tests/unit/Web/THttpCookieCollectionTest.php @@ -28,7 +28,7 @@ class THttpCookieCollectionTest extends PHPUnit_Framework_TestCase { $coll->removeAt(0); self::fail('Invalid Value exception not raised'); } catch (TInvalidDataValueException $e) {} - + $coll->insertAt(0, new THttpCookie('name','value')); self::assertEquals('value',$coll->removeAt(0)->getValue()); } @@ -46,5 +46,4 @@ class THttpCookieCollectionTest extends PHPUnit_Framework_TestCase { self::assertEquals ('value', $coll->findCookieByName('name')->getValue()); self::assertNull ($coll->findCookieByName('invalid')); } -} -?>
\ No newline at end of file +}
\ No newline at end of file diff --git a/tests/unit/Web/THttpCookieTest.php b/tests/unit/Web/THttpCookieTest.php index 31d8e572..206ef105 100644 --- a/tests/unit/Web/THttpCookieTest.php +++ b/tests/unit/Web/THttpCookieTest.php @@ -49,5 +49,4 @@ class THttpCookieTest extends PHPUnit_Framework_TestCase { $cookie->setSecure(true); self::assertTrue($cookie->getSecure()); } -} -?>
\ No newline at end of file +}
\ No newline at end of file diff --git a/tests/unit/Web/THttpRequestTest.php b/tests/unit/Web/THttpRequestTest.php index 1807bbe2..7f5da17d 100644 --- a/tests/unit/Web/THttpRequestTest.php +++ b/tests/unit/Web/THttpRequestTest.php @@ -503,5 +503,4 @@ class THttpRequestTest extends PHPUnit_Framework_TestCase { $module->init ($config); self::assertEquals('testService', $request->resolveRequest(array ('page', 'testService'))); } -} -?>
\ No newline at end of file +}
\ No newline at end of file diff --git a/tests/unit/Web/THttpResponseTest.php b/tests/unit/Web/THttpResponseTest.php index dadbd768..0855bf4d 100644 --- a/tests/unit/Web/THttpResponseTest.php +++ b/tests/unit/Web/THttpResponseTest.php @@ -7,18 +7,18 @@ Prado::using('System.Web.THttpResponse'); * @package System.Web */ class THttpResponseTest extends PHPUnit_Framework_TestCase { - + public static $app=null; public function setUp () { if (self::$app===null) self::$app=new TApplication(dirname(__FILE__).'/app'); ob_start(); } - + public function tearDown () { ob_end_flush(); } - + public function testInit() { $response=new THttpResponse (); $response->init (null); @@ -43,7 +43,7 @@ class THttpResponseTest extends PHPUnit_Framework_TestCase { $response->setCacheControl('invalid'); self::fail ('Expected TInvalidDataValueException not thrown'); } catch (TInvalidDataValueException $e) {} - + } public function testSetContentType() { @@ -62,7 +62,7 @@ class THttpResponseTest extends PHPUnit_Framework_TestCase { self::assertEquals('UTF-8', $response->getCharset()); $response->setCharset ('ISO8859-1'); self::assertEquals('ISO8859-1', $response->getCharset()); - + } public function testSetBufferOutput() { @@ -101,17 +101,17 @@ class THttpResponseTest extends PHPUnit_Framework_TestCase { } public function testWriteFile() { - + // Don't know how to test headers :(( ... throw new PHPUnit_Framework_IncompleteTestError(); - + $response=new THttpResponse (); $response->setBufferOutput(true); // Suppress warning with headers $response->writeFile(dirname(__FILE__).'/data/aTarFile.md5', null, 'text/plain', array ('Pragma: public', 'Expires: 0')); - + self::assertContains('4b1ecb0b243918a8bbfbb4515937be98 aTarFile.tar', ob_get_clean()); - + } public function testRedirect() { @@ -157,5 +157,4 @@ class THttpResponseTest extends PHPUnit_Framework_TestCase { public function testCreateHtmlWriter() { throw new PHPUnit_Framework_IncompleteTestError(); } -} -?>
\ No newline at end of file +}
\ No newline at end of file diff --git a/tests/unit/Web/THttpSessionTest.php b/tests/unit/Web/THttpSessionTest.php index 7de0f8a5..aca83077 100644 --- a/tests/unit/Web/THttpSessionTest.php +++ b/tests/unit/Web/THttpSessionTest.php @@ -110,5 +110,4 @@ class THttpSessionTest extends PHPUnit_Framework_TestCase { public function testOffsetUnset() { throw new PHPUnit_Framework_IncompleteTestError(); } -} -?>
\ No newline at end of file +}
\ No newline at end of file diff --git a/tests/unit/Web/THttpUtilityTest.php b/tests/unit/Web/THttpUtilityTest.php index 85fcf7f4..7f4e6705 100644 --- a/tests/unit/Web/THttpUtilityTest.php +++ b/tests/unit/Web/THttpUtilityTest.php @@ -18,5 +18,4 @@ class THttpUtilityTest extends PHPUnit_Framework_TestCase { $html = THttpUtility::htmlDecode('<tag key="value">'); self::assertEquals('<tag key="value">', $html); } -} -?>
\ No newline at end of file +}
\ No newline at end of file diff --git a/tests/unit/Web/TUriTest.php b/tests/unit/Web/TUriTest.php index a8c65b9e..b610cd1b 100644 --- a/tests/unit/Web/TUriTest.php +++ b/tests/unit/Web/TUriTest.php @@ -6,17 +6,17 @@ Prado::using('System.Web.THttpRequest'); * @package System.Web */ class TUriTest extends PHPUnit_Framework_TestCase { - + const URISTR='http://login:p@ssw0rd:compl3x@www.pradosoft.com:80/demos/quickstart/index.php?page=test¶m1=test2#anchor'; - + public function setUp () { $this->uri=new TUri(self::URISTR); } - + public function tearDown() { $this->uri=null; } - + public function testConstruct() { $url="http://www.pradosoft.com/"; $uri=new TUri ($url); @@ -27,7 +27,7 @@ class TUriTest extends PHPUnit_Framework_TestCase { $url=new TUri($url); self::fail ('exception not raised with an invalid URL'); } catch (TInvalidDataValueException $e) { - + } } @@ -66,5 +66,4 @@ class TUriTest extends PHPUnit_Framework_TestCase { public function testGetFragment() { self::assertEquals('anchor', $this->uri->getFragment()); } -} -?>
\ No newline at end of file +}
\ No newline at end of file diff --git a/tests/unit/Web/UI/ActiveControls/AllTests.php b/tests/unit/Web/UI/ActiveControls/AllTests.php index ef2dfb91..68989996 100644 --- a/tests/unit/Web/UI/ActiveControls/AllTests.php +++ b/tests/unit/Web/UI/ActiveControls/AllTests.php @@ -11,11 +11,11 @@ class Web_UI_ActiveControls_AllTests { public static function main() { PHPUnit_TextUI_TestRunner::run(self::suite()); } - + public static function suite() { $suite = new PHPUnit_Framework_TestSuite('System.Web.UI.ActiveControls'); - - $suite->addTestSuite('TActiveHiddenFieldTest'); + + $suite->addTestSuite('TActiveHiddenFieldTest'); return $suite; } } @@ -23,4 +23,3 @@ class Web_UI_ActiveControls_AllTests { if(PHPUnit_MAIN_METHOD == 'Web_UI_ActiveControls_AllTests::main') { Web_UI_ActiveControls_AllTests::main(); } -?> diff --git a/tests/unit/Web/UI/ActiveControls/TActiveHiddenFieldTest.php b/tests/unit/Web/UI/ActiveControls/TActiveHiddenFieldTest.php index 58821747..6e80bd12 100644 --- a/tests/unit/Web/UI/ActiveControls/TActiveHiddenFieldTest.php +++ b/tests/unit/Web/UI/ActiveControls/TActiveHiddenFieldTest.php @@ -14,5 +14,3 @@ class TActiveHiddenFieldTest extends PHPUnit_Framework_TestCase { $this->assertEquals('Test', $field->getValue()); } } - -?>
\ No newline at end of file diff --git a/tests/unit/Web/UI/AllTests.php b/tests/unit/Web/UI/AllTests.php index 71b088e4..6885c337 100644 --- a/tests/unit/Web/UI/AllTests.php +++ b/tests/unit/Web/UI/AllTests.php @@ -23,10 +23,10 @@ class Web_UI_AllTests { public static function main() { PHPUnit_TextUI_TestRunner::run(self::suite()); } - + public static function suite() { $suite = new PHPUnit_Framework_TestSuite('System.Web.UI'); - + $suite->addTestSuite('TClientScriptManagerTest'); $suite->addTestSuite('TControlAdapterTest'); $suite->addTestSuite('TControlTest'); @@ -40,7 +40,7 @@ class Web_UI_AllTests { $suite->addTestSuite('THtmlWriterTest'); $suite->addTestSuite('TPageStatePersisterTest'); $suite->addTestSuite('TSessionPageStatePersisterTest'); - + return $suite; } } @@ -48,4 +48,3 @@ class Web_UI_AllTests { if(PHPUnit_MAIN_METHOD == 'Web_UI_AllTests::main') { Web_UI_AllTests::main(); } -?> diff --git a/tests/unit/Web/UI/TClientScriptManagerTest.php b/tests/unit/Web/UI/TClientScriptManagerTest.php index ea360f91..efce0009 100644 --- a/tests/unit/Web/UI/TClientScriptManagerTest.php +++ b/tests/unit/Web/UI/TClientScriptManagerTest.php @@ -144,5 +144,4 @@ class TClientScriptManagerTest extends PHPUnit_Framework_TestCase { throw new PHPUnit_Framework_IncompleteTestError(); } -} -?>
\ No newline at end of file +}
\ No newline at end of file diff --git a/tests/unit/Web/UI/TControlAdapterTest.php b/tests/unit/Web/UI/TControlAdapterTest.php index 2a173fd8..ff687cc8 100644 --- a/tests/unit/Web/UI/TControlAdapterTest.php +++ b/tests/unit/Web/UI/TControlAdapterTest.php @@ -15,46 +15,45 @@ class TControlAdapterTest extends PHPUnit_Framework_TestCase { public function testGetControl() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testGetPage() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testCreateChildControls() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testLoadState() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testSaveState() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testOnInit() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testOnLoad() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testOnPreRender() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testOnUnload() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testRender() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testRenderChildren() { throw new PHPUnit_Framework_IncompleteTestError(); } -} -?>
\ No newline at end of file +}
\ No newline at end of file diff --git a/tests/unit/Web/UI/TControlTest.php b/tests/unit/Web/UI/TControlTest.php index 670926be..b6741167 100644 --- a/tests/unit/Web/UI/TControlTest.php +++ b/tests/unit/Web/UI/TControlTest.php @@ -15,266 +15,265 @@ class TControlTest extends PHPUnit_Framework_TestCase { public function test__get() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testGetHasAdapter() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testSetAndGetAdapter() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testGetParent() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testGetNamingContainer() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testSetAndGetPage() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testSetAndGetTemplateControl() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testGetSourceTemplateControl() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testSetAndGetControlStage() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testSetAndGetID() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testGetUniqueID() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testFocus() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testGetClientID() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testSetAndGetSkinID() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testSetAndGetEnableTheming() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testSetAndGetCustomData() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testGetHasControls() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testGetControls() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testSetAndGetVisible() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testSetAndGetEnabled() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testGetHasAttributes() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testGetAttributes() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testHasAttribute() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testSetAndGetAttribute() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testRemoveAttribute() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testSetAndGetEnableViewState() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testSetAndGetControlState() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testTrackViewState() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testSetAndGetViewState() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testClearViewState() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testBindProperty() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testUnbindProperty() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testAutoBindProperty() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testDataBind() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testEnsureChildControls() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testCreateChildControls() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testFindControl() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testFindControlsByType() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testFindControlsByID() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testClearNamingContainer() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testRegisterObject() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testUnregisterObject() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testIsObjectRegistered() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testGetHasChildInitialized() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testGetHasInitialized() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testGetHasLoadedPostData() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testGetHasLoaded() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testGetHasPreRendered() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testGetRegisteredObject() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testGetAllowChildControls() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testAddParsedObject() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testAddedControl() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testRemovedControl() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testOnInit() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testOnLoad() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testOnDataBinding() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testOnUnload() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testOnPreRender() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testBubbleEvent() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testBroadcastEvent() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testRenderControl() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testRender() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testRenderChildren() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testSaveState() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testLoadState() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testApplyStyleSheetSkin() { throw new PHPUnit_Framework_IncompleteTestError(); } -} -?>
\ No newline at end of file +}
\ No newline at end of file diff --git a/tests/unit/Web/UI/TFormTest.php b/tests/unit/Web/UI/TFormTest.php index 74cbdb59..7fb6d2b7 100644 --- a/tests/unit/Web/UI/TFormTest.php +++ b/tests/unit/Web/UI/TFormTest.php @@ -15,22 +15,21 @@ class TFormTest extends PHPUnit_Framework_TestCase { public function testRender() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testSetAndGetDefaultButton() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testSetAndGetMethod() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testSetAndGetEnctype() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testGetName() { throw new PHPUnit_Framework_IncompleteTestError(); } -} -?>
\ No newline at end of file +}
\ No newline at end of file diff --git a/tests/unit/Web/UI/THtmlWriterTest.php b/tests/unit/Web/UI/THtmlWriterTest.php index 080e2e26..cf3b27e3 100644 --- a/tests/unit/Web/UI/THtmlWriterTest.php +++ b/tests/unit/Web/UI/THtmlWriterTest.php @@ -31,7 +31,7 @@ class TestWriter extends TComponent implements ITextWriter { $this->write($str."\n"); } - + // Accessors to get value of private vars during tests public function getFlushedContent() { return $this->_flushedContent; } public function getStr() { return $this->_str; } @@ -77,7 +77,7 @@ class THtmlWriterTest extends PHPUnit_Framework_TestCase { $writer->addAttribute('value','Prado & Cie'); $result=self::readAttribute($writer, '_attributes'); self::assertEquals('text',$result['type']); - self::assertEquals(THttpUtility::htmlEncode('Prado & Cie'), $result['value']); + self::assertEquals(THttpUtility::htmlEncode('Prado & Cie'), $result['value']); } public function testRemoveAttribute() { @@ -129,21 +129,21 @@ class THtmlWriterTest extends PHPUnit_Framework_TestCase { $writer=new THtmlWriter(self::$output); $writer->write('Some Text');; self::assertEquals('Some Text', self::$output->flush()); - + } public function testWriteLine() { $writer=new THtmlWriter(self::$output); $writer->writeLine('Some Text');; self::assertEquals("Some Text\n", self::$output->flush()); - + } public function testWriteBreak() { $writer=new THtmlWriter(self::$output); $writer->writeBreak(); self::assertEquals("<br/>", self::$output->flush()); - + } public function testRenderBeginTag() { @@ -163,5 +163,4 @@ class THtmlWriterTest extends PHPUnit_Framework_TestCase { self::assertEquals('<div>Div Content</div>', self::$output->flush()); } -} -?>
\ No newline at end of file +}
\ No newline at end of file diff --git a/tests/unit/Web/UI/TPageStatePersisterTest.php b/tests/unit/Web/UI/TPageStatePersisterTest.php index 2734b142..8ee1cfc9 100644 --- a/tests/unit/Web/UI/TPageStatePersisterTest.php +++ b/tests/unit/Web/UI/TPageStatePersisterTest.php @@ -7,18 +7,17 @@ Prado::using('System.Web.UI.TPageStatePersister'); * @package System.Web.UI */ class TPageStatePersisterTest extends PHPUnit_Framework_TestCase { - + public function testSetAndGetPage() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testSave() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testLoad() { throw new PHPUnit_Framework_IncompleteTestError(); } -} -?>
\ No newline at end of file +}
\ No newline at end of file diff --git a/tests/unit/Web/UI/TPageTest.php b/tests/unit/Web/UI/TPageTest.php index d6f689e9..c1593816 100644 --- a/tests/unit/Web/UI/TPageTest.php +++ b/tests/unit/Web/UI/TPageTest.php @@ -15,181 +15,172 @@ class TPageTest extends PHPUnit_Framework_TestCase { public function testRun() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testSetAndGetCallbackClient() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testSetAndGetCallbackEventTarget() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testSetAndGetCallbackEventParameter() { throw new PHPUnit_Framework_IncompleteTestError(); } - - public function testRegisterPostDataLoader() { - throw new PHPUnit_Framework_IncompleteTestError(); - } - - public function testGetPostDataLoaders() { - throw new PHPUnit_Framework_IncompleteTestError(); - } - + public function testSetAndGetForm() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testGetValidators() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testValidate() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testGetIsValid() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testSetAndGetTheme() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testSetAndGetStyleSheetTheme() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testApplyControlSkin() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testApplyControlStyleSheet() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testGetClientScript() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testOnPreInit() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testOnInitComplete() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testOnPreLoad() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testOnLoadComplete() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testOnPreRenderComplete() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testOnSaveStateComplete() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testGetIsPostBack() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testGetIsCallback() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testSaveState() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testLoadState() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testRegisterRequiresPostData() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testSetAndGetPostBackEventTarget() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testSetAndGetPostBackEventParameter() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testGetIsLoadingPostData() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testEnsureRenderInForm() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testBeginFormRender() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testEndFormRender() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testSetFocus() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testGetClientSupportsJavaScript() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testSetAndGetHead() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testSetAndGetTitle() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testSetAndGetClientState() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testGetRequestClientState() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testSetAndGetStatePersisterClass() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testGetStatePersister() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testSetAndGetEnableStateValidation() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testSetAndGetEnableStateEncryption() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testSetAndGetPagePath() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testRegisterCachingAction() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testGetCachingStack() { throw new PHPUnit_Framework_IncompleteTestError(); } -} -?>
\ No newline at end of file +}
\ No newline at end of file diff --git a/tests/unit/Web/UI/TSessionPageStatePersisterTest.php b/tests/unit/Web/UI/TSessionPageStatePersisterTest.php index b8758b30..9153ad42 100644 --- a/tests/unit/Web/UI/TSessionPageStatePersisterTest.php +++ b/tests/unit/Web/UI/TSessionPageStatePersisterTest.php @@ -7,22 +7,21 @@ Prado::using('System.Web.UI.TSessionPageStatePersister'); * @package System.Web.UI */ class TSessionPageStatePersisterTest extends PHPUnit_Framework_TestCase { - + public function testSetAndGetPage() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testSetAndGetHistorySize() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testSave() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testLoad() { throw new PHPUnit_Framework_IncompleteTestError(); } -} -?>
\ No newline at end of file +}
\ No newline at end of file diff --git a/tests/unit/Web/UI/TTemplateControlTest.php b/tests/unit/Web/UI/TTemplateControlTest.php index 97ea8c1d..7276a2b0 100644 --- a/tests/unit/Web/UI/TTemplateControlTest.php +++ b/tests/unit/Web/UI/TTemplateControlTest.php @@ -15,34 +15,33 @@ class TTemplateControlTest extends PHPUnit_Framework_TestCase { public function testGetIsSourceTemplateControl() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testGetTemplateDirectory() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testCreateChildControls() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testRegisterContent() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testRegisterContentPlaceHolder() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testSetAndGetMasterClass() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testGetMaster() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testInjectContent() { throw new PHPUnit_Framework_IncompleteTestError(); } -} -?>
\ No newline at end of file +}
\ No newline at end of file diff --git a/tests/unit/Web/UI/TTemplateManagerTest.php b/tests/unit/Web/UI/TTemplateManagerTest.php index 46c17538..dfe452bf 100644 --- a/tests/unit/Web/UI/TTemplateManagerTest.php +++ b/tests/unit/Web/UI/TTemplateManagerTest.php @@ -7,18 +7,17 @@ Prado::using('System.Web.UI.TTemplateManager'); * @package System.Web.UI */ class TTemplateManagerTest extends PHPUnit_Framework_TestCase { - + public function testInit() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testGetTemplateByClassName() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testGetTemplateByFileName() { throw new PHPUnit_Framework_IncompleteTestError(); } - -} -?>
\ No newline at end of file + +}
\ No newline at end of file diff --git a/tests/unit/Web/UI/TTemplateTest.php b/tests/unit/Web/UI/TTemplateTest.php index 2bb6599b..2d802094 100644 --- a/tests/unit/Web/UI/TTemplateTest.php +++ b/tests/unit/Web/UI/TTemplateTest.php @@ -7,42 +7,41 @@ Prado::using('System.Web.UI.TTemplateManager'); * @package System.Web.UI */ class TTemplateTest extends PHPUnit_Framework_TestCase { - + public function testConstruct() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testGetTemplateFile() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testGetIsSourceTemplate() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testGetContextPath() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testGetDirective() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testGetHashCode() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testGetItems() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testInstantiateIn() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testGetIncludedFiles() { throw new PHPUnit_Framework_IncompleteTestError(); } - -} -?>
\ No newline at end of file + +}
\ No newline at end of file diff --git a/tests/unit/Web/UI/TThemeManagerTest.php b/tests/unit/Web/UI/TThemeManagerTest.php index 1a514d2b..028b222a 100644 --- a/tests/unit/Web/UI/TThemeManagerTest.php +++ b/tests/unit/Web/UI/TThemeManagerTest.php @@ -7,26 +7,25 @@ Prado::using('System.Web.UI.TThemeManager'); * @package System.Web.UI */ class TThemeManagerTest extends PHPUnit_Framework_TestCase { - + public function testInit() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testGetTheme() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testGetAvailableThemes() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testSetAndGetBasePath() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testSetAndGetBaseUrl() { throw new PHPUnit_Framework_IncompleteTestError(); } -} -?>
\ No newline at end of file +}
\ No newline at end of file diff --git a/tests/unit/Web/UI/TThemeTest.php b/tests/unit/Web/UI/TThemeTest.php index e7fa376d..aeeeee65 100644 --- a/tests/unit/Web/UI/TThemeTest.php +++ b/tests/unit/Web/UI/TThemeTest.php @@ -7,34 +7,33 @@ Prado::using('System.Web.UI.TThemeManager'); * @package System.Web.UI */ class TThemeTest extends PHPUnit_Framework_TestCase { - + public function testConstruct() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testGetName() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testGetBaseUrl() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testGetBasePath() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testApplySkin() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testGetStyleSheetFiles() { throw new PHPUnit_Framework_IncompleteTestError(); } - + public function testGetJavaScriptFiles() { throw new PHPUnit_Framework_IncompleteTestError(); } -} -?>
\ No newline at end of file +}
\ No newline at end of file diff --git a/tests/unit/Web/UI/WebControls/AllTests.php b/tests/unit/Web/UI/WebControls/AllTests.php index 7d0b1632..5ffa45a2 100644 --- a/tests/unit/Web/UI/WebControls/AllTests.php +++ b/tests/unit/Web/UI/WebControls/AllTests.php @@ -14,15 +14,15 @@ class Web_UI_WebControls_AllTests { public static function main() { PHPUnit_TextUI_TestRunner::run(self::suite()); } - + public static function suite() { $suite = new PHPUnit_Framework_TestSuite('System.Web.UI.WebControls'); - + $suite->addTestSuite('TDropDownListTest'); $suite->addTestSuite('TLabelTest'); $suite->addTestSuite('TRequiredFieldValidatorTest'); $suite->addTestSuite('TXmlTransformTest'); - + return $suite; } } @@ -30,4 +30,3 @@ class Web_UI_WebControls_AllTests { if(PHPUnit_MAIN_METHOD == 'Web_UI_WebControls_AllTests::main') { Web_UI_WebControls_AllTests::main(); } -?> diff --git a/tests/unit/Web/UI/WebControls/TDropDownListTest.php b/tests/unit/Web/UI/WebControls/TDropDownListTest.php index 503466fe..d27ebb9c 100644 --- a/tests/unit/Web/UI/WebControls/TDropDownListTest.php +++ b/tests/unit/Web/UI/WebControls/TDropDownListTest.php @@ -27,4 +27,3 @@ class TDropDownListTest extends PHPUnit_Framework_TestCase { } } -?> diff --git a/tests/unit/Web/UI/WebControls/TLabelTest.php b/tests/unit/Web/UI/WebControls/TLabelTest.php index 0e5577d5..88d8aec8 100644 --- a/tests/unit/Web/UI/WebControls/TLabelTest.php +++ b/tests/unit/Web/UI/WebControls/TLabelTest.php @@ -15,5 +15,3 @@ class TLabelTest extends PHPUnit_Framework_TestCase { $this->assertEquals('Test', $label->getText()); } } - -?>
\ No newline at end of file diff --git a/tests/unit/Web/UI/WebControls/TRequiredFieldValidatorTest.php b/tests/unit/Web/UI/WebControls/TRequiredFieldValidatorTest.php index 894c3899..43ed2c9d 100644 --- a/tests/unit/Web/UI/WebControls/TRequiredFieldValidatorTest.php +++ b/tests/unit/Web/UI/WebControls/TRequiredFieldValidatorTest.php @@ -19,5 +19,3 @@ class TRequiredFieldValidatorTest extends PHPUnit_Framework_TestCase { $this->assertEquals('', $value); } } - -?>
\ No newline at end of file diff --git a/tests/unit/Web/UI/WebControls/TXmlTransformTest.php b/tests/unit/Web/UI/WebControls/TXmlTransformTest.php index 6c6d9456..f93e9897 100644 --- a/tests/unit/Web/UI/WebControls/TXmlTransformTest.php +++ b/tests/unit/Web/UI/WebControls/TXmlTransformTest.php @@ -51,7 +51,7 @@ class TXmlTransformTest extends PHPUnit_Framework_TestCase { $transform->setTransformContent($expected); $this->assertEquals($expected, $transform->getTransformContent()); } - + public function testSetTransformPathAsFile() { $expected = $this->transformPath; $transform = new TXmlTransform(); @@ -120,10 +120,9 @@ class TXmlTransformTest extends PHPUnit_Framework_TestCase { $actual = $textWriter->flush(); self::assertEquals($expected, $actual); } - + public function testRenderWithBodyAsDocumentAndTransformPath() { throw new PHPUnit_Framework_IncompleteTestError(); } } -?> diff --git a/tests/unit/Xml/AllTests.php b/tests/unit/Xml/AllTests.php index d934786b..afb4c7a8 100644 --- a/tests/unit/Xml/AllTests.php +++ b/tests/unit/Xml/AllTests.php @@ -12,14 +12,14 @@ class Xml_AllTests { public static function main() { PHPUnit_TextUI_TestRunner::run(self::suite()); } - + public static function suite() { $suite = new PHPUnit_Framework_TestSuite('System.Xml'); - + $suite->addTestSuite('TXmlDocumentTest'); $suite->addTestSuite('TXmlElementTest'); $suite->addTestSuite('TXmlElementListTest'); - + return $suite; } } @@ -27,4 +27,3 @@ class Xml_AllTests { if(PHPUnit_MAIN_METHOD == 'Xml_AllTests::main') { Xml_AllTests::main(); } -?> diff --git a/tests/unit/Xml/TXmlDocumentTest.php b/tests/unit/Xml/TXmlDocumentTest.php index 2ab95641..54e4b5aa 100644 --- a/tests/unit/Xml/TXmlDocumentTest.php +++ b/tests/unit/Xml/TXmlDocumentTest.php @@ -34,7 +34,7 @@ class TXmlDocumentTest extends PHPUnit_Framework_TestCase { $xmldoc->loadFromFile('unexistentXmlFile.xml'); self::fail('Expected TIOException not thrown'); } catch (TIOException $e) {} - + self::assertTrue($xmldoc->loadFromFile($file)); self::assertEquals('1.0', $xmldoc->getVersion()); self::assertEquals('UTF-8',$xmldoc->getEncoding()); @@ -61,9 +61,9 @@ class TXmlDocumentTest extends PHPUnit_Framework_TestCase { // Result string should be : $resultString="<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<root>\n <node param=\"attribute1\"\n</root>"; self::assertEquals($xmlString, $magicString); - + } - + public function testSaveToFile() { $file=dirname(__FILE__).'/data/tmp.xml'; if (!is_writable(dirname($file))) self::markTestSkipped(dirname($file).' must be writable for this test'); @@ -77,4 +77,3 @@ class TXmlDocumentTest extends PHPUnit_Framework_TestCase { if (is_file($file)) unlink ($file); } } -?> diff --git a/tests/unit/Xml/TXmlElementListTest.php b/tests/unit/Xml/TXmlElementListTest.php index b124dfbe..7667c64d 100644 --- a/tests/unit/Xml/TXmlElementListTest.php +++ b/tests/unit/Xml/TXmlElementListTest.php @@ -23,7 +23,7 @@ class TXmlElementListTest extends PHPUnit_Framework_TestCase { $newElement=new TXmlElement('newTag'); $list->insertAt(0,$newElement); self::assertEquals($newElement,$list->itemAt(0)); - + } public function testRemoveAt() { @@ -34,4 +34,3 @@ class TXmlElementListTest extends PHPUnit_Framework_TestCase { self::assertEquals($newElement,$list->removeAt(0)); } } -?> diff --git a/tests/unit/Xml/TXmlElementTest.php b/tests/unit/Xml/TXmlElementTest.php index d7b86832..49cae36f 100644 --- a/tests/unit/Xml/TXmlElementTest.php +++ b/tests/unit/Xml/TXmlElementTest.php @@ -7,7 +7,7 @@ Prado::using('System.Xml.TXmlDocument'); */ class TXmlElementTest extends PHPUnit_Framework_TestCase { - public function setUp() { + public function setUp() { } public function testConstruct() { @@ -80,4 +80,3 @@ class TXmlElementTest extends PHPUnit_Framework_TestCase { self::assertEquals('<tag key="value">value</tag>', (string)$element); } } -?> |