Changeset 275

Show
Ignore:
Timestamp:
10/06/06 22:29:35 (2 years ago)
Author:
laurentj
Message:

mise à jour de simpletest vers la version 1.0.1alpha3

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/build/manifests/jelix-dev.mn

    r271 r275  
    11cd lib/simpletest 
     2  authentication.php 
     3  browser.php 
     4  collector.php 
     5  compatibility.php 
     6  cookies.php 
     7  detached.php 
     8  dumper.php 
     9  encoding.php 
    210  errors.php 
    3   options.php 
    4   dumper.php 
     11  exceptions.php 
    512  expectation.php 
    6   socket.php 
    7   encoding.php 
    8   url.php 
    9   http.php 
    10   authentication.php 
    11   user_agent.php 
    12   browser.php 
    13   parser.php 
    14   tag.php 
    1513  form.php 
    1614  frames.php 
     15  HELP_MY_TESTS_DONT_WORK_ANYMORE 
     16  http.php 
     17  invoker.php 
     18  LICENSE 
     19  mock_objects.php 
    1720  page.php 
     21  parser.php 
     22  README 
     23  reflection_php4.php 
     24  reflection_php5.php 
    1825  remote.php 
    19   runner.php 
     26  reporter.php 
    2027  scorer.php 
    21   reporter.php 
    22   mock_objects.php 
    23   simple_test.php 
     28  selector.php 
     29  shell_tester.php 
     30  simpletest.php 
     31  socket.php 
     32  tag.php 
     33  test_case.php 
    2434  unit_tester.php 
     35  url.php 
     36  user_agent.php 
     37  VERSION 
    2538  web_tester.php 
    26   shell_tester.php 
    2739  xml.php 
    28   README 
    29   VERSION 
    30   LICENSE 
    31   HELP_MY_TESTS_DONT_WORK_ANYMORE 
    32   README_JELIX 
    3340cd lib/simpletest/extensions 
    3441  pear_test_case.php 
    3542  phpunit_test_case.php 
    3643cd lib/simpletest/test 
     44  acceptance_test.php 
     45  adapter_test.php 
    3746  all_tests.php 
    38   unit_tests.php 
    39   acceptance_test.php 
     47  authentication_test.php 
     48  browser_test.php 
     49  collector_test.php 
     50  compatibility_test.php 
     51  cookies_test.php 
     52  detached_test.php 
     53  dumper_test.php 
     54  encoding_test.php 
    4055  errors_test.php 
    41   options_test.php 
    42   dumper_test.php 
    4356  expectation_test.php 
    44   adapter_test.php 
    45   socket_test.php 
    46   url_test.php 
    47   encoding_test.php 
    48   http_test.php 
    49   authentication_test.php 
    50   user_agent_test.php 
    51   browser_test.php 
    52   parser_test.php 
    53   tag_test.php 
    5457  form_test.php 
    5558  frames_test.php 
     59  http_test.php 
     60  interfaces_test.php 
     61  live_test.php 
     62  mock_objects_test.php 
    5663  page_test.php 
     64  parse_error_test.php 
     65  parser_test.php 
     66  real_sites_test.php 
     67  reflection_php4_test.php 
     68  reflection_php5_test.php 
    5769  remote_test.php 
    58   simple_mock_test.php 
     70  shell_tester_test.php 
     71  shell_test.php 
     72  simpletest_test.php 
     73  socket_test.php 
     74  tag_test.php 
     75  test_groups.php 
     76  test_with_parse_error.php 
     77  unit_tester_test.php 
     78  unit_tests.php 
     79  url_test.php 
     80  user_agent_test.php 
    5981  visual_test.php 
    60   shell_test.php 
    6182  web_tester_test.php 
    62   unit_tester_test.php 
    63   shell_tester_test.php 
    6483  xml_test.php 
    65   live_test.php 
    66   real_sites_test.php 
    67   parse_error_test.php 
    68   test_with_parse_error.php 
    69 cd lib/simpletest/docs/en 
    70   docs.css 
    71   index.html 
    72   overview.html 
    73   unit_test_documentation.html 
    74   group_test_documentation.html 
    75   server_stubs_documentation.html 
    76   mock_objects_documentation.html 
    77   partial_mocks_documentation.html 
    78   reporter_documentation.html 
    79   expectation_documentation.html 
    80   web_tester_documentation.html 
    81   form_testing_documentation.html 
    82   authentication_documentation.html 
    83   browser_documentation.html 
    84 cd lib/simpletest/docs/fr 
    85   docs.css 
    86   index.html 
    87   overview.html 
    88   unit_test_documentation.html 
    89   group_test_documentation.html 
    90   server_stubs_documentation.html 
    91   mock_objects_documentation.html 
    92   partial_mocks_documentation.html 
    93   reporter_documentation.html 
    94   expectation_documentation.html 
    95   web_tester_documentation.html 
    96   form_testing_documentation.html 
    97   authentication_documentation.html 
    98   browser_documentation.html 
     84cd lib/simpletest/test/support 
     85  latin1_sample 
     86  spl_examples.php 
     87  supplementary_upload_sample.txt 
     88  upload_sample.txt 
     89cd lib/simpletest/test/support/collector 
     90  collectable.1 
     91  collectable.2 
    9992 
    10093cd lib/jelix-scripts 
  • trunk/lib/jelix-scripts/CREDITS

    r1 r275  
    33 
    44Concepteur et d�loppeur : Laurent Jouanneau 
     5 
     6Contributeurs : 
     7  Loic Mathaud (bug fix) 
     8  Thiriot Christophe (clearcache) 
  • trunk/lib/simpletest/authentication.php

    r67 r275  
    44     *  @package        SimpleTest 
    55     *  @subpackage     WebTester 
    6      *  @version        $Id: authentication.php,v 1.9 2004/09/19 17:24:11 lastcraft Exp $ 
     6     *  @version        $Id: authentication.php,v 1.10 2005/07/26 01:27:18 lastcraft Exp $ 
    77     */ 
    88    /** 
     
    101101         */ 
    102102        function isWithin($url) { 
    103             return (strpos($url->getBasePath(), $this->_root) === 0); 
     103            if ($this->_isIn($this->_root, $url->getBasePath())) { 
     104                return true; 
     105            } 
     106            if ($this->_isIn($this->_root, $url->getBasePath() . $url->getPage() . '/')) { 
     107                return true; 
     108            } 
     109            return false; 
     110        } 
     111         
     112        /** 
     113         *    Tests to see if one string is a substring of 
     114         *    another. 
     115         *    @param string $part        Small bit. 
     116         *    @param string $whole       Big bit. 
     117         *    @return boolean            True if the small bit is 
     118         *                               in the big bit. 
     119         *    @access private 
     120         */ 
     121        function _isIn($part, $whole) { 
     122            return strpos($whole, $part) === 0; 
    104123        } 
    105124    } 
  • trunk/lib/simpletest/browser.php

    r67 r275  
    11<?php 
    22    /** 
    3      *   Base include file for SimpleTest 
    4      *   @package SimpleTest 
    5      *   @subpackage WebTester 
    6      *   @version $Id: browser.php,v 1.141 2005/02/22 02:39:21 lastcraft Exp $ 
     3     * Base include file for SimpleTest 
     4     * @package        SimpleTest 
     5     * @subpackage     WebTester 
     6     * @version        $Id: browser.php,v 1.162 2006/02/05 01:07:49 lastcraft Exp $ 
    77     */ 
    88 
    99    /**#@+ 
    10      *   include other SimpleTest class files 
     10     * include other SimpleTest class files 
    1111     */ 
    12     require_once(dirname(__FILE__) . '/options.php'); 
     12    require_once(dirname(__FILE__) . '/simpletest.php'); 
    1313    require_once(dirname(__FILE__) . '/http.php'); 
    1414    require_once(dirname(__FILE__) . '/encoding.php'); 
    1515    require_once(dirname(__FILE__) . '/page.php'); 
     16    require_once(dirname(__FILE__) . '/selector.php'); 
    1617    require_once(dirname(__FILE__) . '/frames.php'); 
    1718    require_once(dirname(__FILE__) . '/user_agent.php'); 
    1819    /**#@-*/ 
    1920 
    20     define('DEFAULT_MAX_NESTED_FRAMES', 3); 
     21    if (!defined('DEFAULT_MAX_NESTED_FRAMES')) { 
     22        define('DEFAULT_MAX_NESTED_FRAMES', 3); 
     23    } 
    2124 
    2225    /** 
    2326     *    Browser history list. 
    24     *    @package SimpleTest 
    25     *    @subpackage WebTester 
     27        *    @package SimpleTest 
     28        *    @subpackage WebTester 
    2629     */ 
    2730    class SimpleBrowserHistory { 
    28         protected $_sequence; 
    29         protected $_position; 
     31        var $_sequence; 
     32        var $_position; 
    3033 
    3134        /** 
     
    6770        /** 
    6871         *    Adds a successfully fetched page to the history. 
    69          *    @param string $method                 GET or POST. 
    7072         *    @param SimpleUrl $url                 URL of fetch. 
    71          *    @param SimpleFormEncoding $parameters Any post data with the fetch. 
    72          *    @access public 
    73          */ 
    74         function recordEntry($method, $url, $parameters) { 
     73         *    @param SimpleEncoding $parameters    Any post data with the fetch. 
     74         *    @access public 
     75         */ 
     76        function recordEntry($url, $parameters) { 
    7577            $this->_dropFuture(); 
    7678            array_push( 
    7779                    $this->_sequence, 
    78                     array('method' => $method, 'url' => $url, 'parameters' => $parameters)); 
     80                    array('url' => $url, 'parameters' => $parameters)); 
    7981            $this->_position++; 
    80         } 
    81  
    82         /** 
    83          *    Last fetching method for current history 
    84          *    position. 
    85          *    @return string      GET or POST for this point in 
    86          *                        the history. 
    87          *    @access public 
    88          */ 
    89         function getMethod() { 
    90             if ($this->_isEmpty()) { 
    91                 return false; 
    92             } 
    93             return $this->_sequence[$this->_position]['method']; 
    9482        } 
    9583 
     
    167155     *    the user agent, the HTML parsing, request history 
    168156     *    and the last header set. 
    169     *    @package SimpleTest 
    170     *    @subpackage WebTester 
     157        *    @package SimpleTest 
     158        *    @subpackage WebTester 
    171159     */ 
    172160    class SimpleBrowser { 
    173         protected $_user_agent; 
    174         protected $_page; 
    175         protected $_history; 
    176         protected $_ignore_frames; 
    177         protected $_maximum_nested_frames; 
     161        var $_user_agent; 
     162        var $_page; 
     163        var $_history; 
     164        var $_ignore_frames; 
     165        var $_maximum_nested_frames; 
    178166 
    179167        /** 
     
    187175            $this->_user_agent = &$this->_createUserAgent(); 
    188176            $this->_user_agent->useProxy( 
    189                     SimpleTestOptions::getDefaultProxy(), 
    190                     SimpleTestOptions::getDefaultProxyUsername(), 
    191                     SimpleTestOptions::getDefaultProxyPassword()); 
    192             $this->_page = new SimplePage(); 
     177                    SimpleTest::getDefaultProxy(), 
     178                    SimpleTest::getDefaultProxyUsername(), 
     179                    SimpleTest::getDefaultProxyPassword()); 
     180            $this->_page = &new SimplePage(); 
    193181            $this->_history = &$this->_createHistory(); 
    194182            $this->_ignore_frames = false; 
     
    202190         */ 
    203191        function &_createUserAgent() { 
    204             return new SimpleUserAgent(); 
     192            $user_agent = &new SimpleUserAgent(); 
     193            return $user_agent; 
    205194        } 
    206195 
     
    211200         */ 
    212201        function &_createHistory() { 
    213             return new SimpleBrowserHistory(); 
     202            $history = &new SimpleBrowserHistory(); 
     203            return $history; 
    214204        } 
    215205 
     
    230220        function useFrames() { 
    231221            $this->_ignore_frames = false; 
     222        } 
     223         
     224        /** 
     225         *    Switches off cookie sending and recieving. 
     226         *    @access public 
     227         */ 
     228        function ignoreCookies() { 
     229            $this->_user_agent->ignoreCookies(); 
     230        } 
     231         
     232        /** 
     233         *    Switches back on the cookie sending and recieving. 
     234         *    @access public 
     235         */ 
     236        function useCookies() { 
     237            $this->_user_agent->useCookies(); 
    232238        } 
    233239 
     
    238244         *    @param integer $depth                  Nested frameset depth. 
    239245         *    @return SimplePage                     Parsed HTML. 
    240          *    @access protected 
     246         *    @access private 
    241247         */ 
    242248        function &_parse($response, $depth = 0) { 
    243             $builder = new SimplePageBuilder(); 
    244             $page = &$builder->parse($response); 
     249            $page = &$this->_buildPage($response); 
    245250            if ($this->_ignore_frames || ! $page->hasFrames() || ($depth > $this->_maximum_nested_frames)) { 
    246251                return $page; 
    247252            } 
    248             $frameset = new SimpleFrameset($page); 
     253            $frameset = &new SimpleFrameset($page); 
    249254            foreach ($page->getFrameset() as $key => $url) { 
    250                 $frame = &$this->_fetch('GET', $url, array(), $depth + 1); 
     255                $frame = &$this->_fetch($url, new SimpleGetEncoding(), $depth + 1); 
    251256                $frameset->addFrame($frame, $key); 
    252257            } 
    253258            return $frameset; 
    254259        } 
    255  
    256         /** 
    257          *    Fetches a page. 
    258          *    @param string $method                   GET or POST. 
    259          *    @param string/SimpleUrl $url            Target to fetch as string. 
    260          *    @param SimpleFormEncoding $parameters   POST parameters. 
    261          *    @param integer $depth                   Nested frameset depth protection. 
    262          *    @return SimplePage                      Parsed page. 
     260         
     261        /** 
     262         *    Assembles the parsing machinery and actually parses 
     263         *    a single page. Frees all of the builder memory and so 
     264         *    unjams the PHP memory management. 
     265         *    @param SimpleHttpResponse $response    Response from fetch. 
     266         *    @return SimplePage                     Parsed top level page. 
     267         *    @access protected 
     268         */ 
     269        function &_buildPage($response) { 
     270            $builder = &new SimplePageBuilder(); 
     271            $page = &$builder->parse($response); 
     272            $builder->free(); 
     273            unset($builder); 
     274            return $page; 
     275        } 
     276 
     277        /** 
     278         *    Fetches a page. Jointly recursive with the _parse() 
     279         *    method as it descends a frameset. 
     280         *    @param string/SimpleUrl $url          Target to fetch. 
     281         *    @param SimpleEncoding $encoding       GET/POST parameters. 
     282         *    @param integer $depth                 Nested frameset depth protection. 
     283         *    @return SimplePage                    Parsed page. 
    263284         *    @access private 
    264285         */ 
    265         function &_fetch($method, $url, $parameters, $depth = 0) { 
    266             $response = &$this->_user_agent->fetchResponse($method, $url, $parameters); 
     286        function &_fetch($url, $encoding, $depth = 0) { 
     287            $response = &$this->_user_agent->fetchResponse($url, $encoding); 
    267288            if ($response->isError()) { 
    268                 return new SimplePage($response); 
    269             } 
    270             return $this->_parse($response, $depth); 
     289                $page = &new SimplePage($response); 
     290            } else { 
     291                $page = &$this->_parse($response, $depth); 
     292            } 
     293            return $page; 
    271294        } 
    272295 
     
    274297         *    Fetches a page or a single frame if that is the current 
    275298         *    focus. 
    276          *    @param string $method                   GET or POST. 
     299         *    @param SimpleUrl $url                   Target to fetch. 
     300         *    @param SimpleEncoding $parameters       GET/POST parameters. 
     301         *    @return string                          Raw content of page. 
     302         *    @access private 
     303         */ 
     304        function _load($url, $parameters) { 
     305            $frame = $url->getTarget(); 
     306            if (! $frame || ! $this->_page->hasFrames() || (strtolower($frame) == '_top')) { 
     307                return $this->_loadPage($url, $parameters); 
     308            } 
     309            return $this->_loadFrame(array($frame), $url, $parameters); 
     310        } 
     311 
     312        /** 
     313         *    Fetches a page and makes it the current page/frame. 
     314         *    @param string/SimpleUrl $url            Target to fetch as string. 
     315         *    @param SimplePostEncoding $parameters   POST parameters. 
     316         *    @return string                          Raw content of page. 
     317         *    @access private 
     318         */ 
     319        function _loadPage($url, $parameters) { 
     320            $this->_page = &$this->_fetch($url, $parameters); 
     321            $this->_history->recordEntry( 
     322                    $this->_page->getUrl(), 
     323                    $this->_page->getRequestData()); 
     324            return $this->_page->getRaw(); 
     325        } 
     326 
     327        /** 
     328         *    Fetches a frame into the existing frameset replacing the 
     329         *    original. 
     330         *    @param array $frames                    List of names to drill down. 
    277331         *    @param string/SimpleUrl $url            Target to fetch as string. 
    278332         *    @param SimpleFormEncoding $parameters   POST parameters. 
     
    280334         *    @access private 
    281335         */ 
    282         function _load($method, $url, $parameters = false) { 
    283             $frame = $url->getTarget(); 
    284             if (! $frame || ! $this->_page->hasFrames() || (strtolower($frame) == '_top')) { 
    285                 return $this->_loadPage($method, $url, $parameters); 
    286             } 
    287             return $this->_loadFrame(array($frame), $method, $url, $parameters); 
    288         } 
    289  
    290         /** 
    291          *    Fetches a page and makes it the current page/frame. 
    292          *    @param string $method                   GET or POST. 
    293          *    @param string/SimpleUrl $url            Target to fetch as string. 
    294          *    @param SimpleFormEncoding $parameters   POST parameters. 
    295          *    @return string                          Raw content of page. 
    296          *    @access private 
    297          */ 
    298         function _loadPage($method, $url, $parameters = false) { 
    299             $this->_page = &$this->_fetch(strtoupper($method), $url, $parameters); 
    300             $this->_history->recordEntry( 
    301                     $this->_page->getMethod(), 
    302                     $this->_page->getUrl(), 
    303                     $this->_page->getRequestData()); 
    304             return $this->_page->getRaw(); 
    305         } 
    306  
    307         /** 
    308          *    Fetches a frame into the existing frameset replacing the 
    309          *    original. 
    310          *    @param array $frames                    List of names to drill down. 
    311          *    @param string $method                   GET or POST. 
    312          *    @param string/SimpleUrl $url            Target to fetch as string. 
    313          *    @param SimpleFormEncoding $parameters   POST parameters. 
    314          *    @return string                          Raw content of page. 
    315          *    @access private 
    316          */ 
    317         function _loadFrame($frames, $method, $url, $parameters = false) { 
    318             $page = &$this->_fetch(strtoupper($method), $url, $parameters); 
     336        function _loadFrame($frames, $url, $parameters) { 
     337            $page = &$this->_fetch($url, $parameters); 
    319338            $this->_page->setFrame($frames, $page); 
    320339        } 
     
    436455         *    Will affect cookies, but will not change the base URL. 
    437456         *    @param string/SimpleUrl $url                Target to fetch as string. 
    438          *    @param hash/SimpleFormEncoding $parameters  Additional parameters for 
     457         *    @param hash/SimpleHeadEncoding $parameters  Additional parameters for 
    439458         *                                                HEAD request. 
    440459         *    @return boolean                             True if successful. 
     
    445464                $url = new SimpleUrl($url); 
    446465            } 
    447             if (is_array($parameters)) { 
    448                 $parameters = new SimpleFormEncoding($parameters); 
    449             } 
    450466            if ($this->getUrl()) { 
    451467                $url = $url->makeAbsolute($this->getUrl()); 
    452468            } 
    453             $response = &$this->_user_agent->fetchResponse( 
    454                     'HEAD', 
    455                     $url, 
    456                     $parameters); 
     469            $response = &$this->_user_agent->fetchResponse($url, new SimpleHeadEncoding($parameters)); 
    457470            return ! $response->isError(); 
    458471        } 
     
    470483                $url = new SimpleUrl($url); 
    471484            } 
    472             if (is_array($parameters)) { 
    473                 $parameters = new SimpleFormEncoding($parameters); 
    474             } 
    475485            if ($this->getUrl()) { 
    476486                $url = $url->makeAbsolute($this->getUrl()); 
    477487            } 
    478             return $this->_load('GET', $url, $parameters); 
     488            return $this->_load($url, new SimpleGetEncoding($parameters)); 
    479489        } 
    480490 
     
    490500                $url = new SimpleUrl($url); 
    491501            } 
    492             if (is_array($parameters)) { 
    493                 $parameters = new SimpleFormEncoding($parameters); 
    494             } 
    495502            if ($this->getUrl()) { 
    496503                $url = $url->makeAbsolute($this->getUrl()); 
    497504            } 
    498             return $this->_load('POST', $url, $parameters); 
     505            return $this->_load($url, new SimplePostEncoding($parameters)); 
    499506        } 
    500507 
     
    512519                $this->_loadFrame( 
    513520                        $frames, 
    514                         $this->_page->getMethod(), 
    515521                        $this->_page->getUrl(), 
    516522                        $this->_page->getRequestData()); 
    517523                return $this->_page->getRaw(); 
    518524            } 
    519             if ($method = $this->_history->getMethod()) { 
    520                 $this->_page = &$this->_fetch( 
    521                         $method, 
    522                         $this->_history->getUrl(), 
    523                         $this->_history->getParameters()); 
     525            if ($url = $this->_history->getUrl()) { 
     526                $this->_page = &$this->_fetch($url, $this->_history->getParameters()); 
    524527                return $this->_page->getRaw(); 
    525528            } 
     
    530533         *    Equivalent to hitting the back button on the 
    531534         *    browser. The browser history is unchanged on 
    532          *    failure. 
     535         *    failure. The page content is refetched as there 
     536         *    is no concept of content caching in SimpleTest. 
    533537         *    @return boolean     True if history entry and 
    534538         *                        fetch succeeded 
     
    549553         *    Equivalent to hitting the forward button on the 
    550554         *    browser. The browser history is unchanged on 
    551          *    failure. 
     555         *    failure. The page content is refetched as there 
     556         *    is no concept of content caching in SimpleTest. 
    552557         *    @return boolean     True if history entry and 
    553558         *                        fetch succeeded 
     
    766771        /** 
    767772         *    Sets all form fields with that name. 
     773         *    @param string $label   Name or label of field in forms. 
     774         *    @param string $value   New value of field. 
     775         *    @return boolean        True if field exists, otherwise false. 
     776         *    @access public 
     777         */ 
     778        function setField($label, $value) { 
     779            return $this->_page->setField(new SimpleByLabelOrName($label), $value); 
     780        } 
     781 
     782        /** 
     783         *    Sets all form fields with that name. Will use label if 
     784         *    one is available (not yet implemented). 
    768785         *    @param string $name    Name of field in forms. 
    769786         *    @param string $value   New value of field. 
     
    771788         *    @access public 
    772789         */ 
    773         function setField($name, $value) { 
    774             return $this->_page->setField($name, $value); 
     790        function setFieldByName($name, $value) { 
     791            return $this->_page->setField(new SimpleByName($name), $value); 
    775792        } 
    776793 
     
    783800         */ 
    784801        function setFieldById($id, $value) { 
    785             return $this->_page->setFieldById($id, $value); 
     802            return $this->_page->setField(new SimpleById($id), $value); 
     803        } 
     804 
     805        /** 
     806         *    Accessor for a form element value within the page. 
     807         *    Finds the first match. 
     808         *    @param string $label       Field label. 
     809         *    @return string/boolean     A value if the field is 
     810         *                               present, false if unchecked 
     811         *                               and null if missing. 
     812         *    @access public 
     813         */ 
     814        function getField($label) { 
     815            return $this->_page->getField(new SimpleByLabelOrName($label)); 
    786816        } 
    787817 
     
    795825         *    @access public 
    796826         */ 
    797         function getField($name) { 
    798             return $this->_page->getField($name); 
     827        function getFieldByName($name) { 
     828            return $this->_page->getField(new SimpleByName($name)); 
    799829        } 
    800830 
     
    808838         */ 
    809839        function getFieldById($id) { 
    810             return $this->_page->getFieldById($id); 
     840            return $this->_page->getField(new SimpleById($id)); 
    811841        } 
    812842 
     
    821851         */ 
    822852        function clickSubmit($label = 'Submit', $additional = false) { 
    823             if (! ($form = &$this->_page->getFormBySubmitLabel($label))) { 
     853            if (! ($form = &$this->_page->getFormBySubmit(new SimpleByLabel($label)))) { 
    824854                return false; 
    825855            } 
    826856            $success = $this->_load( 
    827                     $form->getMethod(), 
    828857                    $form->getAction(), 
    829                     $form->submitButtonByLabel($label, $additional)); 
     858                    $form->submitButton(new SimpleByLabel($label), $additional)); 
    830859            return ($success ? $this->getContent() : $success); 
    831860        } 
     
    840869         */ 
    841870        function clickSubmitByName($name, $additional = false) { 
    842             if (! ($form = &$this->_page->getFormBySubmitName($name))) { 
     871            if (! ($form = &$this->_page->getFormBySubmit(new SimpleByName($name)))) { 
    843872                return false; 
    844873            } 
    845874            $success = $this->_load( 
    846                     $form->getMethod(), 
    847875                    $form->getAction(), 
    848                     $form->submitButtonByName($name, $additional)); 
     876                    $form->submitButton(new SimpleByName($name), $additional)); 
    849877            return ($success ? $this->getContent() : $success); 
    850878        } 
     
    859887         */ 
    860888        function clickSubmitById($id, $additional = false) { 
    861             if (! ($form = &$this->_page->getFormBySubmitId($id))) { 
     889            if (! ($form = &$this->_page->getFormBySubmit(new SimpleById($id)))) { 
    862890                return false; 
    863891            } 
    864892            $success = $this->_load( 
    865                     $form->getMethod(), 
    866893                    $form->getAction(), 
    867                     $form->submitButtonById($id, $additional)); 
     894                    $form->submitButton(new SimpleById($id), $additional)); 
    868895            return ($success ? $this->getContent() : $success); 
    869896        } 
     
    883910         */ 
    884911        function clickImage($label, $x = 1, $y = 1, $additional = false) { 
    885             if (! ($form = &$this->_page->getFormByImageLabel($label))) { 
     912            if (! ($form = &$this->_page->getFormByImage(new SimpleByLabel($label)))) { 
    886913                return false; 
    887914            } 
    888915            $success = $this->_load( 
    889                     $form->getMethod(), 
    890916                    $form->getAction(), 
    891                     $form->submitImageByLabel($label, $x, $y, $addi