We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
| @@ 81-90 (lines=10) @@ | ||
| 78 | $this->assertEquals($this->expectedInputDataWithCompactedFakeFields, $compactedFakeFields); |
|
| 79 | } |
|
| 80 | ||
| 81 | public function testCompactFakeFieldsFromUpdateForm() |
|
| 82 | { |
|
| 83 | $article = DB::table('articles')->where('id', 1)->first(); |
|
| 84 | $this->crudPanel->setModel(Article::class); |
|
| 85 | $this->crudPanel->addFields($this->fakeFieldsArray, 'update'); |
|
| 86 | ||
| 87 | $compactedFakeFields = $this->crudPanel->compactFakeFields($this->fakeFieldsInputData, 'update', $article->id); |
|
| 88 | ||
| 89 | $this->assertEquals($this->expectedInputDataWithCompactedFakeFields, $compactedFakeFields); |
|
| 90 | } |
|
| 91 | ||
| 92 | public function testCompactFakeFieldsFromUpdateFormWithoutId() |
|
| 93 | { |
|
| @@ 104-115 (lines=12) @@ | ||
| 101 | $this->assertEquals($this->expectedInputDataWithCompactedFakeFields, $compactedFakeFields); |
|
| 102 | } |
|
| 103 | ||
| 104 | public function testCompactFakeFieldsFromUpdateFormWithUnknownId() |
|
| 105 | { |
|
| 106 | $this->setExpectedException(ModelNotFoundException::class); |
|
| 107 | ||
| 108 | $unknownId = DB::getPdo()->lastInsertId() + 1; |
|
| 109 | $this->crudPanel->setModel(Article::class); |
|
| 110 | $this->crudPanel->addFields($this->fakeFieldsArray, 'update'); |
|
| 111 | ||
| 112 | $compactedFakeFields = $this->crudPanel->compactFakeFields($this->fakeFieldsInputData, 'update', $unknownId); |
|
| 113 | ||
| 114 | $this->assertEquals($this->expectedInputDataWithCompactedFakeFields, $compactedFakeFields); |
|
| 115 | } |
|
| 116 | ||
| 117 | public function testCompactFakeFieldsFromEmptyRequest() |
|
| 118 | { |
|
| @@ 235-248 (lines=14) @@ | ||
| 232 | $this->assertEquals($this->expectedTabNames, $tabNames); |
|
| 233 | } |
|
| 234 | ||
| 235 | public function testGetTabsEntryExists() |
|
| 236 | { |
|
| 237 | $this->crudPanel->setModel(Article::class); |
|
| 238 | $article = DB::table('articles')->where('id', 1)->first(); |
|
| 239 | ||
| 240 | // manually call this method to set the crud panel entry attribute used in the getTabs method to get the current |
|
| 241 | // fields from the update form. |
|
| 242 | $this->crudPanel->getEntry($article->id); |
|
| 243 | ||
| 244 | $this->crudPanel->addFields($this->threeTextFieldsArray, 'update'); |
|
| 245 | $tabNames = $this->crudPanel->getTabs(); |
|
| 246 | ||
| 247 | $this->assertEquals($this->expectedTabNames, $tabNames); |
|
| 248 | } |
|
| 249 | } |
|
| 250 | ||