/** * @return string recurrence-expansion-end */ public function setRecurrenceExpansionEnd($value) { if ($value != null) { $this->_params['recurrence-expansion-end'] = App\Util::formatTimestamp($value); } else { unset($this->_params['recurrence-expansion-end']); } return $this; }
public function testStartMinMaxParam() { $this->query->resetParameters(); $startMin = '2006-10-30'; $startMax = '2006-11-01'; $this->query->setUser(self::GOOGLE_DEVELOPER_CALENDAR); $this->query->setStartMin($startMin); $this->query->setStartMax($startMax); $this->assertTrue($this->query->startMin != null); $this->assertTrue($this->query->startMax != null); $this->assertEquals(App\Util::formatTimestamp($startMin), $this->query->getStartMin()); $this->assertEquals(App\Util::formatTimestamp($startMax), $this->query->getStartMax()); $this->query->startMin = null; $this->assertFalse($this->query->startMin != null); $this->query->startMax = null; $this->assertFalse($this->query->startMax != null); $this->query->user = null; $this->assertFalse($this->query->user != null); }
/** * @group ZF-11610 */ public function testFormatTimestepHandlesSmallUnixTimestampProperly() { $this->assertEquals('1970-01-01T00:02:03+00:00', App\Util::formatTimestamp(123)); }
public function testExceptionFormatTimestampInvalidOffsetHours() { $util = new App\Util(); try { $ts = App\Util::formatTimestamp('2007-06-05T02:51:12-ab:00'); } catch (App\Exception $e) { $this->assertEquals('Invalid timestamp: 2007-06-05T02:51:12-ab:00.', $e->getMessage()); return; } // Excetion not thrown, this is bad. $this->fail("Exception not thrown."); }