mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
MINOR Fixed SapphireTest->logInWithPermission() spelling (from r99491)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@102866 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
a20e559256
commit
4703aa6e81
@ -142,7 +142,7 @@ class SapphireTest extends PHPUnit_Framework_TestCase {
|
|||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->logInWithPermssion("ADMIN");
|
$this->logInWithPermission("ADMIN");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set up email
|
// Set up email
|
||||||
@ -681,7 +681,7 @@ class SapphireTest extends PHPUnit_Framework_TestCase {
|
|||||||
* Create a member and group with the given permission code, and log in with it.
|
* Create a member and group with the given permission code, and log in with it.
|
||||||
* Returns the member ID.
|
* Returns the member ID.
|
||||||
*/
|
*/
|
||||||
function logInWithPermssion($permCode = "ADMIN") {
|
function logInWithPermission($permCode = "ADMIN") {
|
||||||
if(!isset($this->cache_generatedMembers[$permCode])) {
|
if(!isset($this->cache_generatedMembers[$permCode])) {
|
||||||
$group = new Group();
|
$group = new Group();
|
||||||
$group->Title = "$permCode group";
|
$group->Title = "$permCode group";
|
||||||
|
@ -8,7 +8,7 @@ class FileLinkTrackingTest extends SapphireTest {
|
|||||||
|
|
||||||
function setUp() {
|
function setUp() {
|
||||||
parent::setUp();
|
parent::setUp();
|
||||||
$this->logInWithPermssion('ADMIN');
|
$this->logInWithPermission('ADMIN');
|
||||||
touch(Director::baseFolder() . '/assets/testscript-test-file.pdf');
|
touch(Director::baseFolder() . '/assets/testscript-test-file.pdf');
|
||||||
}
|
}
|
||||||
function tearDown() {
|
function tearDown() {
|
||||||
|
@ -53,7 +53,7 @@ class SiteTreeActionsTest extends FunctionalTest {
|
|||||||
function testActionsNoDeletePublishedRecord() {
|
function testActionsNoDeletePublishedRecord() {
|
||||||
if(class_exists('SiteTreeCMSWorkflow')) return true;
|
if(class_exists('SiteTreeCMSWorkflow')) return true;
|
||||||
|
|
||||||
$this->logInWithPermssion('ADMIN');
|
$this->logInWithPermission('ADMIN');
|
||||||
|
|
||||||
$page = new SiteTreeActionsTest_Page();
|
$page = new SiteTreeActionsTest_Page();
|
||||||
$page->CanEditType = 'LoggedInUsers';
|
$page->CanEditType = 'LoggedInUsers';
|
||||||
|
@ -20,7 +20,7 @@ class SiteTreeBacklinksTest extends SapphireTest {
|
|||||||
|
|
||||||
// Log in as admin so that we don't run into permission issues. That's not what we're
|
// Log in as admin so that we don't run into permission issues. That's not what we're
|
||||||
// testing here.
|
// testing here.
|
||||||
$this->logInWithPermssion('ADMIN');
|
$this->logInWithPermission('ADMIN');
|
||||||
}
|
}
|
||||||
|
|
||||||
function testSavingPageWithLinkAddsBacklink() {
|
function testSavingPageWithLinkAddsBacklink() {
|
||||||
|
@ -71,7 +71,7 @@ class SiteTreeBrokenLinksTest extends SapphireTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function testDeletingMarksBackLinkedPagesAsBroken() {
|
function testDeletingMarksBackLinkedPagesAsBroken() {
|
||||||
$this->logInWithPermssion('ADMIN');
|
$this->logInWithPermission('ADMIN');
|
||||||
|
|
||||||
// Set up two published pages with a link from content -> about
|
// Set up two published pages with a link from content -> about
|
||||||
$linkDest = $this->objFromFixture('Page','about');
|
$linkDest = $this->objFromFixture('Page','about');
|
||||||
@ -113,7 +113,7 @@ class SiteTreeBrokenLinksTest extends SapphireTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function testPublishingSourceBeforeDestHasBrokenLink() {
|
function testPublishingSourceBeforeDestHasBrokenLink() {
|
||||||
$this->logInWithPermssion('ADMIN');
|
$this->logInWithPermission('ADMIN');
|
||||||
|
|
||||||
// Set up two draft pages with a link from content -> about
|
// Set up two draft pages with a link from content -> about
|
||||||
$linkDest = $this->objFromFixture('Page','about');
|
$linkDest = $this->objFromFixture('Page','about');
|
||||||
|
@ -32,7 +32,7 @@ class SiteTreePermissionsTest extends FunctionalTest {
|
|||||||
|
|
||||||
function testPermissionCheckingWorksOnDeletedPages() {
|
function testPermissionCheckingWorksOnDeletedPages() {
|
||||||
// Set up fixture - a published page deleted from draft
|
// Set up fixture - a published page deleted from draft
|
||||||
$this->logInWithPermssion("ADMIN");
|
$this->logInWithPermission("ADMIN");
|
||||||
$page = $this->objFromFixture('Page','restrictedEditOnlySubadminGroup');
|
$page = $this->objFromFixture('Page','restrictedEditOnlySubadminGroup');
|
||||||
$pageID = $page->ID;
|
$pageID = $page->ID;
|
||||||
$this->assertTrue($page->doPublish());
|
$this->assertTrue($page->doPublish());
|
||||||
@ -58,7 +58,7 @@ class SiteTreePermissionsTest extends FunctionalTest {
|
|||||||
|
|
||||||
function testPermissionCheckingWorksOnUnpublishedPages() {
|
function testPermissionCheckingWorksOnUnpublishedPages() {
|
||||||
// Set up fixture - an unpublished page
|
// Set up fixture - an unpublished page
|
||||||
$this->logInWithPermssion("ADMIN");
|
$this->logInWithPermission("ADMIN");
|
||||||
$page = $this->objFromFixture('Page','restrictedEditOnlySubadminGroup');
|
$page = $this->objFromFixture('Page','restrictedEditOnlySubadminGroup');
|
||||||
$pageID = $page->ID;
|
$pageID = $page->ID;
|
||||||
$page->doUnpublish();
|
$page->doUnpublish();
|
||||||
@ -80,7 +80,7 @@ class SiteTreePermissionsTest extends FunctionalTest {
|
|||||||
|
|
||||||
function testCanEditOnPageDeletedFromStageAndLiveReturnsFalse() {
|
function testCanEditOnPageDeletedFromStageAndLiveReturnsFalse() {
|
||||||
// Find a page that exists and delete it from both stage and published
|
// Find a page that exists and delete it from both stage and published
|
||||||
$this->logInWithPermssion("ADMIN");
|
$this->logInWithPermission("ADMIN");
|
||||||
$page = $this->objFromFixture('Page','restrictedEditOnlySubadminGroup');
|
$page = $this->objFromFixture('Page','restrictedEditOnlySubadminGroup');
|
||||||
$pageID = $page->ID;
|
$pageID = $page->ID;
|
||||||
$page->doUnpublish();
|
$page->doUnpublish();
|
||||||
@ -336,7 +336,7 @@ class SiteTreePermissionsTest extends FunctionalTest {
|
|||||||
$page = $this->objFromFixture('Page', 'restrictedEditLoggedInUsers');
|
$page = $this->objFromFixture('Page', 'restrictedEditLoggedInUsers');
|
||||||
$pageID = $page->ID;
|
$pageID = $page->ID;
|
||||||
|
|
||||||
$this->logInWithPermssion("ADMIN");
|
$this->logInWithPermission("ADMIN");
|
||||||
|
|
||||||
$page->doPublish();
|
$page->doPublish();
|
||||||
$page->deleteFromStage('Stage');
|
$page->deleteFromStage('Stage');
|
||||||
|
@ -94,7 +94,7 @@ class SiteTreeTest extends SapphireTest {
|
|||||||
* Test that field which are set and then cleared are also transferred to the published site.
|
* Test that field which are set and then cleared are also transferred to the published site.
|
||||||
*/
|
*/
|
||||||
function testPublishDeletedFields() {
|
function testPublishDeletedFields() {
|
||||||
$this->logInWithPermssion('ADMIN');
|
$this->logInWithPermission('ADMIN');
|
||||||
|
|
||||||
$obj = $this->objFromFixture('Page', 'about');
|
$obj = $this->objFromFixture('Page', 'about');
|
||||||
$obj->MetaTitle = "asdfasdf";
|
$obj->MetaTitle = "asdfasdf";
|
||||||
@ -334,7 +334,7 @@ class SiteTreeTest extends SapphireTest {
|
|||||||
|
|
||||||
function testDeleteFromLiveOperatesRecursively() {
|
function testDeleteFromLiveOperatesRecursively() {
|
||||||
SiteTree::set_enforce_strict_hierarchy(false);
|
SiteTree::set_enforce_strict_hierarchy(false);
|
||||||
$this->logInWithPermssion('ADMIN');
|
$this->logInWithPermission('ADMIN');
|
||||||
|
|
||||||
$pageAbout = $this->objFromFixture('Page', 'about');
|
$pageAbout = $this->objFromFixture('Page', 'about');
|
||||||
$pageAbout->doPublish();
|
$pageAbout->doPublish();
|
||||||
@ -356,7 +356,7 @@ class SiteTreeTest extends SapphireTest {
|
|||||||
|
|
||||||
function testUnpublishDoesNotDeleteChildrenWithLooseHierachyOn() {
|
function testUnpublishDoesNotDeleteChildrenWithLooseHierachyOn() {
|
||||||
SiteTree::set_enforce_strict_hierarchy(false);
|
SiteTree::set_enforce_strict_hierarchy(false);
|
||||||
$this->logInWithPermssion('ADMIN');
|
$this->logInWithPermission('ADMIN');
|
||||||
|
|
||||||
$pageAbout = $this->objFromFixture('Page', 'about');
|
$pageAbout = $this->objFromFixture('Page', 'about');
|
||||||
$pageAbout->doPublish();
|
$pageAbout->doPublish();
|
||||||
@ -378,7 +378,7 @@ class SiteTreeTest extends SapphireTest {
|
|||||||
|
|
||||||
|
|
||||||
function testDeleteFromLiveOperatesRecursivelyStrict() {
|
function testDeleteFromLiveOperatesRecursivelyStrict() {
|
||||||
$this->logInWithPermssion('ADMIN');
|
$this->logInWithPermission('ADMIN');
|
||||||
|
|
||||||
$pageAbout = $this->objFromFixture('Page', 'about');
|
$pageAbout = $this->objFromFixture('Page', 'about');
|
||||||
$pageAbout->doPublish();
|
$pageAbout->doPublish();
|
||||||
|
@ -93,12 +93,12 @@ class ContentControllerTest extends FunctionalTest {
|
|||||||
public function testViewDraft(){
|
public function testViewDraft(){
|
||||||
|
|
||||||
// test when user does not have permission, should get login form
|
// test when user does not have permission, should get login form
|
||||||
$this->logInWithPermssion('EDITOR');
|
$this->logInWithPermission('EDITOR');
|
||||||
$this->assertEquals('403', $this->get('/contact/?stage=Stage')->getstatusCode());
|
$this->assertEquals('403', $this->get('/contact/?stage=Stage')->getstatusCode());
|
||||||
|
|
||||||
|
|
||||||
// test when user does have permission, should show page title and header ok.
|
// test when user does have permission, should show page title and header ok.
|
||||||
$this->logInWithPermssion('ADMIN');
|
$this->logInWithPermission('ADMIN');
|
||||||
$this->assertEquals('200', $this->get('/contact/?stage=Stage')->getstatusCode());
|
$this->assertEquals('200', $this->get('/contact/?stage=Stage')->getstatusCode());
|
||||||
|
|
||||||
|
|
||||||
|
@ -30,7 +30,7 @@ class VirtualPageTest extends SapphireTest {
|
|||||||
* virtual pages are published
|
* virtual pages are published
|
||||||
*/
|
*/
|
||||||
function testPublishingSourcePagePublishesAlreadyPublishedVirtualPages() {
|
function testPublishingSourcePagePublishesAlreadyPublishedVirtualPages() {
|
||||||
$this->logInWithPermssion('ADMIN');
|
$this->logInWithPermission('ADMIN');
|
||||||
|
|
||||||
$master = $this->objFromFixture('Page', 'master');
|
$master = $this->objFromFixture('Page', 'master');
|
||||||
$master->doPublish();
|
$master->doPublish();
|
||||||
|
Loading…
Reference in New Issue
Block a user