We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
@@ 253-270 (lines=18) @@ | ||
250 | $this->assertEmpty($relationFields); |
|
251 | } |
|
252 | ||
253 | public function testSyncPivot() |
|
254 | { |
|
255 | $this->crudPanel->setModel(User::class); |
|
256 | $this->crudPanel->addFields($this->userInputFieldsManyToMany); |
|
257 | $faker = Factory::create(); |
|
258 | $inputData = [ |
|
259 | 'name' => $faker->name, |
|
260 | 'email' => $faker->safeEmail, |
|
261 | 'password' => bcrypt($faker->password()), |
|
262 | 'remember_token' => null, |
|
263 | 'roles' => [1, 2], |
|
264 | ]; |
|
265 | ||
266 | $entry = User::find(1); |
|
267 | $this->crudPanel->syncPivot($entry, $inputData); |
|
268 | ||
269 | $this->assertEquals($inputData['roles'], $entry->roles->pluck('id')->toArray()); |
|
270 | } |
|
271 | ||
272 | public function testSyncPivotUnknownData() |
|
273 | { |
|
@@ 272-289 (lines=18) @@ | ||
269 | $this->assertEquals($inputData['roles'], $entry->roles->pluck('id')->toArray()); |
|
270 | } |
|
271 | ||
272 | public function testSyncPivotUnknownData() |
|
273 | { |
|
274 | $this->crudPanel->setModel(User::class); |
|
275 | $this->crudPanel->addFields($this->nonRelationshipField); |
|
276 | $faker = Factory::create(); |
|
277 | $inputData = [ |
|
278 | 'name' => $faker->name, |
|
279 | 'email' => $faker->safeEmail, |
|
280 | 'password' => bcrypt($faker->password()), |
|
281 | 'remember_token' => null, |
|
282 | 'roles' => [1, 2], |
|
283 | ]; |
|
284 | ||
285 | $entry = User::find(1); |
|
286 | $this->crudPanel->syncPivot($entry, $inputData); |
|
287 | ||
288 | $this->assertEquals(1, $entry->roles->count()); |
|
289 | } |
|
290 | ||
291 | public function testSyncPivotUnknownModel() |
|
292 | { |