 aed27a0bed
			
		
	
	
		aed27a0bed
		
	
	
	
	
		
			
			Use the `PHPUnit\Framework\TestCase` notation instead of `PHPUnit_Framework_TestCase` while extending our TestCases. This will help us migrate to PHPUnit 6, that [no longer support snake case class names](https://github.com/sebastianbergmann/phpunit/blob/master/ChangeLog-6.0.md#changed-1).
		
			
				
	
	
		
			33 lines
		
	
	
		
			805 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			33 lines
		
	
	
		
			805 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
| <?php
 | |
| 
 | |
| namespace PhpOffice\PhpSpreadsheetTests\Shared;
 | |
| 
 | |
| use PhpOffice\PhpSpreadsheet\Shared\TimeZone;
 | |
| use PHPUnit\Framework\TestCase;
 | |
| 
 | |
| class TimeZoneTest extends TestCase
 | |
| {
 | |
|     public function testSetTimezone()
 | |
|     {
 | |
|         $timezoneValues = [
 | |
|             'Europe/Prague',
 | |
|             'Asia/Tokyo',
 | |
|             'America/Indiana/Indianapolis',
 | |
|             'Pacific/Honolulu',
 | |
|             'Atlantic/St_Helena',
 | |
|         ];
 | |
| 
 | |
|         foreach ($timezoneValues as $timezoneValue) {
 | |
|             $result = TimeZone::setTimezone($timezoneValue);
 | |
|             self::assertTrue($result);
 | |
|         }
 | |
|     }
 | |
| 
 | |
|     public function testSetTimezoneWithInvalidValue()
 | |
|     {
 | |
|         $unsupportedTimezone = 'Etc/GMT+10';
 | |
|         $result = TimeZone::setTimezone($unsupportedTimezone);
 | |
|         self::assertFalse($result);
 | |
|     }
 | |
| }
 |