Changeset 48937 for trunk/tests/phpunit/tests/date/dateI18n.php
- Timestamp:
- 09/02/2020 12:35:36 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/date/dateI18n.php
r46586 r48937 34 34 $rfc3339 = $datetime->format( DATE_RFC3339 ); 35 35 36 $this->assert Equals( 0, date_i18n( 'U', 0 ) );37 $this->assert Equals( $rfc3339, date_i18n( DATE_RFC3339, 0 ) );36 $this->assertSame( 0, date_i18n( 'U', 0 ) ); 37 $this->assertSame( $rfc3339, date_i18n( DATE_RFC3339, 0 ) ); 38 38 } 39 39 … … 43 43 44 44 public function test_should_use_custom_timestamp() { 45 $this->assert Equals( '2012-12-01 00:00:00', date_i18n( 'Y-m-d H:i:s', strtotime( '2012-12-01 00:00:00' ) ) );45 $this->assertSame( '2012-12-01 00:00:00', date_i18n( 'Y-m-d H:i:s', strtotime( '2012-12-01 00:00:00' ) ) ); 46 46 } 47 47 … … 65 65 update_option( 'timezone_string', 'America/Regina' ); 66 66 67 $this->assert Equals( '2012-12-01 00:00:00', date_i18n( 'Y-m-d H:i:s', strtotime( '2012-12-01 00:00:00' ) ) );67 $this->assertSame( '2012-12-01 00:00:00', date_i18n( 'Y-m-d H:i:s', strtotime( '2012-12-01 00:00:00' ) ) ); 68 68 } 69 69 … … 88 88 $GLOBALS['wp_locale'] = $original_locale; 89 89 90 $this->assert Equals( $expected, $actual );90 $this->assertSame( $expected, $actual ); 91 91 } 92 92 … … 94 94 update_option( 'timezone_string', 'America/Regina' ); 95 95 96 $this->assert Equals( '2012-12-01 00:00:00 CST -06:00 America/Regina', date_i18n( 'Y-m-d H:i:s T P e', strtotime( '2012-12-01 00:00:00' ) ) );96 $this->assertSame( '2012-12-01 00:00:00 CST -06:00 America/Regina', date_i18n( 'Y-m-d H:i:s T P e', strtotime( '2012-12-01 00:00:00' ) ) ); 97 97 } 98 98 … … 111 111 $datetime = new DateTime( $datetime->format( 'P' ) ); 112 112 113 $this->assert Equals( $datetime->format( $timezone_formats ), date_i18n( $timezone_formats ) );113 $this->assertSame( $datetime->format( $timezone_formats ), date_i18n( $timezone_formats ) ); 114 114 } 115 115 … … 123 123 124 124 $this->assertEquals( strtotime( date_i18n( $full ) ), strtotime( date_i18n( $short ) ), 'The dates should be equal', 2 ); 125 $this->assert Equals( $short, date_i18n( '\\' . $short ) );125 $this->assertSame( $short, date_i18n( '\\' . $short ) ); 126 126 } 127 127 … … 151 151 $this->assertEquals( $wp_timestamp, date_i18n( 'U' ), 'The dates should be equal', 2 ); 152 152 $this->assertEquals( $timestamp, date_i18n( 'U', false, true ), 'The dates should be equal', 2 ); 153 $this->assert Equals( $wp_timestamp, date_i18n( 'U', $wp_timestamp ) );153 $this->assertSame( $wp_timestamp, date_i18n( 'U', $wp_timestamp ) ); 154 154 } 155 155 … … 160 160 update_option( 'timezone_string', 'America/Regina' ); 161 161 162 $this->assert Equals( gmdate( 'B' ), date_i18n( 'B' ) );162 $this->assertSame( gmdate( 'B' ), date_i18n( 'B' ) ); 163 163 } 164 164 … … 169 169 $format = 'D | \D | \\D | \\\D | \\\\D | \\\\\D | \\\\\\D'; 170 170 171 $this->assert Equals( gmdate( $format ), date_i18n( $format ) );171 $this->assertSame( gmdate( $format ), date_i18n( $format ) ); 172 172 } 173 173 … … 188 188 $format = 'I ' . DATE_RFC3339; 189 189 190 $this->assert Equals( $datetime->format( $format ), date_i18n( $format, $wp_timestamp ) );190 $this->assertSame( $datetime->format( $format ), date_i18n( $format, $wp_timestamp ) ); 191 191 } 192 192
Note: See TracChangeset
for help on using the changeset viewer.