diff options
author | Fabio Bas <ctrlaltca@gmail.com> | 2014-02-10 09:41:31 +0100 |
---|---|---|
committer | Fabio Bas <ctrlaltca@gmail.com> | 2014-02-10 09:41:31 +0100 |
commit | f35d43399a9ce03f08ffa326812bc5ed6764ef9e (patch) | |
tree | a27b36d48835f584b10bb8fc5132309da1337c81 | |
parent | 20dee7ffd329bb595c56b592c30b269b226fea5c (diff) |
Ported some tests to jQuery
6 files changed, 31 insertions, 30 deletions
diff --git a/demos/quickstart/protected/pages/GettingStarted/Upgrading32.page b/demos/quickstart/protected/pages/GettingStarted/Upgrading32.page index 4417c668..4124e59e 100644 --- a/demos/quickstart/protected/pages/GettingStarted/Upgrading32.page +++ b/demos/quickstart/protected/pages/GettingStarted/Upgrading32.page @@ -149,6 +149,11 @@ The number one rule on writing jQuery javascript code is to read the <a href="ht </td> </tr> <tr> + <td>Change element contents</td> + <td>$('div1').innerHTML='new content'</td> + <td>$('#div1').html('new content')</td> + </tr> + <tr> <td>Hook on ajax events</td> <td>Ajax.Responders.register({ <br/>"onLoading" : my_function diff --git a/tests/FunctionalTests/active-controls/protected/pages/NestedActiveControls.page b/tests/FunctionalTests/active-controls/protected/pages/NestedActiveControls.page index a7875c0d..7551336d 100755 --- a/tests/FunctionalTests/active-controls/protected/pages/NestedActiveControls.page +++ b/tests/FunctionalTests/active-controls/protected/pages/NestedActiveControls.page @@ -14,14 +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:TClientScript> + jQuery( document ).ready(function() { + jQuery("#div1").click(function() { + Prado.Callback("<%= $this->callback1->UniqueID %>"); + }); + }); + </com:TClientScript> </com:TForm> diff --git a/tests/FunctionalTests/active-controls/protected/pages/PostLoadingTest.page b/tests/FunctionalTests/active-controls/protected/pages/PostLoadingTest.page index 885b368f..9ae1dca2 100755 --- a/tests/FunctionalTests/active-controls/protected/pages/PostLoadingTest.page +++ b/tests/FunctionalTests/active-controls/protected/pages/PostLoadingTest.page @@ -8,15 +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:TClientScript>
+ jQuery( document ).ready(function() {
+ jQuery("#div1").click(function() {
+ Prado.Callback("<%= $this->callback1->UniqueID %>");
+ });
+ });
+ </com:TClientScript>
</com:TForm>
\ No newline at end of file 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/test_tools/phpunit_bootstrap.php b/tests/test_tools/phpunit_bootstrap.php index 23e25a1c..4357f99f 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 |