| Conditions | 1 |
| Paths | 1 |
| Total Lines | 17 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 44 | public function testExceptionThrownOnBeforeWrite() |
||
| 45 | { |
||
| 46 | $member = $this->objFromFixture(Member::class, 'admin'); |
||
| 47 | $fixture = $this->objFromFixture(MyAwesomeJSONPage::class, 'dummy'); |
||
| 48 | |||
| 49 | $member->logIn(); |
||
| 50 | $fixture->config()->update('json_field_map', ['MyJSON' => ['FooField']]); |
||
| 51 | $fixture->write(); |
||
| 52 | |||
| 53 | // Submit a CMS POST request _without_ JSON data |
||
| 54 | $this->setExpectedException(JSONTextException::class); |
||
| 55 | $this->post('admin/pages/edit/EditForm/44/', [ |
||
| 56 | 'ParentID' => '0', |
||
| 57 | 'action_save' => 'Saved', |
||
| 58 | 'ID' => '44', |
||
| 59 | ]); |
||
| 60 | } |
||
| 61 | } |
||
| 62 |
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.