JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
clean up include paths and docs
[wfpl.git] / unit_tests / misc.php
1 <?php
2
3 #  Copyright (C) 2009 Jason Woofenden
4 #
5 #  This program is free software: you can redistribute it and/or modify
6 #  it under the terms of the GNU General Public License as published by
7 #  the Free Software Foundation, either version 3 of the License, or
8 #  (at your option) any later version.
9 #
10 #  This program is distributed in the hope that it will be useful,
11 #  but WITHOUT ANY WARRANTY; without even the implied warranty of
12 #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 #  GNU General Public License for more details.
14 #
15 #  You should have received a copy of the GNU General Public License
16 #  along with this program.  If not, see <http://www.gnu.org/licenses/>.
17
18
19 # This file contains tests for functions in wfpl/misc.php
20 #
21 # See wfpl/unit_tests.php for details on how to run or create tests
22
23
24 require_once(__DIR__.'/../'.'misc.php');
25
26 function test_ordinalize() {
27         $tests = array(
28                 '', '',
29                 0, "0th",
30                 1, "1st",
31                 2, "2nd",
32                 3, "3rd",
33                 4, "4th",
34                 5, "5th",
35                 6, "6th",
36                 7, "7th",
37                 8, "8th",
38                 9, "9th",
39                 10, "10th",
40                 11, "11th",
41                 12, "12th",
42                 13, "13th",
43                 14, "14th",
44                 15, "15th",
45                 16, "16th",
46                 17, "17th",
47                 18, "18th",
48                 19, "19th",
49                 20, "20th",
50                 21, "21st",
51                 22, "22nd",
52                 23, "23rd",
53                 24, "24th",
54                 25, "25th",
55                 26, "26th",
56                 27, "27th",
57                 111, "111th",
58                 "62", "62nd");
59         for($i = 0; $i < count($tests); $i += 2) {
60                 $arg = $tests[$i];
61                 $correct = $tests[$i + 1];
62                 unit_test_func('ordinalize', $arg, $correct);
63         }
64 }
65
66 function misc_unit_tests_main() {
67         test_ordinalize();
68 }