mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
MNT Update tests to use logInAs() (#2679)
This commit is contained in:
parent
6617c63dea
commit
e98110d336
@ -125,7 +125,7 @@ class CMSMainTest extends FunctionalTest
|
|||||||
{
|
{
|
||||||
$page1 = $this->objFromFixture(Page::class, "page1");
|
$page1 = $this->objFromFixture(Page::class, "page1");
|
||||||
$page2 = $this->objFromFixture(Page::class, "page2");
|
$page2 = $this->objFromFixture(Page::class, "page2");
|
||||||
$this->session()->set('loggedInAs', $this->idFromFixture(Member::class, 'admin'));
|
$this->logInAs('admin');
|
||||||
|
|
||||||
$response = $this->get('admin/pages/publishall?confirm=1');
|
$response = $this->get('admin/pages/publishall?confirm=1');
|
||||||
$this->assertContains(
|
$this->assertContains(
|
||||||
@ -147,8 +147,6 @@ class CMSMainTest extends FunctionalTest
|
|||||||
$latestID = DB::prepared_query('select max("Version") from "RedirectorPage_Versions" where "RecordID" = ?', [$pageID])->value();
|
$latestID = DB::prepared_query('select max("Version") from "RedirectorPage_Versions" where "RecordID" = ?', [$pageID])->value();
|
||||||
$dsCount = DB::prepared_query('select count("Version") from "RedirectorPage_Versions" where "RecordID" = ? and "Version"= ?', [$pageID, $latestID])->value();
|
$dsCount = DB::prepared_query('select count("Version") from "RedirectorPage_Versions" where "RecordID" = ? and "Version"= ?', [$pageID, $latestID])->value();
|
||||||
$this->assertEquals(1, $dsCount, "Published page has no duplicate version records: it has " . $dsCount . " for version " . $latestID);
|
$this->assertEquals(1, $dsCount, "Published page has no duplicate version records: it has " . $dsCount . " for version " . $latestID);
|
||||||
|
|
||||||
$this->session()->clear('loggedInAs');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -199,7 +199,7 @@ class SiteTreePermissionsTest extends FunctionalTest
|
|||||||
'Users without SITETREE_GRANT_ACCESS permission cannot change "edit" permissions in cms fields'
|
'Users without SITETREE_GRANT_ACCESS permission cannot change "edit" permissions in cms fields'
|
||||||
);
|
);
|
||||||
|
|
||||||
$this->session()->set('loggedInAs', null);
|
$this->logOut();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testRestrictedViewLoggedInUsers()
|
public function testRestrictedViewLoggedInUsers()
|
||||||
|
@ -12,7 +12,7 @@ class CMSMainSearchFormTest extends FunctionalTest
|
|||||||
|
|
||||||
public function testTitleFilter()
|
public function testTitleFilter()
|
||||||
{
|
{
|
||||||
$this->session()->set('loggedInAs', $this->idFromFixture(Member::class, 'admin'));
|
$this->logInAs('admin');
|
||||||
|
|
||||||
$this->get(
|
$this->get(
|
||||||
'admin/pages/?' .
|
'admin/pages/?' .
|
||||||
|
Loading…
Reference in New Issue
Block a user