|
@@ 155-166 (lines=12) @@
|
| 152 |
|
* |
| 153 |
|
* Creates a publish job which is queued for immediately |
| 154 |
|
*/ |
| 155 |
|
public function testPastEmbargo() |
| 156 |
|
{ |
| 157 |
|
$page = $this->objFromFixture(SiteTree::class, 'pastEmbargo'); |
| 158 |
|
|
| 159 |
|
$page = $this->finishWorkflow($page); |
| 160 |
|
|
| 161 |
|
$this->assertNotEquals(0, $page->PublishJobID); |
| 162 |
|
$this->assertEquals(0, $page->UnPublishJobID); |
| 163 |
|
|
| 164 |
|
$publish = strtotime($page->PublishJob()->StartAfter); |
| 165 |
|
$this->assertFalse($publish); |
| 166 |
|
} |
| 167 |
|
|
| 168 |
|
/** |
| 169 |
|
* Test for expiry in the past |
|
@@ 173-185 (lines=13) @@
|
| 170 |
|
* |
| 171 |
|
* Creates an unpublish job which is queued for immediately |
| 172 |
|
*/ |
| 173 |
|
public function testPastExpiry() |
| 174 |
|
{ |
| 175 |
|
$page = $this->objFromFixture(SiteTree::class, 'pastExpiry'); |
| 176 |
|
|
| 177 |
|
$page = $this->finishWorkflow($page); |
| 178 |
|
|
| 179 |
|
$this->assertEquals(0, $page->PublishJobID); |
| 180 |
|
$this->assertNotEquals(0, $page->UnPublishJobID); |
| 181 |
|
|
| 182 |
|
$unpublish = strtotime($page->UnPublishJob()->StartAfter); |
| 183 |
|
|
| 184 |
|
$this->assertFalse($unpublish); |
| 185 |
|
} |
| 186 |
|
|
| 187 |
|
/** |
| 188 |
|
* Test for embargo and expiry in the past |
|
@@ 192-204 (lines=13) @@
|
| 189 |
|
* |
| 190 |
|
* Creates an unpublish job which is queued for immediately |
| 191 |
|
*/ |
| 192 |
|
public function testPastEmbargoExpiry() |
| 193 |
|
{ |
| 194 |
|
$page = $this->objFromFixture(SiteTree::class, 'pastEmbargoExpiry'); |
| 195 |
|
|
| 196 |
|
$page = $this->finishWorkflow($page); |
| 197 |
|
|
| 198 |
|
$this->assertEquals(0, $page->PublishJobID); |
| 199 |
|
$this->assertNotEquals(0, $page->UnPublishJobID); |
| 200 |
|
|
| 201 |
|
$unpublish = strtotime($page->UnPublishJob()->StartAfter); |
| 202 |
|
|
| 203 |
|
$this->assertFalse($unpublish); |
| 204 |
|
} |
| 205 |
|
|
| 206 |
|
/** |
| 207 |
|
* Test for embargo in the past and expiry in the future |