Conditions | 1 |
Paths | 1 |
Total Lines | 20 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 2 |
1 | <?php |
||
9 | public function testCMSFields() { |
||
10 | $sc = new SearchableClass(); |
||
11 | $sc->Name = 'TestField'; |
||
|
|||
12 | $sc->InSiteTree = false; |
||
13 | $sc->write(); |
||
14 | |||
15 | $fields = $sc->getCMSFields(); |
||
16 | |||
17 | $tab = $this->checkTabExists($fields,'Main'); |
||
18 | |||
19 | //Check fields |
||
20 | $nf = $this->checkFieldExists($tab, 'Name'); |
||
21 | $this->assertTrue($nf->isDisabled()); |
||
22 | |||
23 | //FIXME - why does this fail? |
||
24 | $this->assertTrue($nf->isReadOnly()); |
||
25 | |||
26 | //Check for existence of grid field |
||
27 | $nf = $this->checkFieldExists($tab, 'SearchableField'); |
||
28 | } |
||
29 | |||
39 |
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.