Changeset 9616 for trunk/tests/phpunit/testcases/core/functions.php
- Timestamp:
- 03/11/2015 07:48:42 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/testcases/core/functions.php
r9608 r9616 191 191 * @group bp_format_time 192 192 */ 193 public function test_bp_format_time_gmt_offset () {193 public function test_bp_format_time_gmt_offset_no_timezone_string() { 194 194 $time = 1395169200; 195 195 $gmt_offset = '-6'; … … 200 200 update_option( 'time_format', 'g:i a' ); 201 201 update_option( 'gmt_offset', $gmt_offset ); 202 delete_option( 'timezone_string' );202 update_option( 'timezone_string', '' ); 203 203 204 204 $this->assertEquals( 'March 18, 2014 at 1:00 pm', bp_format_time( $time, $just_date, $localize_time ) ); … … 208 208 * @group bp_format_time 209 209 */ 210 public function test_bp_format_time_timezone_string () {210 public function test_bp_format_time_timezone_string_no_gmt_offset() { 211 211 $time = 1395169200; 212 212 $timzone_string = 'America/Chicago'; … … 217 217 update_option( 'time_format', 'g:i a' ); 218 218 update_option( 'timezone_string', $timzone_string ); 219 delete_option( 'gmt_offset' ); 220 221 $this->assertEquals( 'March 18, 2014 at 1:00 pm', bp_format_time( $time, $just_date, $localize_time ) ); 219 update_option( 'gmt_offset', '0' ); 220 221 $this->assertEquals( 'March 18, 2014 at 2:00 pm', bp_format_time( $time, $just_date, $localize_time ) ); 222 } 223 224 /** 225 * @group bp_format_time 226 */ 227 public function test_bp_format_time_gmt_offset_no_localize() { 228 $time = 1395169200; 229 $gmt_offset = '-6'; 230 $just_date = false; 231 $localize_time = false; 232 233 update_option( 'date_format', 'F j, Y' ); 234 update_option( 'time_format', 'g:i a' ); 235 update_option( 'gmt_offset', $gmt_offset ); 236 update_option( 'timezone_string', '' ); 237 238 $this->assertEquals( 'March 18, 2014 at 7:00 pm', bp_format_time( $time, $just_date, $localize_time ) ); 239 } 240 241 /** 242 * @group bp_format_time 243 */ 244 public function test_bp_format_time_timezone_string_no_localize() { 245 $time = 1395169200; 246 $timzone_string = 'America/Chicago'; 247 $just_date = false; 248 $localize_time = false; 249 250 update_option( 'date_format', 'F j, Y' ); 251 update_option( 'time_format', 'g:i a' ); 252 update_option( 'timezone_string', $timzone_string ); 253 update_option( 'gmt_offset', '0' ); 254 255 $this->assertEquals( 'March 18, 2014 at 7:00 pm', bp_format_time( $time, $just_date, $localize_time ) ); 222 256 } 223 257
Note: See TracChangeset
for help on using the changeset viewer.