/** * PageTitleArgumentsContainYearAndMonthOfStartDate * * @return void */ public function testPageTitleArgumentsContainYearAndMonthOfStartDate() { $startDate = new \DateTime('16.04.2015'); $this->dateRangeMock->expects($this->exactly(2))->method('getStartDate')->will($this->returnValue($startDate)); $titleArguments = $this->sut->getResultListTitleArguments(); $this->assertSame(['2015', '04'], $titleArguments); }
/** * Performs archive search * * @param string $month Month, numeric 1-12 * @param int $year Year, numeric yyyy * * @ignorevalidation $month * @ignorevalidation $year * * @return void */ public function showAction($month, $year) { $this->search->setDateRange(DateRange::fromMonthAndYear($month, $year)); $this->search->setPageType(Type::fromString($this->settings['pageType'])); $pages = $this->pageRepository->findArchived($this->search); $this->view->assign('pages', $pages); $this->view->assign('search', $this->search); }
/** * Returns arguments for the list/result template title rendering * * @return array */ public function getResultListTitleArguments() { return [$this->dateRange->getStartDate()->format('Y'), $this->dateRange->getStartDate()->format('m')]; }