Development

Changeset 7794

You must first sign up to be able to contribute.

Changeset 7794

Show
Ignore:
Timestamp:
03/10/08 16:37:46 (1 year ago)
Author:
FabianLange
Message:

fixes #3078

Files:

Legend:

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

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

    r4195 r7794  
    4343} 
    4444 
    45 $t = new lime_test(24, new lime_output_color()); 
     45$t = new lime_test(25, new lime_output_color()); 
    4646 
    4747$context = sfContext::getInstance(); 
     
    9090$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'); 
    9191$t->is(link_to_if(false, 'test', '', array('tag' => 'div')), '<div>test</div>', 'link_to_if() takes a "tag" option'); 
     92$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'); 
    9293$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'); 
    9394 
     
    9697$t->is(link_to_unless(false, 'test', ''), '<a href="module/action">test</a>', 'link_to_unless() returns an HTML "a" tag if the condition is false'); 
    9798$t->is(link_to_unless(true, 'test', ''), '<span>test</span>', 'link_to_unless() returns an HTML "span" tag by default if the condition is true'); 
     99 
    98100 
    99101// mail_to() 

The Sensio Labs Network

Since 1998, Sensio Labs has been promoting the Open-Source software movement by providing quality web application development, training, consulting, and supporting several large Open-Source projects.