function testManipulatingGroupsDuringAWorkflow() { $page = $this->objFromFixture('SiteTree', 'custompublisherpage'); $custompublisher = $this->objFromFixture('Member', 'custompublisher'); $customauthor = $this->objFromFixture('Member', 'customauthor'); $customauthorgroup = $this->objFromFixture('Group', 'customauthorsgroup'); // awaiting approval $customauthor->logIn(); $request = $page->openOrNewWorkflowRequest('WorkflowPublicationRequest'); // Asset publisher can publish but author cannot $this->assertFalse($page->canPublish($customauthor)); $this->assertTrue($page->canPublish($custompublisher)); // Add the author group, assert they can now publish $page->CanPublishType = 'OnlyTheseUsers'; $page->write(); $page->PublisherGroups()->add($customauthorgroup); SiteTreeFutureState::on_db_reset(); $this->assertTrue($page->canPublish($customauthor)); $custompublisher->logIn(); }