Development

Changeset 33373

You must first sign up to be able to contribute.

Changeset 33373

Show
Ignore:
Timestamp:
03/08/12 16:45:46 (1 year ago)
Author:
fabien
Message:

[1.4] fixed test browser click function does not handle css selector without [ or ] (closes #9982, patch from mouette)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/1.4/lib/util/sfBrowserBase.class.php

    r28702 r33373  
    701701    $query .= sprintf('|//button[.="%s" or @id="%s" or @name="%s"]', $name, $name, $name); 
    702702 
    703     $list = $this->getResponseDomXpath()->query($query); 
     703    if (!$list = @$this->getResponseDomXpath()->query($query)) 
     704    { 
     705      throw new InvalidArgumentException(sprintf('The name "%s" is not valid', $name)); 
     706    } 
    704707 
    705708    $position = isset($options['position']) ? $options['position'] - 1 : 0; 
  • branches/1.4/test/unit/util/sfBrowserTest.php

    r28702 r33373  
    1111require_once(dirname(__FILE__).'/../../bootstrap/unit.php'); 
    1212 
    13 $t = new lime_test(73); 
     13$t = new lime_test(74); 
    1414 
    1515// ->click() 
     
    134134    <input type="submit" id="orphaned-input-submit" /> 
    135135 
     136    <ul class="css-selector-test"> 
     137      <li>my first <a href="myfirstlink">paragraph</a></li> 
     138      <li>my second <a href="mysecondlink">paragraph</a></li> 
     139    </ul> 
     140 
    136141  </body> 
    137142</html> 
     
    312317} 
    313318 
     319list($method, $uri, $parameters) = $b->click('li:contains("first") a'); 
     320$t->is($uri, 'myfirstlink', 'click accept css selectors without "[" or "]"'); 
     321 
    314322// ->call() 
    315323$t->diag('->call()');