Code Duplication    Length = 16-16 lines in 2 locations

eZ/Publish/Core/Repository/Tests/Service/Integration/ObjectStateBase.php 2 locations

@@ 68-83 (lines=16) @@
65
     * @covers \eZ\Publish\API\Repository\Values\ObjectState\ObjectState::__get
66
     * @covers \eZ\Publish\API\Repository\Values\ObjectState\ObjectStateGroup::__get
67
     */
68
    public function testMissingProperty()
69
    {
70
        try {
71
            $objectState = new ObjectState();
72
            $value = $objectState->notDefined;
73
            $this->fail('Succeeded getting non existing property');
74
        } catch (PropertyNotFound $e) {
75
        }
76
77
        try {
78
            $objectStateGroup = new ObjectStateGroup();
79
            $value = $objectStateGroup->notDefined;
80
            $this->fail('Succeeded getting non existing property');
81
        } catch (PropertyNotFound $e) {
82
        }
83
    }
84
85
    /**
86
     * Test setting read only property.
@@ 91-106 (lines=16) @@
88
     * @covers \eZ\Publish\API\Repository\Values\ObjectState\ObjectState::__set
89
     * @covers \eZ\Publish\API\Repository\Values\ObjectState\ObjectStateGroup::__set
90
     */
91
    public function testReadOnlyProperty()
92
    {
93
        try {
94
            $objectState = new ObjectState();
95
            $objectState->id = 42;
96
            $this->fail('Succeeded setting read only property');
97
        } catch (PropertyReadOnlyException $e) {
98
        }
99
100
        try {
101
            $objectStateGroup = new ObjectStateGroup();
102
            $objectStateGroup->id = 42;
103
            $this->fail('Succeeded setting read only property');
104
        } catch (PropertyReadOnlyException $e) {
105
        }
106
    }
107
108
    /**
109
     * Test if property exists.