Development

Changeset 8409

You must first sign up to be able to contribute.

Changeset 8409

Show
Ignore:
Timestamp:
04/11/08 09:41:48 (7 months ago)
Author:
fabien
Message:

fixed crud functional tests for m2m relationships

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/1.1/lib/plugins/sfPropelPlugin/test/functional/crud/crudBrowser.class.php

    r7606 r8409  
    8585      checkResponseElement('a[href*="/article/delete"]', false)-> 
    8686      checkFormValues(array( 
    87         'title'       => '', 
    88         'body'        => '', 
    89         'online'      => false, 
    90         'category_id' => 0, 
    91         'end_date'    => array('year' => '', 'month' => '', 'day' => '', 'hour' => '', 'minute' => ''), 
    92         'book_id'     => 0, 
    93         'author_list' => array(), 
     87        'title'               => '', 
     88        'body'                => '', 
     89        'online'              => false, 
     90        'category_id'         => 0, 
     91        'end_date'            => array('year' => '', 'month' => '', 'day' => '', 'hour' => '', 'minute' => ''), 
     92        'book_id'             => 0, 
     93        'author_article_list' => array(), 
    9494      )) 
    9595    ; 
     
    9898    $this->test()->diag('save'); 
    9999    $this->saveValues($options, array( 
    100       'title'       => 'my real title', 
    101       'body'        => 'my real body', 
    102       'online'      => true, 
    103       'category_id' => 2, 
    104       'end_date'    => array('year' => '', 'month' => '', 'day' => '', 'hour' => '', 'minute' => ''), 
    105       'book_id'     => null, 
    106       'author_list' => array(1, 2), 
     100      'title'               => 'my real title', 
     101      'body'                => 'my real body', 
     102      'online'              => true, 
     103      'category_id'         => 2, 
     104      'end_date'            => array('year' => '', 'month' => '', 'day' => '', 'hour' => '', 'minute' => ''), 
     105      'book_id'             => null, 
     106      'author_article_list' => array(1, 2), 
    107107    ), 3); 
    108108 
     
    138138      checkResponseElement('table tbody th:nth(5)', 'End date')-> 
    139139      checkResponseElement('table tbody th:nth(6)', 'Book id')-> 
    140       checkResponseElement('table tbody th:nth(7)', 'Author list')-> 
     140      checkResponseElement('table tbody th:nth(7)', 'Author article list')-> 
    141141      checkResponseElement('table tbody th', 8)-> 
    142142 
     
    149149    $this->test()->diag('save / validation'); 
    150150    $values = array( 
    151       'id'          => 1009299, 
    152       'title'       => '', 
    153       'body'        => 'my body', 
    154       'online'      => true, 
    155       'category_id' => null, 
    156       'end_date'    => array('year' => 0, 'month' => 0, 'day' => 15, 'hour' => '10', 'minute' => '20'), 
    157       'book_id'     => 149999, 
    158       'author_list' => array(0, 5), 
     151      'id'                  => 1009299, 
     152      'title'               => '', 
     153      'body'                => 'my body', 
     154      'online'              => true, 
     155      'category_id'         => null, 
     156      'end_date'            => array('year' => 0, 'month' => 0, 'day' => 15, 'hour' => '10', 'minute' => '20'), 
     157      'book_id'             => 149999, 
     158      'author_article_list' => array(0, 5), 
    159159    ); 
    160160    $this-> 
     
    173173    $this->test()->diag('save'); 
    174174    $this->saveValues($options, array( 
    175       'id'          => 3, 
    176       'title'       => 'my title', 
    177       'body'        => 'my body', 
    178       'online'      => false, 
    179       'category_id' => 1, 
    180       'end_date'    => array('year' => 2005, 'month' => 10, 'day' => 15, 'hour' => '10', 'minute' => '20'), 
    181       'book_id'     => 1, 
    182       'author_list' => array(1, 3), 
     175      'id'                  => 3, 
     176      'title'               => 'my title', 
     177      'body'                => 'my body', 
     178      'online'              => false, 
     179      'category_id'         => 1, 
     180      'end_date'            => array('year' => 2005, 'month' => 10, 'day' => 15, 'hour' => '10', 'minute' => '20'), 
     181      'book_id'             => 1, 
     182      'author_article_list' => array(1, 3), 
    183183    ), 3); 
    184184 
     
    282282      checkResponseElement(sprintf('table tbody td select[id="article_book_id"][name="article[book_id]"] option[value="1"]%s', $values['book_id'] == 1 ? '[selected="selected"]' : ''), 'The definitive guide to symfony')-> 
    283283 
    284       checkResponseElement(sprintf('table tbody td select[id="article_author_list"][name="article[author_list][]"] option[value="1"]%s', in_array(1, $values['author_list']) ? '[selected="selected"]' : ''), 'Fabien')-> 
    285       checkResponseElement(sprintf('table tbody td select[id="article_author_list"][name="article[author_list][]"] option[value="2"]%s', in_array(2, $values['author_list']) ? '[selected="selected"]' : ''), 'Thomas')-> 
    286       checkResponseElement(sprintf('table tbody td select[id="article_author_list"][name="article[author_list][]"] option[value="3"]%s', in_array(3, $values['author_list']) ? '[selected="selected"]' : ''), 'Hélène')-> 
     284      checkResponseElement(sprintf('table tbody td select[id="article_author_article_list"][name="article[author_article_list][]"] option[value="1"]%s', in_array(1, $values['author_article_list']) ? '[selected="selected"]' : ''), 'Fabien')-> 
     285      checkResponseElement(sprintf('table tbody td select[id="article_author_article_list"][name="article[author_article_list][]"] option[value="2"]%s', in_array(2, $values['author_article_list']) ? '[selected="selected"]' : ''), 'Thomas')-> 
     286      checkResponseElement(sprintf('table tbody td select[id="article_author_article_list"][name="article[author_article_list][]"] option[value="3"]%s', in_array(3, $values['author_article_list']) ? '[selected="selected"]' : ''), 'Hélène')-> 
    287287 
    288288      checkResponseElement('table tbody td select[id="article_end_date_year"][name="article[end_date][year]"] option[selected="selected"]', (string) $values['end_date']['year'])->