Changeset 48937 for trunk/tests/phpunit/tests/locale.php
- Timestamp:
- 09/02/2020 12:35:36 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/locale.php
r46586 r48937 17 17 18 18 public function test_get_weekday() { 19 $this->assert Equals( __( 'Sunday' ), $this->locale->get_weekday( 0 ) );20 $this->assert Equals( __( 'Monday' ), $this->locale->get_weekday( 1 ) );21 $this->assert Equals( __( 'Tuesday' ), $this->locale->get_weekday( 2 ) );22 $this->assert Equals( __( 'Wednesday' ), $this->locale->get_weekday( 3 ) );23 $this->assert Equals( __( 'Thursday' ), $this->locale->get_weekday( 4 ) );24 $this->assert Equals( __( 'Friday' ), $this->locale->get_weekday( 5 ) );25 $this->assert Equals( __( 'Saturday' ), $this->locale->get_weekday( 6 ) );19 $this->assertSame( __( 'Sunday' ), $this->locale->get_weekday( 0 ) ); 20 $this->assertSame( __( 'Monday' ), $this->locale->get_weekday( 1 ) ); 21 $this->assertSame( __( 'Tuesday' ), $this->locale->get_weekday( 2 ) ); 22 $this->assertSame( __( 'Wednesday' ), $this->locale->get_weekday( 3 ) ); 23 $this->assertSame( __( 'Thursday' ), $this->locale->get_weekday( 4 ) ); 24 $this->assertSame( __( 'Friday' ), $this->locale->get_weekday( 5 ) ); 25 $this->assertSame( __( 'Saturday' ), $this->locale->get_weekday( 6 ) ); 26 26 } 27 27 … … 34 34 35 35 public function test_get_weekday_initial() { 36 $this->assert Equals( __( 'S' ), $this->locale->get_weekday_initial( __( 'Sunday' ) ) );37 $this->assert Equals( __( 'M' ), $this->locale->get_weekday_initial( __( 'Monday' ) ) );38 $this->assert Equals( __( 'T' ), $this->locale->get_weekday_initial( __( 'Tuesday' ) ) );39 $this->assert Equals( __( 'W' ), $this->locale->get_weekday_initial( __( 'Wednesday' ) ) );40 $this->assert Equals( __( 'T' ), $this->locale->get_weekday_initial( __( 'Thursday' ) ) );41 $this->assert Equals( __( 'F' ), $this->locale->get_weekday_initial( __( 'Friday' ) ) );42 $this->assert Equals( __( 'S' ), $this->locale->get_weekday_initial( __( 'Saturday' ) ) );36 $this->assertSame( __( 'S' ), $this->locale->get_weekday_initial( __( 'Sunday' ) ) ); 37 $this->assertSame( __( 'M' ), $this->locale->get_weekday_initial( __( 'Monday' ) ) ); 38 $this->assertSame( __( 'T' ), $this->locale->get_weekday_initial( __( 'Tuesday' ) ) ); 39 $this->assertSame( __( 'W' ), $this->locale->get_weekday_initial( __( 'Wednesday' ) ) ); 40 $this->assertSame( __( 'T' ), $this->locale->get_weekday_initial( __( 'Thursday' ) ) ); 41 $this->assertSame( __( 'F' ), $this->locale->get_weekday_initial( __( 'Friday' ) ) ); 42 $this->assertSame( __( 'S' ), $this->locale->get_weekday_initial( __( 'Saturday' ) ) ); 43 43 } 44 44 45 45 public function test_get_weekday_abbrev() { 46 $this->assert Equals( __( 'Sun' ), $this->locale->get_weekday_abbrev( __( 'Sunday' ) ) );47 $this->assert Equals( __( 'Mon' ), $this->locale->get_weekday_abbrev( __( 'Monday' ) ) );48 $this->assert Equals( __( 'Tue' ), $this->locale->get_weekday_abbrev( __( 'Tuesday' ) ) );49 $this->assert Equals( __( 'Wed' ), $this->locale->get_weekday_abbrev( __( 'Wednesday' ) ) );50 $this->assert Equals( __( 'Thu' ), $this->locale->get_weekday_abbrev( __( 'Thursday' ) ) );51 $this->assert Equals( __( 'Fri' ), $this->locale->get_weekday_abbrev( __( 'Friday' ) ) );52 $this->assert Equals( __( 'Sat' ), $this->locale->get_weekday_abbrev( __( 'Saturday' ) ) );46 $this->assertSame( __( 'Sun' ), $this->locale->get_weekday_abbrev( __( 'Sunday' ) ) ); 47 $this->assertSame( __( 'Mon' ), $this->locale->get_weekday_abbrev( __( 'Monday' ) ) ); 48 $this->assertSame( __( 'Tue' ), $this->locale->get_weekday_abbrev( __( 'Tuesday' ) ) ); 49 $this->assertSame( __( 'Wed' ), $this->locale->get_weekday_abbrev( __( 'Wednesday' ) ) ); 50 $this->assertSame( __( 'Thu' ), $this->locale->get_weekday_abbrev( __( 'Thursday' ) ) ); 51 $this->assertSame( __( 'Fri' ), $this->locale->get_weekday_abbrev( __( 'Friday' ) ) ); 52 $this->assertSame( __( 'Sat' ), $this->locale->get_weekday_abbrev( __( 'Saturday' ) ) ); 53 53 } 54 54 55 55 public function test_get_month() { 56 $this->assert Equals( __( 'January' ), $this->locale->get_month( 1 ) );57 $this->assert Equals( __( 'February' ), $this->locale->get_month( 2 ) );58 $this->assert Equals( __( 'March' ), $this->locale->get_month( 3 ) );59 $this->assert Equals( __( 'April' ), $this->locale->get_month( 4 ) );60 $this->assert Equals( __( 'May' ), $this->locale->get_month( 5 ) );61 $this->assert Equals( __( 'June' ), $this->locale->get_month( 6 ) );62 $this->assert Equals( __( 'July' ), $this->locale->get_month( 7 ) );63 $this->assert Equals( __( 'August' ), $this->locale->get_month( 8 ) );64 $this->assert Equals( __( 'September' ), $this->locale->get_month( 9 ) );65 $this->assert Equals( __( 'October' ), $this->locale->get_month( 10 ) );66 $this->assert Equals( __( 'November' ), $this->locale->get_month( 11 ) );67 $this->assert Equals( __( 'December' ), $this->locale->get_month( 12 ) );56 $this->assertSame( __( 'January' ), $this->locale->get_month( 1 ) ); 57 $this->assertSame( __( 'February' ), $this->locale->get_month( 2 ) ); 58 $this->assertSame( __( 'March' ), $this->locale->get_month( 3 ) ); 59 $this->assertSame( __( 'April' ), $this->locale->get_month( 4 ) ); 60 $this->assertSame( __( 'May' ), $this->locale->get_month( 5 ) ); 61 $this->assertSame( __( 'June' ), $this->locale->get_month( 6 ) ); 62 $this->assertSame( __( 'July' ), $this->locale->get_month( 7 ) ); 63 $this->assertSame( __( 'August' ), $this->locale->get_month( 8 ) ); 64 $this->assertSame( __( 'September' ), $this->locale->get_month( 9 ) ); 65 $this->assertSame( __( 'October' ), $this->locale->get_month( 10 ) ); 66 $this->assertSame( __( 'November' ), $this->locale->get_month( 11 ) ); 67 $this->assertSame( __( 'December' ), $this->locale->get_month( 12 ) ); 68 68 } 69 69 70 70 public function test_get_month_leading_zero() { 71 $this->assert Equals( __( 'January' ), $this->locale->get_month( '01' ) );72 $this->assert Equals( __( 'February' ), $this->locale->get_month( '02' ) );73 $this->assert Equals( __( 'March' ), $this->locale->get_month( '03' ) );74 $this->assert Equals( __( 'April' ), $this->locale->get_month( '04' ) );75 $this->assert Equals( __( 'May' ), $this->locale->get_month( '05' ) );76 $this->assert Equals( __( 'June' ), $this->locale->get_month( '06' ) );77 $this->assert Equals( __( 'July' ), $this->locale->get_month( '07' ) );78 $this->assert Equals( __( 'August' ), $this->locale->get_month( '08' ) );79 $this->assert Equals( __( 'September' ), $this->locale->get_month( '09' ) );71 $this->assertSame( __( 'January' ), $this->locale->get_month( '01' ) ); 72 $this->assertSame( __( 'February' ), $this->locale->get_month( '02' ) ); 73 $this->assertSame( __( 'March' ), $this->locale->get_month( '03' ) ); 74 $this->assertSame( __( 'April' ), $this->locale->get_month( '04' ) ); 75 $this->assertSame( __( 'May' ), $this->locale->get_month( '05' ) ); 76 $this->assertSame( __( 'June' ), $this->locale->get_month( '06' ) ); 77 $this->assertSame( __( 'July' ), $this->locale->get_month( '07' ) ); 78 $this->assertSame( __( 'August' ), $this->locale->get_month( '08' ) ); 79 $this->assertSame( __( 'September' ), $this->locale->get_month( '09' ) ); 80 80 } 81 81 82 82 public function test_get_month_abbrev() { 83 $this->assert Equals( __( 'Jan' ), $this->locale->get_month_abbrev( __( 'January' ) ) );84 $this->assert Equals( __( 'Feb' ), $this->locale->get_month_abbrev( __( 'February' ) ) );85 $this->assert Equals( __( 'Mar' ), $this->locale->get_month_abbrev( __( 'March' ) ) );86 $this->assert Equals( __( 'Apr' ), $this->locale->get_month_abbrev( __( 'April' ) ) );87 $this->assert Equals( __( 'May' ), $this->locale->get_month_abbrev( __( 'May' ) ) );88 $this->assert Equals( __( 'Jun' ), $this->locale->get_month_abbrev( __( 'June' ) ) );89 $this->assert Equals( __( 'Jul' ), $this->locale->get_month_abbrev( __( 'July' ) ) );90 $this->assert Equals( __( 'Aug' ), $this->locale->get_month_abbrev( __( 'August' ) ) );91 $this->assert Equals( __( 'Sep' ), $this->locale->get_month_abbrev( __( 'September' ) ) );92 $this->assert Equals( __( 'Oct' ), $this->locale->get_month_abbrev( __( 'October' ) ) );93 $this->assert Equals( __( 'Nov' ), $this->locale->get_month_abbrev( __( 'November' ) ) );94 $this->assert Equals( __( 'Dec' ), $this->locale->get_month_abbrev( __( 'December' ) ) );83 $this->assertSame( __( 'Jan' ), $this->locale->get_month_abbrev( __( 'January' ) ) ); 84 $this->assertSame( __( 'Feb' ), $this->locale->get_month_abbrev( __( 'February' ) ) ); 85 $this->assertSame( __( 'Mar' ), $this->locale->get_month_abbrev( __( 'March' ) ) ); 86 $this->assertSame( __( 'Apr' ), $this->locale->get_month_abbrev( __( 'April' ) ) ); 87 $this->assertSame( __( 'May' ), $this->locale->get_month_abbrev( __( 'May' ) ) ); 88 $this->assertSame( __( 'Jun' ), $this->locale->get_month_abbrev( __( 'June' ) ) ); 89 $this->assertSame( __( 'Jul' ), $this->locale->get_month_abbrev( __( 'July' ) ) ); 90 $this->assertSame( __( 'Aug' ), $this->locale->get_month_abbrev( __( 'August' ) ) ); 91 $this->assertSame( __( 'Sep' ), $this->locale->get_month_abbrev( __( 'September' ) ) ); 92 $this->assertSame( __( 'Oct' ), $this->locale->get_month_abbrev( __( 'October' ) ) ); 93 $this->assertSame( __( 'Nov' ), $this->locale->get_month_abbrev( __( 'November' ) ) ); 94 $this->assertSame( __( 'Dec' ), $this->locale->get_month_abbrev( __( 'December' ) ) ); 95 95 } 96 96 97 97 public function test_get_meridiem() { 98 $this->assert Equals( __( 'am' ), $this->locale->get_meridiem( 'am' ) );99 $this->assert Equals( __( 'AM' ), $this->locale->get_meridiem( 'AM' ) );100 $this->assert Equals( __( 'pm' ), $this->locale->get_meridiem( 'pm' ) );101 $this->assert Equals( __( 'PM' ), $this->locale->get_meridiem( 'PM' ) );98 $this->assertSame( __( 'am' ), $this->locale->get_meridiem( 'am' ) ); 99 $this->assertSame( __( 'AM' ), $this->locale->get_meridiem( 'AM' ) ); 100 $this->assertSame( __( 'pm' ), $this->locale->get_meridiem( 'pm' ) ); 101 $this->assertSame( __( 'PM' ), $this->locale->get_meridiem( 'PM' ) ); 102 102 } 103 103
Note: See TracChangeset
for help on using the changeset viewer.