Development

Changeset 8840

You must first sign up to be able to contribute.

Changeset 8840

Show
Ignore:
Timestamp:
05/07/08 19:04:40 (5 months ago)
Author:
FabianLange
Message:

some additional unit tests for button_to. refs #3184

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/1.1/test/unit/helper/UrlHelperTest.php

    r8837 r8840  
    2020} 
    2121 
    22 $t = new lime_test(29, new lime_output_color()); 
     22$t = new lime_test(32, new lime_output_color()); 
    2323 
    2424$context = sfContext::getInstance(array('controller' => 'myController')); 
     
    4747$t->is(button_to('test','', array('query_string' => 'foo=bar')), '<input value="test" type="button" onclick="document.location.href=\'module/action?foo=bar\';" />', 'button_to() returns an HTML "input" tag'); 
    4848$t->is(button_to('test','', array('popup' => 'true', 'query_string' => 'foo=bar')), '<input value="test" type="button" onclick="var w=window.open(\'module/action?foo=bar\');w.focus();return false;" />', 'button_to() returns an HTML "input" tag'); 
     49$t->is(button_to('test','', 'popup=true'), '<input value="test" type="button" onclick="var w=window.open(\'module/action\');w.focus();return false;" />', 'button_to() accepts options as string'); 
     50$t->is(button_to('test','', 'confirm=really?'), '<input value="test" type="button" onclick="if (confirm(\'really?\')) { return document.location.href=\'module/action\';} else return false;" />', 'button_to() works with confirm option'); 
     51$t->is(button_to('test','', 'popup=true confirm=really?'), '<input value="test" type="button" onclick="if (confirm(\'really?\')) { var w=window.open(\'module/action\');w.focus(); };return false;" />', 'button_to() works with confirm and popup option'); 
    4952 
    5053class testObject