eZ\Publish\Core\Repository\Tests\Service\Integration\ObjectStateBase::testSetContentState PHP Method

testSetContentState() public method

Test service method for setting the object state to content.
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);
    }