We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
| @@ 211-223 (lines=13) @@ | ||
| 208 | $this->assertEntryEquals($inputData, $entry); |
|
| 209 | } |
|
| 210 | ||
| 211 | public function testGetRelationFields() |
|
| 212 | { |
|
| 213 | $this->markTestIncomplete('Not correctly implemented'); |
|
| 214 | ||
| 215 | $this->crudPanel->setModel(User::class); |
|
| 216 | $this->crudPanel->addFields($this->userInputFieldsManyToMany, 'create'); |
|
| 217 | ||
| 218 | // TODO: fix method and documentation. when 'both' is passed as the $form value, the getRelationFields searches |
|
| 219 | // for relationship fields in the update fields. |
|
| 220 | $relationFields = $this->crudPanel->getRelationFields('both'); |
|
| 221 | ||
| 222 | $this->assertEquals($this->crudPanel->create_fields['roles'], array_last($relationFields)); |
|
| 223 | } |
|
| 224 | ||
| 225 | public function testGetRelationFieldsCreateForm() |
|
| 226 | { |
|
| @@ 225-233 (lines=9) @@ | ||
| 222 | $this->assertEquals($this->crudPanel->create_fields['roles'], array_last($relationFields)); |
|
| 223 | } |
|
| 224 | ||
| 225 | public function testGetRelationFieldsCreateForm() |
|
| 226 | { |
|
| 227 | $this->crudPanel->setModel(User::class); |
|
| 228 | $this->crudPanel->addFields($this->userInputFieldsManyToMany, 'create'); |
|
| 229 | ||
| 230 | $relationFields = $this->crudPanel->getRelationFields('create'); |
|
| 231 | ||
| 232 | $this->assertEquals($this->crudPanel->create_fields['roles'], array_last($relationFields)); |
|
| 233 | } |
|
| 234 | ||
| 235 | public function testGetRelationFieldsUpdateForm() |
|
| 236 | { |
|
| @@ 235-243 (lines=9) @@ | ||
| 232 | $this->assertEquals($this->crudPanel->create_fields['roles'], array_last($relationFields)); |
|
| 233 | } |
|
| 234 | ||
| 235 | public function testGetRelationFieldsUpdateForm() |
|
| 236 | { |
|
| 237 | $this->crudPanel->setModel(User::class); |
|
| 238 | $this->crudPanel->addFields($this->userInputFieldsManyToMany, 'update'); |
|
| 239 | ||
| 240 | $relationFields = $this->crudPanel->getRelationFields('update'); |
|
| 241 | ||
| 242 | $this->assertEquals($this->crudPanel->update_fields['roles'], array_last($relationFields)); |
|
| 243 | } |
|
| 244 | ||
| 245 | public function testGetRelationFieldsUnknownForm() |
|
| 246 | { |
|
| @@ 259-267 (lines=9) @@ | ||
| 256 | $this->crudPanel->getRelationFields('unknownForm'); |
|
| 257 | } |
|
| 258 | ||
| 259 | public function testGetRelationFieldsDotNotation() |
|
| 260 | { |
|
| 261 | $this->crudPanel->setModel(User::class); |
|
| 262 | $this->crudPanel->addFields($this->userInputFieldsDotNotation, 'create'); |
|
| 263 | ||
| 264 | $relationFields = $this->crudPanel->getRelationFields('create'); |
|
| 265 | ||
| 266 | $this->assertEquals($this->crudPanel->create_fields['street'], array_last($relationFields)); |
|
| 267 | } |
|
| 268 | ||
| 269 | public function testGetRelationFieldsNoRelations() |
|
| 270 | { |
|
| @@ 285-293 (lines=9) @@ | ||
| 282 | $this->assertEmpty($relationFields); |
|
| 283 | } |
|
| 284 | ||
| 285 | public function testGetRelationFieldsWithPivot() |
|
| 286 | { |
|
| 287 | $this->crudPanel->setModel(User::class); |
|
| 288 | $this->crudPanel->addFields($this->userInputFieldsDotNotation, 'create'); |
|
| 289 | ||
| 290 | $relationFields = $this->crudPanel->getRelationFieldsWithPivot('create'); |
|
| 291 | ||
| 292 | $this->assertEquals($this->crudPanel->create_fields['roles'], array_last($relationFields)); |
|
| 293 | } |
|
| 294 | ||
| 295 | public function testGetRelationFieldsWithPivotNoRelations() |
|
| 296 | { |
|