/**
  * @Template
  */
 public function listByDayAction($year, $month, $day)
 {
     $day = new \DateTime("{$year}-{$month}-{$day}");
     $events = $this->getCalendar()->findAllByDay($day);
     $collection = new EventCollection($events);
     return array('events' => $collection, 'current' => $day, 'next' => DatesTransformer::nextDay($day), 'previous' => DatesTransformer::previousDay($day));
 }
 /**
  * @test
  */
 public function itBringsThePreviousDay()
 {
     // Arrange
     $reference_date = new \DateTime('2013-05-01');
     // Act
     $previous_day = DatesTransformer::previousDay($reference_date);
     // Assert
     $this->assertEquals('2013-04-30', $previous_day->format('Y-m-d'));
 }