Changeset 199 for trunk/trax/test

Show
Ignore:
Timestamp:
05/04/06 19:52:43 (6 years ago)
Author:
haas
Message:

many fixes, documentation improvements

Location:
trunk/trax/test
Files:
3 added
14 modified

Legend:

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

    r192 r199  
    2020//  you don't really need a 'haas' account to test, 
    2121//  the use of this prefix is purely syntactic 
    22 define("TRAX_URL_PREFIX", "~haas"); 
     22define("TRAX_URL_PREFIX", "/~haas"); 
    2323$GLOBALS['TRAX_INCLUDES'] = 
    2424    array( "config"      => "config", 
  • trunk/trax/test/ActiveRecordTest.php

    r192 r199  
    428428 
    429429    /** 
    430      *  Test the create() method 
    431      *  @todo Implement testCreate() (figure out create() first) 
    432      */ 
    433     public function testCreate() { 
    434         // Remove the following line when you implement this test. 
    435         throw new PHPUnit2_Framework_IncompleteTestError; 
    436     } 
    437  
    438     /** 
    439430     *  Test the add_error() method 
    440431     */ 
     
    478469                 new DB_find_all_result); 
    479470        $result = $p->find_all("SELECT mumble,foo FROM person_names"); 
     471        $this->assertTrue(is_array($result)); 
    480472 
    481473        //  Conditions without "SELECT" should appear in WHERE clause 
     
    485477                 new DB_find_all_result); 
    486478        $result = $p->find_all("last_name = 'Dover'"); 
     479        $this->assertTrue(is_array($result)); 
    487480 
    488481        //  Orderings should appear in ORDER BY clause 
     
    492485                 new DB_find_all_result); 
    493486        $result = $p->find_all(null, "last_name"); 
     487        $this->assertTrue(is_array($result)); 
     488 
     489        //  Test limit 
     490        //$GLOBALS['ACTIVE_RECORD_DB']->expect_query( 
     491        //         "SELECT * FROM person_names WHERE last_name = 'Dover' " 
     492        //         . "ORDER BY last_name ", 
     493        //         new DB_find_all_result); 
     494        //$result = $p->find_all("last_name = 'Dover'", "last_name", 
     495        //                       array(1,20)); 
     496 
     497        //  Test joins 
    494498 
    495499        // Remove the following line when you implement this test. 
     
    697701 
    698702    /** 
     703     *  Test the column_attribute_exists() method 
     704     *  @todo Implement testColumn_attribute_exists() 
     705     */ 
     706    public function testColumn_attribute_exists() { 
     707        // Remove the following line when you implement this test. 
     708        throw new PHPUnit2_Framework_IncompleteTestError; 
     709    } 
     710 
     711    /** 
    699712     *  Test the column_for_attribute() method 
    700713     *  @todo Implement testColumn_for_attribute() 
     
    723736    } 
    724737 
     738    /** 
     739     *  Test the create() method 
     740     *  @todo Implement testCreate() 
     741     */ 
     742    public function testCreate() { 
     743        // Remove the following line when you implement this test. 
     744        throw new PHPUnit2_Framework_IncompleteTestError; 
     745    } 
     746 
    725747    /** 
    726748     *  Test the delete() method 
     
    792814 
    793815    /** 
     816     *  Test the get_association() method 
     817     *  @todo Implement testGet_association() 
     818     */ 
     819    public function testGet_association() { 
     820        // Remove the following line when you implement this test. 
     821        throw new PHPUnit2_Framework_IncompleteTestError; 
     822    } 
     823 
     824    /** 
    794825     *  Test the get_errors() method 
    795826     *  @todo Implement testGet_errors() 
     
    827858    } 
    828859 
     860    /** 
     861     *  Test the load() method 
     862     *  @todo Implement testLoad() 
     863     */ 
     864    public function testLoad() { 
     865        // Remove the following line when you implement this test. 
     866        throw new PHPUnit2_Framework_IncompleteTestError; 
     867    } 
     868 
     869    /** 
     870     *  Test the log_query() method 
     871     *  @todo Implement testLog_query() 
     872     */ 
     873    public function testLog_query() { 
     874        // Remove the following line when you implement this test. 
     875        throw new PHPUnit2_Framework_IncompleteTestError; 
     876    } 
     877 
    829878    /** 
    830879     *  Test the max_all() method 
     
    9901039 
    9911040    /** 
    992      *  Test the _get() method 
    993      *  @todo Implement test_get() 
    994      */ 
    995     public function test_get() { 
     1041     *  Test the __get() method 
     1042     *  @todo Implement test__get() 
     1043     */ 
     1044    public function test__get() { 
    9961045        // Remove the following line when you implement this test. 
    9971046        throw new PHPUnit2_Framework_IncompleteTestError; 
  • trunk/trax/test/AssetTagHelperTest.php

    r192 r199  
    2626require_once "PHPUnit2/Framework/IncompleteTestError.php"; 
    2727 
     28//  root Trax files in the test directory 
     29define("TRAX_ROOT", dirname(__FILE__) . "/"); 
     30define("TRAX_PUBLIC", dirname(__FILE__) . "/public"); 
     31define("TRAX_URL_PREFIX", "/testprefix"); 
     32define("TRAX_VIEWS_EXTENTION",  "phtml"); 
     33$GLOBALS['TRAX_INCLUDES'] = 
     34    array( "config"      => "config", 
     35           "controllers" => "controllers", 
     36           "helpers"     => "helpers", 
     37           "layouts"     => "layouts", 
     38           "views"       => "views"); 
     39 
     40require_once "action_view/helpers.php"; 
     41require_once "inflector.php"; 
     42require_once "action_view/helpers/url_helper.php"; 
     43require_once "action_view/helpers/asset_tag_helper.php"; 
    2844require_once "trax_exceptions.php"; 
     45 
     46//  parameters need by UrlHelper 
     47$_SERVER['HTTP_HOST'] = 'www.example.com'; 
     48$_SERVER['SERVER_PORT'] = '80'; 
     49 
     50//  referenced by the AssetTagHelper constructor 
     51$GLOBALS['JAVASCRIPT_DEFAULT_SOURCES'] = array('this', 'that'); 
    2952 
    3053/** 
     
    6588 
    6689    /** 
    67      * @todo Implement testConstruct(). 
    68      */ 
    69     public function testConstruct() { 
    70         // Remove the following line when you implement this test. 
    71         throw new PHPUnit2_Framework_IncompleteTestError; 
    72     } 
    73  
    74     /** 
    75      * @todo Implement testJavascript_path(). 
     90     *  Test __construct() method 
     91     * 
     92     *  Test the {@link AssetTagHelper::__construct()} method 
     93     */ 
     94    public function test__construct() { 
     95        $ath = new AssetTagHelper;         
     96        $this->assertTrue(is_object($ath)); 
     97        $this->assertEquals('AssetTagHelper', get_class($ath)); 
     98        $this->assertEquals(array('this','that'), 
     99                            $ath->javascript_default_sources);         
     100    } 
     101 
     102    /** 
     103     *  Test javascript_path() method 
     104     * 
     105     *  Test the {@link AssetTagHelper::javascript_path()} method 
    76106     */ 
    77107    public function testJavascript_path() { 
    78         // Remove the following line when you implement this test. 
    79         throw new PHPUnit2_Framework_IncompleteTestError; 
    80     } 
    81  
    82     /** 
    83      * @todo Implement testJavascript_include_tag_method(). 
     108        $ath = new AssetTagHelper; 
     109        $this->assertEquals('/testprefix/javascripts/foo.js', 
     110                           $ath->javascript_path('foo')); 
     111        $this->assertEquals('/testprefix/javascripts/foo.bar', 
     112                           $ath->javascript_path('foo.bar')); 
     113        $this->assertEquals('/testprefix/foo.js', 
     114                           $ath->javascript_path('/foo')); 
     115        $this->assertEquals('http://foo/bar', 
     116                           $ath->javascript_path('http://foo/bar')); 
     117    } 
     118 
     119    /** 
     120     *  Test javascript_include_tag() method 
     121     * 
     122     *  Test the {@link AssetTagHelper::javascript_include_tag()} method 
    84123     */ 
    85124    public function testJavascript_include_tag_method() { 
    86         // Remove the following line when you implement this test. 
    87         throw new PHPUnit2_Framework_IncompleteTestError; 
    88     } 
    89  
    90     /** 
    91      * @todo Implement testJavascript_include_tag_function(). 
     125        $ath = new AssetTagHelper; 
     126        $this->assertEquals("<script src=\"/testprefix/javascripts/foo.js\"" 
     127                            . " type=\"text/javascript\"></script>\n", 
     128                           $ath->javascript_include_tag('foo')); 
     129        $this->assertEquals("<script src=\"/testprefix/javascripts/foo.js\"" 
     130                            . " type=\"text/javascript\"></script>\n" 
     131                            . "<script src=\"/testprefix/javascripts/bar.js\"" 
     132                            . " type=\"text/javascript\"></script>\n", 
     133                            $ath->javascript_include_tag('foo','bar')); 
     134        $this->assertEquals("<script src=\"/testprefix/javascripts/this.js\"" 
     135                            . " type=\"text/javascript\"></script>\n" 
     136                            . "<script src=\"/testprefix/javascripts/that.js\"" 
     137                            . " type=\"text/javascript\"></script>\n" 
     138                    . "<script src=\"/testprefix/javascripts/application.js\"" 
     139                            . " type=\"text/javascript\"></script>\n", 
     140                            $ath->javascript_include_tag('defaults')); 
     141    } 
     142 
     143    /** 
     144     *  Test the javascript_include_tag() function 
     145     * 
     146     *  Test the {@link javascript_include_tag()} function in 
     147     *  procedural file {@link asset_tag_helper.php} 
    92148     */ 
    93149    public function testJavascript_include_tag_function() { 
    94         // Remove the following line when you implement this test. 
    95         throw new PHPUnit2_Framework_IncompleteTestError; 
    96     } 
    97  
    98     /** 
    99      * @todo Implement testStylesheet_path(). 
     150        $this->assertEquals("<script src=\"/testprefix/javascripts/foo.js\"" 
     151                            . " type=\"text/javascript\"></script>\n", 
     152                            javascript_include_tag('foo')); 
     153    } 
     154 
     155    /** 
     156     *  Test stylesheet_path() method 
     157     * 
     158     *  Test the {@link AssetTagHelper::stylesheet_path()} method 
    100159     */ 
    101160    public function testStylesheet_path() { 
    102         // Remove the following line when you implement this test. 
    103         throw new PHPUnit2_Framework_IncompleteTestError; 
    104     } 
    105  
    106     /** 
    107      * @todo Implement testStylesheet_link_tag_method(). 
     161        $ath = new AssetTagHelper; 
     162        $this->assertEquals('/testprefix/stylesheets/foo.css', 
     163                           $ath->stylesheet_path('foo')); 
     164        $this->assertEquals('/testprefix/stylesheets/foo.bar', 
     165                           $ath->stylesheet_path('foo.bar')); 
     166        $this->assertEquals('/testprefix/foo.css', 
     167                           $ath->stylesheet_path('/foo')); 
     168        $this->assertEquals('http://foo/bar', 
     169                           $ath->stylesheet_path('http://foo/bar')); 
     170    } 
     171 
     172    /** 
     173     *  Test stylesheet_link_tag() method 
     174     * 
     175     *  Test the {@link AssetTagHelper::stylesheet_link_tag()} method 
    108176     */ 
    109177    public function testStylesheet_link_tag_method() { 
    110         // Remove the following line when you implement this test. 
    111         throw new PHPUnit2_Framework_IncompleteTestError; 
    112     } 
    113  
    114     /** 
    115      * @todo Implement testStylesheet_link_tag_function(). 
     178        $ath = new AssetTagHelper; 
     179        $this->assertEquals('<link href="/testprefix/stylesheets/foo.css"' 
     180                            . ' media="screen" rel="Stylesheet"' 
     181                            . ' type="text/css" />'."\n", 
     182                            $ath->stylesheet_link_tag("foo")); 
     183        $this->assertEquals('<link href="/testprefix/stylesheets/foo.css"' 
     184                            . ' media="screen" rel="Stylesheet"' 
     185                            . ' type="text/css" />'."\n" 
     186                            . '<link href="/testprefix/stylesheets/bar.css"' 
     187                            . ' media="screen" rel="Stylesheet"' 
     188                            . ' type="text/css" />'."\n", 
     189                            $ath->stylesheet_link_tag("foo","bar")); 
     190        $this->assertEquals('<link href="/testprefix/stylesheets/foo.css"' 
     191                            . ' media="screen" rel="Screenstyle"' 
     192                            . ' type="text/css" />'."\n", 
     193                            $ath->stylesheet_link_tag("foo", 
     194                                            array("rel"=>"Screenstyle"))); 
     195        $this->assertEquals('<link href="/testprefix/stylesheets/foo.css"' 
     196                            . ' media="all" rel="Stylesheet"' 
     197                            . ' type="text/css" />'."\n", 
     198                            $ath->stylesheet_link_tag("foo", 
     199                                                array("media"=>"all"))); 
     200        $this->assertEquals('<link href="/testprefix/stylesheets/foo.css"' 
     201                            . ' media="screen" rel="Stylesheet"' 
     202                            . ' type="text/plain" />'."\n", 
     203                            $ath->stylesheet_link_tag("foo", 
     204                                       array("type"=>"text/plain"))); 
     205        $this->assertEquals('<link href="/bar/mumble.css"' 
     206                            . ' media="screen" rel="Stylesheet"' 
     207                            . ' type="text/css" />'."\n", 
     208                            $ath->stylesheet_link_tag("foo", 
     209                                       array("href"=>"/bar/mumble.css"))); 
     210    } 
     211 
     212    /** 
     213     *  Test stylesheet_link_tag() function 
     214     * 
     215     *  Test the {@link stylesheet_link_tag()} function in procedural 
     216     *  file {@link asset_tag_helper.php} 
    116217     */ 
    117218    public function testStylesheet_link_tag_function() { 
    118         // Remove the following line when you implement this test. 
    119         throw new PHPUnit2_Framework_IncompleteTestError; 
    120     } 
    121  
    122     /** 
    123      * @todo Implement testImage_path(). 
     219        $this->assertEquals('<link href="/testprefix/stylesheets/foo.css"' 
     220                            . ' media="screen" rel="Stylesheet"' 
     221                            . ' type="text/css" />'."\n", 
     222                            stylesheet_link_tag("foo")); 
     223    } 
     224 
     225    /** 
     226     *  Test image_path() method 
     227     * 
     228     *  Test the {@link AssetTagHelper::image_path()} method 
    124229     */ 
    125230    public function testImage_path() { 
    126         // Remove the following line when you implement this test. 
    127         throw new PHPUnit2_Framework_IncompleteTestError; 
    128     } 
    129  
    130     /** 
    131      * @todo Implement testImage_tag_method(). 
     231        $ath = new AssetTagHelper; 
     232        $this->assertEquals('/testprefix/images/foo.png', 
     233                           $ath->image_path('foo')); 
     234        $this->assertEquals('/testprefix/images/foo.bar', 
     235                           $ath->image_path('foo.bar')); 
     236        $this->assertEquals('/testprefix/foo.png', 
     237                           $ath->image_path('/foo')); 
     238        $this->assertEquals('http://foo/bar', 
     239                           $ath->image_path('http://foo/bar')); 
     240    } 
     241 
     242    /** 
     243     *  Test image_tag() method 
     244     * 
     245     *  Test the {@link AssetTagHelper::image_tag()} method 
    132246     */ 
    133247    public function testImage_tag_method() { 
    134         // Remove the following line when you implement this test. 
    135         throw new PHPUnit2_Framework_IncompleteTestError; 
    136     } 
    137  
    138     /** 
    139      * @todo Implement testImage_tag_function(). 
     248        $ath = new AssetTagHelper; 
     249        $this->assertEquals('<img alt="Foo"' 
     250                            . ' src="/testprefix/images/foo.png" />'."\n", 
     251                           $ath->image_tag('foo')); 
     252        $this->assertEquals('<img alt="Bar"' 
     253                            . ' src="/testprefix/images/foo.png" />'."\n", 
     254                            $ath->image_tag('foo', array('alt' => 'Bar'))); 
     255        $this->assertEquals('<img alt="Foo" height="45"' 
     256                            . ' src="/testprefix/images/foo.png"' 
     257                            . ' width="30" />'."\n", 
     258                            $ath->image_tag('foo', array('width' => '30', 
     259                                                         'height' => '45'))); 
     260        $this->assertEquals('<img alt="Foo" height="45"' 
     261                            . ' src="/testprefix/images/foo.png"' 
     262                            . ' width="30" />'."\n", 
     263                            $ath->image_tag('foo', array('size' => '30x45'))); 
     264    } 
     265 
     266    /** 
     267     *  Test the image_tag() function 
     268     * 
     269     *  Test the {@link image_tag()} function in procedural file 
     270     *  {@link asset_helper.php} 
    140271     */ 
    141272    public function testImage_tag_function() { 
    142         // Remove the following line when you implement this test. 
    143         throw new PHPUnit2_Framework_IncompleteTestError; 
     273        $this->assertEquals('<img alt="Foo"' 
     274                            . ' src="/testprefix/images/foo.png" />'."\n", 
     275                           image_tag('foo')); 
    144276    } 
    145277 
     
    148280     */ 
    149281    public function testAuto_discovery_link_tag_method() { 
     282        $ath = new AssetTagHelper; 
    150283        // Remove the following line when you implement this test. 
    151284        throw new PHPUnit2_Framework_IncompleteTestError; 
  • trunk/trax/test/FormHelperTest.php

    r192 r199  
    6666 
    6767    /** 
    68      *  Empty test to prevent failure 
    69      *  @todo Write tests for FormHelper class 
    70      */ 
    71     public function testEmpty() { 
    72     } 
     68     *  Test __construct() method 
     69     */ 
     70    public function test__construct() { 
     71        $uh = new FormHelper; 
     72        $this->assertTrue(is_object($uh)); 
     73        $this->assertEquals('FormHelper', get_class($uh)); 
     74    } 
     75 
     76    /** 
     77     *  Test add_default_name_and_id() method 
     78     *  @todo Implement this test 
     79     */ 
     80    public function testAdd_default_name_and_id_method() { 
     81        // Remove the following line when you implement this test. 
     82        throw new PHPUnit2_Framework_IncompleteTestError; 
     83    } 
     84 
     85    /** 
     86     *  Test add_default_name_and_id() function 
     87     *  @todo Implement this test 
     88     */ 
     89    public function testAdd_default_name_and_id_function() { 
     90        // Remove the following line when you implement this test. 
     91        throw new PHPUnit2_Framework_IncompleteTestError; 
     92    } 
     93 
     94    /** 
     95     *  Test error_wrapping() method 
     96     *  @todo Implement this test 
     97     */ 
     98    public function testError_wrapping_method() { 
     99        // Remove the following line when you implement this test. 
     100        throw new PHPUnit2_Framework_IncompleteTestError; 
     101    } 
     102 
     103    /** 
     104     *  Test error_wrapping() function 
     105     *  @todo Implement this test 
     106     */ 
     107    public function testError_wrapping_function() { 
     108        // Remove the following line when you implement this test. 
     109        throw new PHPUnit2_Framework_IncompleteTestError; 
     110    } 
     111 
     112    /** 
     113     *  Test tag_id() method 
     114     *  @todo Implement this test 
     115     */ 
     116    public function testTag_id_method() { 
     117        // Remove the following line when you implement this test. 
     118        throw new PHPUnit2_Framework_IncompleteTestError; 
     119    } 
     120 
     121    /** 
     122     *  Test tag_id() function 
     123     *  @todo Implement this test 
     124     */ 
     125    public function testTag_id_function() { 
     126        // Remove the following line when you implement this test. 
     127        throw new PHPUnit2_Framework_IncompleteTestError; 
     128    } 
     129 
     130    /** 
     131     *  Test tag_id_with_index() method 
     132     *  @todo Implement this test 
     133     */ 
     134    public function testTag_id_with_index_method() { 
     135        // Remove the following line when you implement this test. 
     136        throw new PHPUnit2_Framework_IncompleteTestError; 
     137    } 
     138 
     139    /** 
     140     *  Test tag_id_with_index() function 
     141     *  @todo Implement this test 
     142     */ 
     143    public function testTag_id_with_index_function() { 
     144        // Remove the following line when you implement this test. 
     145        throw new PHPUnit2_Framework_IncompleteTestError; 
     146    } 
     147 
     148    /** 
     149     *  Test tag_name() method 
     150     *  @todo Implement this test 
     151     */ 
     152    public function testTag_name_method() { 
     153        // Remove the following line when you implement this test. 
     154        throw new PHPUnit2_Framework_IncompleteTestError; 
     155    } 
     156 
     157    /** 
     158     *  Test tag_name() function 
     159     *  @todo Implement this test 
     160     */ 
     161    public function testTag_name_function() { 
     162        // Remove the following line when you implement this test. 
     163        throw new PHPUnit2_Framework_IncompleteTestError; 
     164    } 
     165 
     166    /** 
     167     *  Test tag_name_with_index() method 
     168     *  @todo Implement this test 
     169     */ 
     170    public function testTag_name_with_index_method() { 
     171        // Remove the following line when you implement this test. 
     172        throw new PHPUnit2_Framework_IncompleteTestError; 
     173    } 
     174 
     175    /** 
     176     *  Test tag_name_with_index() function 
     177     *  @todo Implement this test 
     178     */ 
     179    public function testTag_name_with_index_function() { 
     180        // Remove the following line when you implement this test. 
     181        throw new PHPUnit2_Framework_IncompleteTestError; 
     182    } 
     183 
     184    /** 
     185     *  Test to_boolean_select_tag() method 
     186     *  @todo Implement this test 
     187     */ 
     188    public function testTo_boolean_select_tag_method() { 
     189        // Remove the following line when you implement this test. 
     190        throw new PHPUnit2_Framework_IncompleteTestError; 
     191    } 
     192 
     193    /** 
     194     *  Test to_boolean_select_tag() function 
     195     *  @todo Implement this test 
     196     */ 
     197    public function testTo_boolean_select_tag_function() { 
     198        // Remove the following line when you implement this test. 
     199        throw new PHPUnit2_Framework_IncompleteTestError; 
     200    } 
     201 
     202    /** 
     203     *  Test to_check_box_tag() method 
     204     *  @todo Implement this test 
     205     */ 
     206    public function testTo_check_box_tag_method() { 
     207        // Remove the following line when you implement this test. 
     208        throw new PHPUnit2_Framework_IncompleteTestError; 
     209    } 
     210 
     211    /** 
     212     *  Test to_check_box_tag() function 
     213     *  @todo Implement this test 
     214     */ 
     215    public function testTo_check_box_tag_function() { 
     216        // Remove the following line when you implement this test. 
     217        throw new PHPUnit2_Framework_IncompleteTestError; 
     218    } 
     219 
     220    /** 
     221     *  Test to_input_field_tag() method 
     222     *  @todo Implement this test 
     223     */ 
     224    public function testTo_input_field_tag_method() { 
     225        // Remove the following line when you implement this test. 
     226        throw new PHPUnit2_Framework_IncompleteTestError; 
     227    } 
     228 
     229    /** 
     230     *  Test to_input_field_tag() function 
     231     *  @todo Implement this test 
     232     */ 
     233    public function testTo_input_field_tag_function() { 
     234        // Remove the following line when you implement this test. 
     235        throw new PHPUnit2_Framework_IncompleteTestError; 
     236    } 
     237 
     238    /** 
     239     *  Test to_radio_button_tag() method 
     240     *  @todo Implement this test 
     241     */ 
     242    public function testTo_radio_button_tag_method() { 
     243        // Remove the following line when you implement this test. 
     244        throw new PHPUnit2_Framework_IncompleteTestError; 
     245    } 
     246 
     247    /** 
     248     *  Test to_radio_button_tag() function 
     249     *  @todo Implement this test 
     250     */ 
     251    public function testTo_radio_button_tag_function() { 
     252        // Remove the following line when you implement this test. 
     253        throw new PHPUnit2_Framework_IncompleteTestError; 
     254    } 
     255 
     256    /** 
     257     *  Test to_text_area_tag() method 
     258     *  @todo Implement this test 
     259     */ 
     260    public function testTo_text_area_tag_method() { 
     261        // Remove the following line when you implement this test. 
     262        throw new PHPUnit2_Framework_IncompleteTestError; 
     263    } 
     264 
     265    /** 
     266     *  Test to_text_area_tag() function 
     267     *  @todo Implement this test 
     268     */ 
     269    public function testTo_text_area_tag_function() { 
     270        // Remove the following line when you implement this test. 
     271        throw new PHPUnit2_Framework_IncompleteTestError; 
     272    } 
     273 
     274 
    73275} 
    74276 
  • trunk/trax/test/InflectorTest.php

    r192 r199  
    8080        $this->assertEquals(Inflector::singularize('orders'), 'order'); 
    8181        $this->assertEquals(Inflector::singularize('people'), 'person'); 
     82        $this->assertEquals(Inflector::singularize('processes'), 'process'); 
    8283        $this->assertEquals(Inflector::singularize('queries'), 'query'); 
    8384    } 
     
    126127        $this->assertEquals(Inflector::classify('people'), 'Person'); 
    127128        $this->assertEquals(Inflector::classify('queries'), 'Query'); 
     129        $this->assertEquals(Inflector::classify('accesses'), 'Access'); 
     130        echo Inflector::classify('Access')."\n"; 
    128131    } 
    129132 
  • trunk/trax/test/TraxGeneratorTest.php

    r198 r199  
    354354        ob_start(); 
    355355        $tg->generate_scaffold('PersonName', 'membership'); 
     356 
    356357        $output = ob_get_clean(); 
    357358        $this->assertContains('create', $output); 
  • trunk/trax/test/UrlHelperTest.php

    r192 r199  
    2626require_once "PHPUnit2/Framework/IncompleteTestError.php"; 
    2727 
     28define("TRAX_URL_PREFIX", "/testprefix"); 
     29 
    2830require_once "action_view/helpers.php"; 
    2931require_once "action_view/helpers/form_helper.php"; 
    30 require_once "action_view/helpers/form_options_helper.php"; 
     32require_once "action_view/helpers/url_helper.php"; 
     33 
     34//  parameters need by UrlHelper 
     35$_SERVER['HTTP_HOST'] = 'www.example.com'; 
     36$_SERVER['SERVER_PORT'] = '80'; 
     37$GLOBALS['current_controller_path'] = 'testcontrol'; 
    3138 
    3239/** 
     
    6774 
    6875    /** 
    69      *  Empty test to prevent failure 
    70      *  @todo Write test for the UrlHelper class 
    71      */ 
    72     public function testEmpty() { 
     76     *  Test __construct() method 
     77     */ 
     78    public function test__construct() { 
     79        $uh = new UrlHelper; 
     80        $this->assertTrue(is_object($uh)); 
     81        $this->assertEquals('UrlHelper', get_class($uh)); 
     82    } 
     83 
     84    /** 
     85     *  Test button_to() method 
     86     *  @todo Implement this test 
     87     */ 
     88    public function testButton_to_method() { 
     89        // Remove the following line when you implement this test. 
     90        throw new PHPUnit2_Framework_IncompleteTestError; 
     91    } 
     92 
     93    /** 
     94     *  Test button_to() function 
     95     *  @todo Implement this test 
     96     */ 
     97    public function testButton_to_function() { 
     98        // Remove the following line when you implement this test. 
     99        throw new PHPUnit2_Framework_IncompleteTestError; 
     100    } 
     101 
     102    /** 
     103     *  Test convert_boolean_attributes() method 
     104     *  @todo Implement this test 
     105     */ 
     106    public function testConvert_boolean_attributes() { 
     107        // Remove the following line when you implement this test. 
     108        throw new PHPUnit2_Framework_IncompleteTestError; 
     109    } 
     110 
     111    /** 
     112     *  Test convert_confirm_option_to_javascript() method 
     113     *  @todo Implement this test 
     114     */ 
     115    public function testConvert_confirm_option_to_javascript() { 
     116        // Remove the following line when you implement this test. 
     117        throw new PHPUnit2_Framework_IncompleteTestError; 
     118    } 
     119 
     120    /** 
     121     *  Test link_image_to() method 
     122     *  @todo Implement this test 
     123     */ 
     124    public function testLink_image_to_method() { 
     125        // Remove the following line when you implement this test. 
     126        throw new PHPUnit2_Framework_IncompleteTestError; 
     127    } 
     128 
     129    /** 
     130     *  Test link_image_to() function 
     131     *  @todo Implement this test 
     132     */ 
     133    public function testLink_image_to_function() { 
     134        // Remove the following line when you implement this test. 
     135        throw new PHPUnit2_Framework_IncompleteTestError; 
     136    } 
     137 
     138    /** 
     139     *  Test link_to() method 
     140     *  @todo Implement this test 
     141     */ 
     142    public function testLink_to_method() { 
     143        // Remove the following line when you implement this test. 
     144        throw new PHPUnit2_Framework_IncompleteTestError; 
     145    } 
     146 
     147    /** 
     148     *  Test link_to() function 
     149     *  @todo Implement this test 
     150     */ 
     151    public function testLink_to_function() { 
     152        // Remove the following line when you implement this test. 
     153        throw new PHPUnit2_Framework_IncompleteTestError; 
     154    } 
     155 
     156    /** 
     157     *  Test url_for() method 
     158     * 
     159     *  Thest the {@link UrlHelper::url_for()} method 
     160     */ 
     161    public function testUrl_for_method() { 
     162        $uh = new UrlHelper; 
     163        $this->assertEquals('http://www.example.com/testprefix/testcontrol', 
     164                            $uh->url_for()); 
     165        $this->assertEquals('http://www.example.com/testprefix/foocontrol', 
     166                            $uh->url_for(array(':controller'=>'foocontrol'))); 
     167        $this->assertEquals('http://www.example.com/testprefix' 
     168                            . '/barcontrol/fooaction', 
     169                            $uh->url_for(array(':controller'=>'barcontrol', 
     170                                               ':action'    =>'fooaction'))); 
     171        $this->assertEquals('http://www.example.com/testprefix' 
     172                            . '/barcontrol/baraction/fooid', 
     173                            $uh->url_for(array(':controller'=> 'barcontrol', 
     174                                               ':action'    => 'baraction', 
     175                                               ':id'        => 'fooid'))); 
     176    } 
     177 
     178    /** 
     179     *  Test url_for() function 
     180     * 
     181     *  Test the {@link url_for()} function in the {@link url_helper.php} 
     182     *  procedural file. 
     183     */ 
     184    public function testUrl_for_function() { 
     185        $this->assertEquals('http://www.example.com/testprefix/testcontrol', 
     186                            url_for()); 
    73187    } 
    74188} 
  • trunk/trax/test/config/routes.php

    • Property svn:keywords set to Id
  • trunk/trax/test/controllers/application.php

    • Property svn:keywords set to Id
    r192 r199  
    44 * 
    55 *  @package PHPonTraxTest 
     6 *  $Id$ 
    67 */ 
    78 
  • trunk/trax/test/controllers/catalog_controller.php

    • Property svn:keywords set to Id
  • trunk/trax/test/controllers/noclass_controller.php

    • Property svn:keywords set to Id
  • trunk/trax/test/mockActionController/action_controller.php

    • Property svn:keywords set to Id
  • trunk/trax/test/mockActiveRecord/active_record.php

    • Property svn:keywords set to Id
  • trunk/trax/test/testenv.php

    • Property svn:keywords set to Id
    r192 r199  
    88 * @license http://opensource.org/licenses/gpl-license.php GNU Public License 
    99 * @copyright (c) Walter O. Haas 2006 
    10  * @version $Id: TraxErrorTest.php 163 2006-03-07 16:44:21Z haas $ 
     10 * @version $Id$ 
    1111 * @author Walt Haas <haas@xmission.com> 
    1212 */