Development

Changeset 7795

You must first sign up to be able to contribute.

Changeset 7795

Show
Ignore:
Timestamp:
03/10/08 16:39:49 (7 months ago)
Author:
FabianLange
Message:

fixes #3078 for 1.1 (inclusive test)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/1.1/lib/helper/UrlHelper.php

    r7757 r7795  
    165165  if ($condition) 
    166166  { 
     167    unset($options['tag']); 
    167168    return link_to($name, $internal_uri, $options); 
    168169  } 
  • branches/1.1/test/unit/helper/UrlHelperTest.php

    r7757 r7795  
    2020} 
    2121 
    22 $t = new lime_test(24, new lime_output_color()); 
     22$t = new lime_test(25, new lime_output_color()); 
    2323 
    2424$context = sfContext::getInstance(array('controller' => 'myController')); 
     
    7070$t->is(link_to_if(false, 'test', ''), '<span>test</span>', 'link_to_if() returns an HTML "span" tag by default if the condition is false'); 
    7171$t->is(link_to_if(false, 'test', '', array('tag' => 'div')), '<div>test</div>', 'link_to_if() takes a "tag" option'); 
     72$t->is(link_to_if(true, 'test', '', array('tag' => 'div')), '<a href="module/action">test</a>', 'link_to_if() removes "tag" option in true case'); 
    7273$t->is(link_to_if(false, 'test', '', array('query_string' => 'foo=bar', 'absolute' => true, 'absolute_url' => 'http://www.google.com/')), '<span>test</span>', 'link_to_if() returns an HTML "span" tag by default if the condition is false'); 
    7374