| Conditions | 1 |
| Paths | 1 |
| Total Lines | 13 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 1 |
| 1 | <?php |
||
| 32 | 1 | public function testRequireDefaultRecords() { |
|
| 33 | 1 | $this->AutoCompleteOption->requireDefaultRecords(); |
|
| 34 | |||
| 35 | 1 | $similar = AutoCompleteOption::get()->filter('Name','Similar')->first(); |
|
| 36 | 1 | $this->assertEquals(1, $similar->ID); |
|
| 37 | |||
| 38 | 1 | $search = AutoCompleteOption::get()->filter('Name','Search')->first(); |
|
| 39 | 1 | $this->assertEquals(2, $search->ID); |
|
| 40 | |||
| 41 | 1 | $goto = AutoCompleteOption::get()->filter('Name','GoToRecord')->first(); |
|
| 42 | 1 | $this->assertEquals(3, $goto->ID); |
|
| 43 | |||
| 44 | 1 | } |
|
| 45 | |||
| 48 |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: