Changeset 196 for trunk/trax/test

Show
Ignore:
Timestamp:
04/06/06 11:30:43 (6 years ago)
Author:
haas
Message:

enhance tests, docs

Location:
trunk/trax/test
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/trax/test/DateHelperTest.php

    r192 r196  
    2727 
    2828require_once "trax_exceptions.php"; 
     29require_once "action_view/helpers.php"; 
     30require_once "action_view/helpers/date_helper.php"; 
    2931 
    3032/** 
     
    209211 
    210212    /** 
    211      *  @todo Implement testSelect_month_method() 
     213     *  Test select_month() method 
     214     * 
     215     *  NB: the override of selected month by $_REQUEST only occurs if 
     216     *  the private function check_request_for_value() was previously 
     217     *  called to parse $_REQUEST so we can't test that here. 
     218     * 
     219     *  NB: doesn't test corrects of selection of current month 
    212220     */ 
    213221    public function testSelect_month_method() { 
     222        $dh = new DateHelper(); 
     223 
     224        //  Test generation with November selected, default output format 
     225        $this->assertEquals('<select name="month">' . "\n" 
     226                            . '<option value="01">January</option>' . "\n" 
     227                            . '<option value="02">February</option>' . "\n" 
     228                            . '<option value="03">March</option>' . "\n" 
     229                            . '<option value="04">April</option>' . "\n" 
     230                            . '<option value="05">May</option>' . "\n" 
     231                            . '<option value="06">June</option>' . "\n" 
     232                            . '<option value="07">July</option>' . "\n" 
     233                            . '<option value="08">August</option>' . "\n" 
     234                            . '<option value="09">September</option>' . "\n" 
     235                            . '<option value="10">October</option>' . "\n" 
     236                            . '<option value="11" selected="selected">November</option>' . "\n" 
     237                            . '<option value="12">December</option>' . "\n" 
     238                            . '</select>' . "\n", 
     239                            $dh->select_month('11')); 
     240 
     241        //  Test generation of month numbers as visible content 
     242        $this->assertEquals('<select name="month">' . "\n" 
     243                            . '<option value="01">1</option>' . "\n" 
     244                            . '<option value="02">2</option>' . "\n" 
     245                            . '<option value="03" selected="selected">3</option>' . "\n" 
     246                            . '<option value="04">4</option>' . "\n" 
     247                            . '<option value="05">5</option>' . "\n" 
     248                            . '<option value="06">6</option>' . "\n" 
     249                            . '<option value="07">7</option>' . "\n" 
     250                            . '<option value="08">8</option>' . "\n" 
     251                            . '<option value="09">9</option>' . "\n" 
     252                            . '<option value="10">10</option>' . "\n" 
     253                            . '<option value="11">11</option>' . "\n" 
     254                            . '<option value="12">12</option>' . "\n" 
     255                            . '</select>' . "\n", 
     256                            $dh->select_month("03", 
     257                                              array('use_month_numbers'=>1))); 
     258 
     259        //  Test addition of month numbers to visible content 
     260        $this->assertEquals('<select name="month">' . "\n" 
     261                            . '<option value="01">1 - January</option>' . "\n" 
     262                            . '<option value="02">2 - February</option>' . "\n" 
     263                            . '<option value="03">3 - March</option>' . "\n" 
     264                            . '<option value="04">4 - April</option>' . "\n" 
     265                            . '<option value="05" selected="selected">5 - May</option>' . "\n" 
     266                            . '<option value="06">6 - June</option>' . "\n" 
     267                            . '<option value="07">7 - July</option>' . "\n" 
     268                            . '<option value="08">8 - August</option>' . "\n" 
     269                            . '<option value="09">9 - September</option>' . "\n" 
     270                            . '<option value="10">10 - October</option>' . "\n" 
     271                            . '<option value="11">11 - November</option>' . "\n" 
     272                            . '<option value="12">12 - December</option>' . "\n" 
     273                            . '</select>' . "\n", 
     274                            $dh->select_month("05", 
     275                                              array('add_month_numbers'=>1))); 
     276 
    214277        // Remove the following line when you implement this test. 
    215278        throw new PHPUnit2_Framework_IncompleteTestError; 
  • trunk/trax/test/HelpersTest.php

    r192 r196  
    243243 
    244244    /** 
    245      * @todo Implement testTo_content_tag(). 
    246      */ 
    247     public function testTo_content_tag() { 
     245     * @todo Implement testValue(). 
     246     */ 
     247    public function testValue() { 
    248248        // Remove the following line when you implement this test. 
    249249        throw new PHPUnit2_Framework_IncompleteTestError; 
     
    251251 
    252252    /** 
    253      * @todo Implement testValue(). 
    254      */ 
    255     public function testValue() { 
     253     * @todo Implement testTo_content_tag(). 
     254     */ 
     255    public function testTo_content_tag() { 
    256256        // Remove the following line when you implement this test. 
    257257        throw new PHPUnit2_Framework_IncompleteTestError;