| @@ 189-204 (lines=16) @@ | ||
| 186 | * @expectedException \eZ\Publish\Core\REST\Common\Exceptions\Parser |
|
| 187 | * @expectedExceptionMessage Missing or invalid 'fields' element for UserGroupCreate. |
|
| 188 | */ |
|
| 189 | public function testParseExceptionOnInvalidFields() |
|
| 190 | { |
|
| 191 | $inputArray = array( |
|
| 192 | 'ContentType' => array( |
|
| 193 | '_href' => '/content/types/3', |
|
| 194 | ), |
|
| 195 | 'mainLanguageCode' => 'eng-US', |
|
| 196 | 'Section' => array( |
|
| 197 | '_href' => '/content/sections/4', |
|
| 198 | ), |
|
| 199 | 'remoteId' => 'remoteId12345678', |
|
| 200 | ); |
|
| 201 | ||
| 202 | $userGroupCreate = $this->getParser(); |
|
| 203 | $userGroupCreate->parse($inputArray, $this->getParsingDispatcherMock()); |
|
| 204 | } |
|
| 205 | ||
| 206 | /** |
|
| 207 | * Test UserGroupCreate parser throwing exception on missing field definition identifier. |
|
| @@ 130-144 (lines=15) @@ | ||
| 127 | * @expectedException \eZ\Publish\Core\REST\Common\Exceptions\Parser |
|
| 128 | * @expectedExceptionMessage Invalid 'fields' element for UserGroupUpdate. |
|
| 129 | */ |
|
| 130 | public function testParseExceptionOnInvalidFields() |
|
| 131 | { |
|
| 132 | $inputArray = array( |
|
| 133 | 'mainLanguageCode' => 'eng-US', |
|
| 134 | 'Section' => array( |
|
| 135 | '_href' => '/content/sections/1', |
|
| 136 | ), |
|
| 137 | 'remoteId' => 'remoteId123456', |
|
| 138 | 'fields' => array(), |
|
| 139 | '__url' => '/user/groups/1/5', |
|
| 140 | ); |
|
| 141 | ||
| 142 | $userGroupUpdate = $this->getParser(); |
|
| 143 | $userGroupUpdate->parse($inputArray, $this->getParsingDispatcherMock()); |
|
| 144 | } |
|
| 145 | ||
| 146 | /** |
|
| 147 | * Test UserGroupUpdate parser throwing exception on missing field definition identifier. |
|