Skip to content
Snippets Groups Projects
Commit 3003f3fa authored by Jaime Perez Crespo's avatar Jaime Perez Crespo
Browse files

Fix mistake in the test just added.

parent b31d663c
No related branches found
No related tags found
No related merge requests found
......@@ -30,14 +30,15 @@ class TimeTest extends \PHPUnit_Framework_TestCase
public function testInitTimezon()
{
$tz = 'UTC';
if (@date_default_timezone_get() === 'UTC') { // avoid collisions
$os = @date_default_timezone_get();
if ($os === 'UTC') { // avoid collisions
$tz = 'Europe/Oslo';
}
// test guessing timezone from the OS
\SimpleSAML_Configuration::loadFromArray(array('timezone' => 'Europe/Madrid'), '[ARRAY]', 'simplesaml');
\SimpleSAML_Configuration::loadFromArray(array('timezone' => null), '[ARRAY]', 'simplesaml');
@Time::initTimezone();
$this->assertEquals('Europe/Madrid', @date_default_timezone_get());
$this->assertEquals($os, @date_default_timezone_get());
// clear initialization
$c = new \ReflectionProperty('\SimpleSAML\Utils\Time', 'tz_initialized');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment