Changeset 46569 for trunk/tests/phpunit/tests/date/wpDate.php
- Timestamp:
- 10/22/2019 05:29:02 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/date/wpDate.php
r45914 r46569 7 7 class Tests_Date_WP_Date extends WP_UnitTestCase { 8 8 9 /** @var WP_Locale */ 10 private $wp_locale_original; 11 12 public function setUp() { 13 global $wp_locale; 14 15 parent::setUp(); 16 17 $this->wp_locale_original = clone $wp_locale; 18 } 19 20 public function tearDown() { 21 global $wp_locale; 22 23 $wp_locale = $this->wp_locale_original; 24 25 parent::tearDown(); 26 } 27 9 28 /** 10 29 * @ticket 28636 … … 13 32 $this->assertFalse( wp_date( DATE_RFC3339, 'invalid' ) ); 14 33 } 34 35 /** 36 * @ticket 48319 37 */ 38 public function test_should_not_escape_localized_numbers() { 39 global $wp_locale; 40 41 $wp_locale->month = array( 10 => '10月' ); 42 43 $utc = new DateTimeZone( 'UTC' ); 44 $datetime = new DateTimeImmutable( '2019-10-17', $utc ); 45 46 $this->assertEquals( '10月', wp_date( 'F', $datetime->getTimestamp(), $utc ) ); 47 } 48 49 /** 50 * @ticket 48319 51 */ 52 public function test_should_keep_localized_slashes() { 53 global $wp_locale; 54 55 $string = 'A \ B'; 56 $wp_locale->month = array( 10 => $string ); 57 58 $utc = new DateTimeZone( 'UTC' ); 59 $datetime = new DateTimeImmutable( '2019-10-17', $utc ); 60 61 $this->assertEquals( $string, wp_date( 'F', $datetime->getTimestamp(), $utc ) ); 62 } 15 63 }
Note: See TracChangeset
for help on using the changeset viewer.