Code Duplication    Length = 16-16 lines in 2 locations

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

@@ 63-78 (lines=16) @@
60
     * @covers \eZ\Publish\API\Repository\Values\User\Role::__get
61
     * @covers \eZ\Publish\API\Repository\Values\User\Policy::__get
62
     */
63
    public function testMissingProperty()
64
    {
65
        try {
66
            $role = new Role();
67
            $value = $role->notDefined;
68
            self::fail('Succeeded getting non existing property');
69
        } catch (PropertyNotFound $e) {
70
        }
71
72
        try {
73
            $policy = new Policy();
74
            $value = $policy->notDefined;
75
            self::fail('Succeeded getting non existing property');
76
        } catch (PropertyNotFound $e) {
77
        }
78
    }
79
80
    /**
81
     * Test setting read only property.
@@ 86-101 (lines=16) @@
83
     * @covers \eZ\Publish\API\Repository\Values\User\Role::__set
84
     * @covers \eZ\Publish\API\Repository\Values\User\Policy::__set
85
     */
86
    public function testReadOnlyProperty()
87
    {
88
        try {
89
            $role = new Role();
90
            $role->id = 42;
91
            self::fail('Succeeded setting read only property');
92
        } catch (PropertyReadOnlyException $e) {
93
        }
94
95
        try {
96
            $policy = new Policy();
97
            $policy->id = 42;
98
            self::fail('Succeeded setting read only property');
99
        } catch (PropertyReadOnlyException $e) {
100
        }
101
    }
102
103
    /**
104
     * Test if property exists.