Permalink
Browse files

Fixing tests for php4 compat.

  • Loading branch information...
1 parent 34f67cc commit c6c7630d8ff89f2e0f2eb028a4e8a3944d91c852 @markstory markstory committed Apr 7, 2009
@@ -68,15 +68,16 @@ function testSelector() {
* @return void
**/
function testEvent() {
- $result = $this->Jquery->get('#myLink')->event('click', 'doClick', array('wrap' => false));
+ $this->Jquery->get('#myLink');
+ $result = $this->Jquery->event('click', 'doClick', array('wrap' => false));
$expected = '$("#myLink").bind("click", doClick);';
$this->assertEqual($result, $expected);
- $result = $this->Jquery->get('#myLink')->event('click', '$(this).show();', array('stop' => false));
+ $result = $this->Jquery->event('click', '$(this).show();', array('stop' => false));
$expected = '$("#myLink").bind("click", function (event) {$(this).show();});';
$this->assertEqual($result, $expected);
- $result = $this->Jquery->get('#myLink')->event('click', '$(this).hide();');
+ $result = $this->Jquery->event('click', '$(this).hide();');
$expected = '$("#myLink").bind("click", function (event) {$(this).hide();'."\n".'return false;});';
$this->assertEqual($result, $expected);
}
@@ -96,7 +97,8 @@ function testDomReady() {
* @return void
**/
function testEach() {
- $result = $this->Jquery->get('#foo')->each('$(this).hide();');
+ $this->Jquery->get('#foo');
+ $result = $this->Jquery->each('$(this).hide();');
$expected = '$("#foo").each(function () {$(this).hide();});';
$this->assertEqual($result, $expected);
}
@@ -106,7 +108,8 @@ function testEach() {
* @return void
**/
function testEffect() {
- $result = $this->Jquery->get('#foo')->effect('show');
+ $this->Jquery->get('#foo');
+ $result = $this->Jquery->effect('show');
$expected = '$("#foo").show();';
$this->assertEqual($result, $expected);
@@ -170,7 +173,8 @@ function testRequest() {
* @return void
**/
function testSortable() {
- $result = $this->Jquery->get('#myList')->sortable(array(
+ $this->Jquery->get('#myList');
+ $result = $this->Jquery->sortable(array(
'distance' => 5,
'containment' => 'parent',
'start' => 'onStart',
@@ -76,15 +76,16 @@ function testSelector() {
* @return void
**/
function testEvent() {
- $result = $this->Moo->get('#myLink')->event('click', 'doClick', array('wrap' => false));
+ $this->Moo->get('#myLink');
+ $result = $this->Moo->event('click', 'doClick', array('wrap' => false));
$expected = '$("myLink").addEvent("click", doClick);';
$this->assertEqual($result, $expected);
- $result = $this->Moo->get('#myLink')->event('click', 'this.setStyle("display", "");', array('stop' => false));
+ $result = $this->Moo->event('click', 'this.setStyle("display", "");', array('stop' => false));
$expected = '$("myLink").addEvent("click", function (event) {this.setStyle("display", "");});';
$this->assertEqual($result, $expected);
- $result = $this->Moo->get('#myLink')->event('click', 'this.setStyle("display", "none");');
+ $result = $this->Moo->event('click', 'this.setStyle("display", "none");');
$expected = "\$(\"myLink\").addEvent(\"click\", function (event) {event.stop();\nthis.setStyle(\"display\", \"none\");});";
$this->assertEqual($result, $expected);
}
@@ -104,7 +105,8 @@ function testDomReady() {
* @return void
**/
function testEach() {
- $result = $this->Moo->get('#foo')->each('item.setStyle("display", "none");');
+ $this->Moo->get('#foo');
+ $result = $this->Moo->each('item.setStyle("display", "none");');
$expected = '$("foo").each(function (item, index) {item.setStyle("display", "none");});';
$this->assertEqual($result, $expected);
}
@@ -114,7 +116,8 @@ function testEach() {
* @return void
**/
function testEffect() {
- $result = $this->Moo->get('#foo')->effect('show');
+ $this->Moo->get('#foo');
+ $result = $this->Moo->effect('show');
$expected = '$("foo").setStyle("display", "");';
$this->assertEqual($result, $expected);
@@ -196,7 +199,8 @@ function testRequest() {
* @return void
**/
function testSortable() {
- $result = $this->Moo->get('#myList')->sortable(array(
+ $this->Moo->get('#myList');
+ $result = $this->Moo->sortable(array(
'distance' => 5,
'containment' => 'parent',
'start' => 'onStart',
@@ -76,15 +76,16 @@ function testSelector() {
* @return void
**/
function testEvent() {
- $result = $this->Proto->get('#myLink')->event('click', 'doClick', array('wrap' => false));
+ $this->Proto->get('#myLink');
+ $result = $this->Proto->event('click', 'doClick', array('wrap' => false));
$expected = '$("myLink").observe("click", doClick);';
$this->assertEqual($result, $expected);
- $result = $this->Proto->get('#myLink')->event('click', 'Element.hide(this);', array('stop' => false));
+ $result = $this->Proto->event('click', 'Element.hide(this);', array('stop' => false));
$expected = '$("myLink").observe("click", function (event) {Element.hide(this);});';
$this->assertEqual($result, $expected);
- $result = $this->Proto->get('#myLink')->event('click', 'Element.hide(this);');
+ $result = $this->Proto->event('click', 'Element.hide(this);');
$expected = "\$(\"myLink\").observe(\"click\", function (event) {event.stop();\nElement.hide(this);});";
$this->assertEqual($result, $expected);
}
@@ -104,7 +105,8 @@ function testDomReady() {
* @return void
**/
function testEach() {
- $result = $this->Proto->get('#foo li')->each('item.hide();');
+ $this->Proto->get('#foo li');
+ $result = $this->Proto->each('item.hide();');
$expected = '$$("#foo li").each(function (item, index) {item.hide();});';
$this->assertEqual($result, $expected);
}

0 comments on commit c6c7630

Please sign in to comment.