Exemplo n.º 1
0
 public function testEndDate()
 {
     $EndDate = new \DateTime('now');
     /*
      * Literals
      */
     // Day
     $anime = new Anime();
     $anime->setLiteralEndDate('', $EndDate, 'day');
     $verifyDate = $EndDate->format('Y-m-d');
     $this->assertEquals($verifyDate, $anime->getEndDate());
     // Month
     $anime = new Anime();
     $anime->setLiteralEndDate('', $EndDate, 'month');
     $verifyDate = $EndDate->format('Y-m');
     $this->assertEquals($verifyDate, $anime->getEndDate());
     // Day
     $anime = new Anime();
     $anime->setLiteralEndDate('', $EndDate, 'year');
     $verifyDate = $EndDate->format('Y');
     $this->assertEquals($verifyDate, $anime->getEndDate());
     /*
      * Normal Set
      */
     // Day
     $anime = new Anime();
     $anime->setEndDate($EndDate, 'day');
     $verifyDate = $EndDate->format('Y-m-d');
     $this->assertEquals($verifyDate, $anime->getEndDate());
     // Month
     $anime = new Anime();
     $anime->setEndDate($EndDate, 'month');
     $verifyDate = $EndDate->format('Y-m');
     $this->assertEquals($verifyDate, $anime->getEndDate());
     // Day
     $anime = new Anime();
     $anime->setEndDate($EndDate, 'year');
     $verifyDate = $EndDate->format('Y');
     $this->assertEquals($verifyDate, $anime->getEndDate());
 }