@@ 37-49 (lines=13) @@ | ||
34 | DBDatetime::clear_mock_now(); |
|
35 | } |
|
36 | ||
37 | public function testArchiveMonthlyFromStage() |
|
38 | { |
|
39 | $widget = $this->objFromFixture(BlogArchiveWidget::class, 'archive-monthly'); |
|
40 | $archive = $widget->getArchive(); |
|
41 | ||
42 | $this->assertInstanceOf(SS_List::class, $archive); |
|
43 | $this->assertCount(3, $archive); |
|
44 | $this->assertDOSContains([ |
|
45 | ['Title' => 'August 2017'], |
|
46 | ['Title' => 'September 2017'], |
|
47 | ['Title' => 'May 2015'], |
|
48 | ], $archive); |
|
49 | } |
|
50 | ||
51 | public function testArchiveMonthlyFromLive() |
|
52 | { |
|
@@ 71-82 (lines=12) @@ | ||
68 | } |
|
69 | } |
|
70 | ||
71 | public function testArchiveYearly() |
|
72 | { |
|
73 | $widget = $this->objFromFixture(BlogArchiveWidget::class, 'archive-yearly'); |
|
74 | $archive = $widget->getArchive(); |
|
75 | ||
76 | $this->assertInstanceOf(SS_List::class, $archive); |
|
77 | $this->assertCount(2, $archive); |
|
78 | $this->assertDOSContains([ |
|
79 | ['Title' => '2017'], |
|
80 | ['Title' => '2015'], |
|
81 | ], $archive); |
|
82 | } |
|
83 | } |
|
84 |