Make WordPress Core

Ticket #34688: 34688.2.patch

File 34688.2.patch, 1.4 KB (added by realloc, 10 years ago)

Tests for WP_Locale - Corrected patch

  • tests/phpunit/tests/locale.php

     
     1<?php
     2
     3/**
     4 * @group locale
     5 */
     6class Tests_Locale extends WP_UnitTestCase {
     7
     8        /**
     9         * Test WP_Locale's normal cases
     10         */
     11        function test_locale() {
     12                $locale = new WP_Locale();
     13
     14                $this->assertEquals( __( 'January' ), $locale->get_month( 1 ) );
     15                $this->assertEquals( __( 'February' ), $locale->get_month( '02' ) );
     16
     17                $this->assertEquals( __( 'Sunday' ), $locale->get_weekday( 0 ) );
     18                $this->assertEquals( __( 'S' ), $locale->get_weekday_initial( __( 'Sunday') ) );
     19                $this->assertEquals( __( 'Sun' ), $locale->get_weekday_abbrev( __( 'Sunday' ) ) );
     20
     21                $this->assertEquals( __( 'January' ), $locale->get_month( 1 ) );
     22                $this->assertEquals( __( 'Jan' ), $locale->get_month_abbrev( __( 'January' ) ) );
     23
     24                $this->assertEquals( __( 'am' ), $locale->get_meridiem( _('am') ) );
     25
     26                return $locale;
     27        }
     28
     29        /**
     30         * @param WP_Locale $locale
     31         * @depends test_locale
     32         */
     33        function test_rtl_src_admin_notice( $locale ) {
     34                $this->expectOutputRegex( '#<div class="error"><p>.*</p></div>#' );
     35                $locale->rtl_src_admin_notice();
     36        }
     37}