public function testAddsAnnouncement()
 {
     $text = 'text';
     $start = Date::Parse('2011-01-01', 'America/Chicago');
     $end = NullDate::Instance();
     $priority = 1;
     $announcement = Announcement::Create($text, $start, $end, $priority);
     $this->repository->Add($announcement);
     $this->assertEquals(new AddAnnouncementCommand($text, $start, $end, $priority), $this->db->_LastCommand);
 }
Exemplo n.º 2
0
 /**
  * @param string $databaseValue
  * @return Date
  */
 public static function FromDatabase($databaseValue)
 {
     if (empty($databaseValue)) {
         return NullDate::Instance();
     }
     return Date::Parse($databaseValue, 'UTC');
 }
Exemplo n.º 3
0
 public function Date()
 {
     return NullDate::Instance();
 }
Exemplo n.º 4
0
 public function testNullDateTests()
 {
     $null = NullDate::Instance();
     $this->assertNull($null->ToDatabase());
     $this->assertEquals($null, $null->ToTimezone('anything'));
 }