| Conditions | 2 |
| Paths | 2 |
| Total Lines | 22 |
| Code Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 19 | public function testFormField() |
||
| 20 | { |
||
| 21 | if (!$dropdown = EditableDropdown::get()->filter('UseEmptyString', true)->first()) { |
||
| 22 | $dropdown = $this->objFromFixture('EditableDropdown', 'basic-dropdown'); |
||
| 23 | |||
| 24 | $dropdown->UseEmptyString = true; |
||
| 25 | $dropdown->EmptyString = 'My Default Empty String'; |
||
| 26 | $dropdown->write(); |
||
| 27 | } |
||
| 28 | |||
| 29 | $field = $dropdown->getFormField(); |
||
| 30 | $this->assertEquals($field->getEmptyString(), 'My Default Empty String'); |
||
| 31 | |||
| 32 | $alternateDropdown = $this->objFromFixture('EditableDropdown', 'department-dropdown'); |
||
| 33 | $formField = $alternateDropdown->getFormField(); |
||
| 34 | $this->assertFalse($formField->getHasEmptyDefault()); |
||
| 35 | |||
| 36 | $alternateDropdown->UseEmptyString = true; |
||
| 37 | $alternateDropdown->write(); |
||
| 38 | $this->assertEquals($formField->getEmptyString(), ''); |
||
| 39 | |||
| 40 | } |
||
| 41 | |||
| 43 |
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.