mirror of
https://github.com/silverstripe/silverstripe-reports
synced 2024-10-22 11:05:53 +02:00
MINOR: Made security fixture set-up tigher in a test.
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@89457 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
3b8389168e
commit
4b7a3e20fb
@ -90,15 +90,20 @@ class CMSMainTest extends FunctionalTest {
|
||||
* Test that a draft-deleted page can still be opened in the CMS
|
||||
*/
|
||||
function testDraftDeletedPageCanBeOpenedInCMS() {
|
||||
$this->session()->inst_set('loggedInAs', $this->idFromFixture('Member', 'admin'));
|
||||
|
||||
// Set up a page that is delete from live
|
||||
$page = $this->objFromFixture('Page','page1');
|
||||
$pageID = $page->ID;
|
||||
$page->doPublish();
|
||||
$page->delete();
|
||||
|
||||
$this->session()->inst_set('loggedInAs', $this->idFromFixture('Member', 'admin'));
|
||||
$response = $this->get('admin/cms/getitem?ID=' . $pageID . '&ajax=1');
|
||||
|
||||
$livePage = Versioned::get_one_by_stage("SiteTree", "Live", "\"SiteTree\".\"ID\" = $pageID");
|
||||
$this->assertType('SiteTree', $livePage);
|
||||
$this->assertTrue($livePage->canDelete());
|
||||
|
||||
// Check that the 'delete from live' button exists as a simple way of checking that the correct page is returned.
|
||||
$this->assertRegExp('/<input[^>]+type="submit"[^>]+name="action_deletefromlive"/i', $response->getBody());
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user