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

testReadOnlyProperty() public method

Test setting read only property.
    public function testReadOnlyProperty()
    {
        try {
            $objectState = new ObjectState();
            $objectState->id = 42;
            $this->fail('Succeeded setting read only property');
        } catch (PropertyReadOnlyException $e) {
        }
        try {
            $objectStateGroup = new ObjectStateGroup();
            $objectStateGroup->id = 42;
            $this->fail('Succeeded setting read only property');
        } catch (PropertyReadOnlyException $e) {
        }
    }