diff --git a/tests/php/Controllers/CMSMainTest.php b/tests/php/Controllers/CMSMainTest.php index 5b66de38..e66cbc7b 100644 --- a/tests/php/Controllers/CMSMainTest.php +++ b/tests/php/Controllers/CMSMainTest.php @@ -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'); } /** diff --git a/tests/php/Model/SiteTreePermissionsTest.php b/tests/php/Model/SiteTreePermissionsTest.php index 9e595b1a..6db4b78d 100644 --- a/tests/php/Model/SiteTreePermissionsTest.php +++ b/tests/php/Model/SiteTreePermissionsTest.php @@ -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() diff --git a/tests/php/Search/CMSMainSearchFormTest.php b/tests/php/Search/CMSMainSearchFormTest.php index e6752c13..793390a1 100644 --- a/tests/php/Search/CMSMainSearchFormTest.php +++ b/tests/php/Search/CMSMainSearchFormTest.php @@ -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/?' .