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");
|
||||
$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');
|
||||
$this->assertContains(
|
||||
@ -147,8 +147,6 @@ class CMSMainTest extends FunctionalTest
|
||||
$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();
|
||||
$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'
|
||||
);
|
||||
|
||||
$this->session()->set('loggedInAs', null);
|
||||
$this->logOut();
|
||||
}
|
||||
|
||||
public function testRestrictedViewLoggedInUsers()
|
||||
|
@ -12,7 +12,7 @@ class CMSMainSearchFormTest extends FunctionalTest
|
||||
|
||||
public function testTitleFilter()
|
||||
{
|
||||
$this->session()->set('loggedInAs', $this->idFromFixture(Member::class, 'admin'));
|
||||
$this->logInAs('admin');
|
||||
|
||||
$this->get(
|
||||
'admin/pages/?' .
|
||||
|
Loading…
Reference in New Issue
Block a user