PhpSpreadsheet/unitTests/Classes/src/Shared/TimeZoneTest.php

30 lines
817 B
PHP
Raw Normal View History

<?php
2016-03-22 14:35:50 +00:00
namespace PHPExcel\Shared;
2016-03-22 14:35:50 +00:00
class TimeZoneTest extends \PHPUnit_Framework_TestCase
{
2015-05-17 13:00:02 +00:00
public function testSetTimezone()
{
$timezoneValues = array(
'Europe/Prague',
'Asia/Tokyo',
'America/Indiana/Indianapolis',
'Pacific/Honolulu',
'Atlantic/St_Helena',
);
foreach ($timezoneValues as $timezoneValue) {
2016-03-22 14:19:00 +00:00
$result = call_user_func(array('\PHPExcel\Shared\TimeZone','setTimezone'), $timezoneValue);
2015-05-17 13:00:02 +00:00
$this->assertTrue($result);
}
}
public function testSetTimezoneWithInvalidValue()
2015-05-17 13:00:02 +00:00
{
$unsupportedTimezone = 'Etc/GMT+10';
2016-03-22 14:19:00 +00:00
$result = call_user_func(array('\PHPExcel\Shared\TimeZone','setTimezone'), $unsupportedTimezone);
2015-05-17 13:00:02 +00:00
$this->assertFalse($result);
}
}