1 | <?php |
||
15 | class LanguageTest extends PHPUnit_Framework_TestCase |
||
16 | { |
||
17 | use ValueObjectTestTrait; |
||
18 | |||
19 | /** |
||
20 | * Test default properties of just created class. |
||
21 | */ |
||
22 | public function testNewClass() |
||
36 | |||
37 | /** |
||
38 | * Test retrieving missing property. |
||
39 | * |
||
40 | * @covers \eZ\Publish\API\Repository\Values\Content\Language::__get |
||
41 | * @expectedException \eZ\Publish\API\Repository\Exceptions\PropertyNotFoundException |
||
42 | * @expectedExceptionMessage Property 'notDefined' not found on class |
||
43 | */ |
||
44 | public function testMissingProperty() |
||
50 | |||
51 | /** |
||
52 | * Test setting read only property. |
||
53 | * |
||
54 | * @covers \eZ\Publish\API\Repository\Values\Content\Language::__set |
||
55 | * @expectedException \eZ\Publish\API\Repository\Exceptions\PropertyReadOnlyException |
||
56 | * @expectedExceptionMessage Property 'id' is readonly on class |
||
57 | */ |
||
58 | public function testReadOnlyProperty() |
||
64 | |||
65 | /** |
||
66 | * Test if property exists. |
||
67 | * |
||
68 | * @covers \eZ\Publish\API\Repository\Values\Content\Language::__isset |
||
69 | */ |
||
70 | public function testIsPropertySet() |
||
79 | |||
80 | /** |
||
81 | * Test unsetting a property. |
||
82 | * |
||
83 | * @covers \eZ\Publish\API\Repository\Values\Content\Language::__unset |
||
84 | * @expectedException \eZ\Publish\API\Repository\Exceptions\PropertyReadOnlyException |
||
85 | * @expectedExceptionMessage Property 'id' is readonly on class |
||
86 | */ |
||
87 | public function testUnsetProperty() |
||
93 | } |
||
94 |
Since your code implements the magic setter
_set
, this function will be called for any write access on an undefined variable. You can add the@property
annotation to your class or interface to document the existence of this variable.Since the property has write access only, you can use the @property-write annotation instead.
Of course, you may also just have mistyped another name, in which case you should fix the error.
See also the PhpDoc documentation for @property.