MINOR: Ensure that tests work by giving the test executor admin rights (from r89124)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@89217 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sam Minnee 2009-10-15 22:41:55 +00:00
parent 16189a4697
commit f792d16c01
2 changed files with 8 additions and 2 deletions

View File

@ -93,16 +93,18 @@ class SiteTreeTest extends SapphireTest {
* Test that field which are set and then cleared are also transferred to the published site.
*/
function testPublishDeletedFields() {
$this->logInWithPermssion('ADMIN');
$obj = $this->objFromFixture('Page', 'about');
$obj->MetaTitle = "asdfasdf";
$obj->write();
$obj->doPublish();
$this->assertTrue($obj->doPublish());
$this->assertEquals('asdfasdf', DB::query("SELECT \"MetaTitle\" FROM \"SiteTree_Live\" WHERE \"ID\" = '$obj->ID'")->value());
$obj->MetaTitle = null;
$obj->write();
$obj->doPublish();
$this->assertTrue($obj->doPublish());
$this->assertNull(DB::query("SELECT \"MetaTitle\" FROM \"SiteTree_Live\" WHERE \"ID\" = '$obj->ID'")->value());
@ -316,6 +318,8 @@ class SiteTreeTest extends SapphireTest {
}
function testDeleteFromLiveOperatesRecursively() {
$this->logInWithPermssion('ADMIN');
$pageAbout = $this->objFromFixture('Page', 'about');
$pageAbout->doPublish();
$pageStaff = $this->objFromFixture('Page', 'staff');

View File

@ -30,6 +30,8 @@ class VirtualPageTest extends SapphireTest {
* are published
*/
function testPublishingSourcePagePublishesVirtualPages() {
$this->logInWithPermssion('ADMIN');
$master = $this->objFromFixture('Page', 'master');
$master->Title = "New title";
$master->MenuTitle = "New menutitle";