| Conditions | 4 |
| Paths | 4 |
| Total Lines | 13 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 31 | public function assertFieldDefined($path, $message = '') |
||
| 32 | { |
||
| 33 | $defaultMessage = ''; |
||
| 34 | @list($section, $group, $field) = explode('/', $path); |
||
| 35 | $nodePath = "sections/$section/groups/$group/fields/$field"; |
||
| 36 | $result = $this->getXml()->xpath($nodePath); |
||
| 37 | if (!$message) { |
||
| 38 | $defaultMessage = sprintf("System configuration field \"$path\" not defined"); |
||
| 39 | } |
||
| 40 | if (!$result) { |
||
| 41 | $this->fail($message ? : $defaultMessage); |
||
| 42 | } |
||
| 43 | } |
||
| 44 | |||
| 60 | } |
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.