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

testLoadObjectStates() public method

Test service method for loading object states within a group.
    public function testLoadObjectStates()
    {
        $objectStateService = $this->repository->getObjectStateService();
        $group = $objectStateService->loadObjectStateGroup(2);
        $states = $this->repository->getObjectStateService()->loadObjectStates($group);
        $this->assertInternalType('array', $states);
        $this->assertCount(2, $states);
        $priority = 0;
        foreach ($states as $state) {
            $this->assertInstanceOf('\\eZ\\Publish\\API\\Repository\\Values\\ObjectState\\ObjectState', $state);
            $this->assertEquals($group->id, $state->getObjectStateGroup()->id);
            $this->assertEquals($priority, $state->priority);
            ++$priority;
        }
    }