Development

Changeset 8839

You must first sign up to be able to contribute.

Changeset 8839

Show
Ignore:
Timestamp:
05/07/08 19:04:24 (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.0/test/unit/helper/UrlHelperTest.php

    r8836 r8839  
    4343} 
    4444 
    45 $t = new lime_test(29, new lime_output_color()); 
     45$t = new lime_test(32, new lime_output_color()); 
    4646 
    4747$context = sfContext::getInstance(); 
     
    6767$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'); 
    6868$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'); 
     69$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'); 
     70$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'); 
     71$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'); 
    6972 
    7073class testObject