|
@@ 24-32 (lines=9) @@
|
| 21 |
|
* Ensure that if no ID is provided then a SiteTree singleton is returned (which will not have an ID). If one is |
| 22 |
|
* provided then it should be loaded from the database via versioning. |
| 23 |
|
*/ |
| 24 |
|
public function testCurrentPageReturnsSiteTree() |
| 25 |
|
{ |
| 26 |
|
$page = $this->objFromFixture('SiteTree', 's1'); |
| 27 |
|
|
| 28 |
|
$this->assertInstanceOf('SiteTree', $this->controller->currentPage()); |
| 29 |
|
$this->assertEmpty($this->controller->currentPage()->ID); |
| 30 |
|
$this->controller->setRequest(new SS_HTTPRequest('GET', '/', array('page_id' => $page->ID))); |
| 31 |
|
$this->assertEquals($page->ID, $this->controller->currentPage()->ID, 'Specified page is loaded and returned'); |
| 32 |
|
} |
| 33 |
|
|
| 34 |
|
/** |
| 35 |
|
* Ensure that if no "dsid" is given a singleton is returned (which will not have an ID). If one is provided |
|
@@ 38-46 (lines=9) @@
|
| 35 |
|
* Ensure that if no "dsid" is given a singleton is returned (which will not have an ID). If one is provided |
| 36 |
|
* it should be loaded from the database |
| 37 |
|
*/ |
| 38 |
|
public function testGetCurrentDocumentSetReturnsDocumentSet() |
| 39 |
|
{ |
| 40 |
|
$set = $this->objFromFixture('DMSDocumentSet', 'ds1'); |
| 41 |
|
|
| 42 |
|
$this->assertInstanceOf('DMSDocumentSet', $this->controller->getCurrentDocumentSet()); |
| 43 |
|
$this->assertEmpty($this->controller->getCurrentDocumentSet()->ID, 'Singleton does not have an ID'); |
| 44 |
|
$this->controller->setRequest(new SS_HTTPRequest('GET', '/', array('dsid' => $set->ID))); |
| 45 |
|
$this->assertEquals($set->ID, $this->controller->getCurrentDocumentSet()->ID, 'Specified document set is returned'); |
| 46 |
|
} |
| 47 |
|
|
| 48 |
|
/** |
| 49 |
|
* Test that extra allowed extensions are merged into the default upload field allowed extensions |