Browse Source

Fixing docblock and removing tests for code that was deleted

Jose Lorenzo Rodriguez 12 years ago
parent
commit
f3f072ae0b
2 changed files with 1 additions and 82 deletions
  1. 1 1
      src/Utility/Time.php
  2. 0 81
      tests/TestCase/Utility/TimeTest.php

+ 1 - 1
src/Utility/Time.php

@@ -182,7 +182,7 @@ class Time extends Carbon {
 
 /**
  * Returns either a relative or a formatted absolute date depending
- * on the difference between the current time this object.
+ * on the difference between the current time and this object.
  *
  * ### Options:
  *

+ 0 - 81
tests/TestCase/Utility/TimeTest.php

@@ -382,37 +382,6 @@ class TimeTest extends TestCase {
 	}
 
 /**
- * testToAtom method
- *
- * @return void
- */
-	public function testToAtom() {
-		$dateTime = new \DateTime;
-		$this->assertEquals($dateTime->format($dateTime::ATOM), $this->Time->toAtom($dateTime->getTimestamp()));
-	}
-
-/**
- * testToRss method
- *
- * @return void
- */
-	public function testToRss() {
-		$date = '2012-08-12 12:12:45';
-		$time = strtotime($date);
-		$this->assertEquals(date('r', $time), $this->Time->toRss($time));
-
-		$timezones = array('Europe/London', 'Europe/Brussels', 'UTC', 'America/Denver', 'America/Caracas', 'Asia/Kathmandu');
-		foreach ($timezones as $timezone) {
-			$yourTimezone = new \DateTimeZone($timezone);
-			$yourTime = new \DateTime($date, $yourTimezone);
-			$userOffset = $yourTimezone->getOffset($yourTime) / HOUR;
-			$time = $yourTime->format('U');
-			$this->assertEquals($yourTime->format('r'), $this->Time->toRss($time, $userOffset), "Failed on $timezone");
-			$this->assertEquals($yourTime->format('r'), $this->Time->toRss($time, $timezone), "Failed on $timezone");
-		}
-	}
-
-/**
  * testFormat method
  *
  * @return void
@@ -440,56 +409,6 @@ class TimeTest extends TestCase {
 	}
 
 /**
- * testIsToday method
- *
- * @return void
- */
-	public function testIsToday() {
-		$result = $this->Time->isToday('+1 day');
-		$this->assertFalse($result);
-		$result = $this->Time->isToday('+1 days');
-		$this->assertFalse($result);
-		$result = $this->Time->isToday('+0 day');
-		$this->assertTrue($result);
-		$result = $this->Time->isToday('-1 day');
-		$this->assertFalse($result);
-	}
-
-/**
- * testIsFuture method
- *
- * @return void
- */
-	public function testIsFuture() {
-		$this->assertTrue($this->Time->isFuture('+1 month'));
-		$this->assertTrue($this->Time->isFuture('+1 days'));
-		$this->assertTrue($this->Time->isFuture('+1 minute'));
-		$this->assertTrue($this->Time->isFuture('+1 second'));
-
-		$this->assertFalse($this->Time->isFuture('-1 second'));
-		$this->assertFalse($this->Time->isFuture('-1 day'));
-		$this->assertFalse($this->Time->isFuture('-1 week'));
-		$this->assertFalse($this->Time->isFuture('-1 month'));
-	}
-
-/**
- * testIsPast method
- *
- * @return void
- */
-	public function testIsPast() {
-		$this->assertFalse($this->Time->isPast('+1 month'));
-		$this->assertFalse($this->Time->isPast('+1 days'));
-		$this->assertFalse($this->Time->isPast('+1 minute'));
-		$this->assertFalse($this->Time->isPast('+1 second'));
-
-		$this->assertTrue($this->Time->isPast('-1 second'));
-		$this->assertTrue($this->Time->isPast('-1 day'));
-		$this->assertTrue($this->Time->isPast('-1 week'));
-		$this->assertTrue($this->Time->isPast('-1 month'));
-	}
-
-/**
  * testIsThisWeek method
  *
  * @return void