Example #1
0
 public function testBeforeSave()
 {
     $this->pageMock->expects($this->any())->method('getData')->willReturnMap([['identifier', null, 'test'], ['custom_theme_from', null, null], ['custom_theme_to', null, '10/02/2016']]);
     $this->dateTimeMock->expects($this->once())->method('formatDate')->with('10/02/2016')->willReturn('10 Feb 2016');
     $this->pageMock->expects($this->any())->method('setData')->withConsecutive(['custom_theme_from', null], ['custom_theme_to', '10 Feb 2016']);
     $this->model->beforeSave($this->pageMock);
 }