/**
  * testNice method
  *
  * @return void
  */
 public function testNice()
 {
     $time = time() + 2 * DAY;
     $this->assertEquals(date('D, M jS Y, H:i', $time), $this->Time->nice($time));
     $time = time() - 2 * DAY;
     $this->assertEquals(date('D, M jS Y, H:i', $time), $this->Time->nice($time));
     $time = time();
     $this->assertEquals(date('D, M jS Y, H:i', $time), $this->Time->nice($time));
     $time = 0;
     $this->assertEquals(date('D, M jS Y, H:i', time()), $this->Time->nice($time));
     $time = null;
     $this->assertEquals(date('D, M jS Y, H:i', time()), $this->Time->nice($time));
     $time = time();
     $this->assertEquals(date('D', $time), $this->Time->nice($time, null, '%a'));
     $this->assertEquals(date('M d, Y', $time), $this->Time->nice($time, null, '%b %d, %Y'));
     $this->Time->niceFormat = '%Y-%d-%m';
     $this->assertEquals(date('Y-d-m', $time), $this->Time->nice($time));
     $this->assertEquals('%Y-%d-%m', $this->Time->niceFormat);
     CakeTime::$niceFormat = '%Y-%d-%m %H:%M';
     $this->assertEquals(date('Y-d-m H:i', $time), $this->Time->nice($time));
     $this->assertEquals('%Y-%d-%m %H:%M', $this->Time->niceFormat);
     date_default_timezone_set('UTC');
     $result = $this->Time->nice(null, 'America/New_York');
     $expected = $this->Time->nice(time(), 'America/New_York');
     $this->assertEquals(substr($expected, 0, -1), substr($result, 0, -1));
     $this->_restoreSystemTimezone();
 }
 /**
  * testNice method
  *
  * @return void
  */
 public function testNice()
 {
     $time = time() + 2 * DAY;
     $this->assertEquals(date('D, M jS Y, H:i', $time), $this->Time->nice($time));
     $time = time() - 2 * DAY;
     $this->assertEquals(date('D, M jS Y, H:i', $time), $this->Time->nice($time));
     $time = time();
     $this->assertEquals(date('D, M jS Y, H:i', $time), $this->Time->nice($time));
     $time = 0;
     $this->assertEquals(date('D, M jS Y, H:i', time()), $this->Time->nice($time));
     $time = null;
     $this->assertEquals(date('D, M jS Y, H:i', time()), $this->Time->nice($time));
     $time = time();
     $this->assertEquals(date('D', $time), $this->Time->nice($time, null, '%a'));
     $this->assertEquals(date('M d, Y', $time), $this->Time->nice($time, null, '%b %d, %Y'));
     $this->Time->niceFormat = '%Y-%d-%m';
     $this->assertEquals(date('Y-d-m', $time), $this->Time->nice($time));
     $this->assertEquals('%Y-%d-%m', $this->Time->niceFormat);
     CakeTime::$niceFormat = '%Y-%d-%m %H:%M:%S';
     $this->assertEquals(date('Y-d-m H:i:s', $time), $this->Time->nice($time));
     $this->assertEquals('%Y-%d-%m %H:%M:%S', $this->Time->niceFormat);
 }