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 | { |
@@ 155-168 (lines=14) @@ | ||
152 | $this->assertEquals($this->expectedTabNames, $tabNames); |
|
153 | } |
|
154 | ||
155 | public function testGetTabsEntryExists() |
|
156 | { |
|
157 | $this->crudPanel->setModel(Article::class); |
|
158 | $article = DB::table('articles')->where('id', 1)->first(); |
|
159 | ||
160 | // manually call this method to set the crud panel entry attribute used in the getTabs method to get the current |
|
161 | // fields from the update form. |
|
162 | $this->crudPanel->getEntry($article->id); |
|
163 | ||
164 | $this->crudPanel->addFields($this->threeTextFieldsArray, 'update'); |
|
165 | $tabNames = $this->crudPanel->getTabs(); |
|
166 | ||
167 | $this->assertEquals($this->expectedTabNames, $tabNames); |
|
168 | } |
|
169 | } |
|
170 |