Permalink
Browse files

MINOR Removed PHP 5.2 check in DateTest

  • Loading branch information...
1 parent a2979f0 commit db657046392b6840fc7d357fb0d2978649f4379a @halkyon halkyon committed with halkyon Mar 31, 2012
Showing with 6 additions and 18 deletions.
  1. +6 −18 tests/model/DateTest.php
View
@@ -6,31 +6,19 @@
class DateTest extends SapphireTest {
protected $originalTZ;
-
+
function setUp() {
// Set timezone to support timestamp->date conversion.
- // We can't use date_default_timezone_set() as its not supported prior to PHP 5.2
-
- if (version_compare(PHP_VERSION, '5.2.0', '<')) {
- $this->originalTZ = ini_get('date.timezone');
- ini_set('date.timezone', 'Pacific/Auckland');
- } else {
- $this->originalTZ = date_default_timezone_get();
- date_default_timezone_set('Pacific/Auckland');
- }
+ $this->originalTZ = date_default_timezone_get();
+ date_default_timezone_set('Pacific/Auckland');
parent::setUp();
}
-
+
function tearDown() {
- if(version_compare(PHP_VERSION, '5.2.0', '<') ){
- ini_set('date.timezone',$this->originalTZ);
- } else {
- date_default_timezone_set($this->originalTZ);
- }
-
+ date_default_timezone_set($this->originalTZ);
parent::tearDown();
}
-
+
function testNiceDate() {
$this->assertEquals('31/03/2008', DBField::create('Date', 1206968400)->Nice(),
"Date->Nice() works with timestamp integers"

0 comments on commit db65704

Please sign in to comment.