public testSetContentState ( ) |
public function testSetContentState()
{
$objectStateService = $this->repository->getObjectStateService();
$state = $objectStateService->loadObjectState(2);
$group = $state->getObjectStateGroup();
$contentInfo = $this->repository->getContentService()->loadContentInfo(4);
$objectStateService->setContentState($contentInfo, $group, $state);
$newObjectState = $objectStateService->getContentState($contentInfo, $group);
$this->assertInstanceOf('\\eZ\\Publish\\API\\Repository\\Values\\ObjectState\\ObjectState', $newObjectState);
$this->assertEquals(2, $newObjectState->id);
}