55use Tests \TestCase ;
66use Illuminate \Foundation \Testing \WithFaker ;
77use Illuminate \Foundation \Testing \RefreshDatabase ;
8+ use Illuminate \Foundation \Testing \DatabaseMigrations ;
89use Spatie \Permission \Models \Role ;
910
1011class _aCoreUITest extends TestCase
1112{
13+ use DatabaseMigrations;
14+
1215 public function setUp () :void {
1316 parent ::setUp ();
1417 }
@@ -25,6 +28,7 @@ public function testColors(){
2528
2629 public function testColorsActingAsUser (){
2730 $ user = factory ('App\User ' )->create ();
31+ Role::create (['name ' => 'user ' ]);
2832 $ user ->assignRole ('user ' );
2933 $ response = $ this ->actingAs ($ user )->get ( '/colors ' );
3034 $ response ->assertStatus (200 );
@@ -37,6 +41,7 @@ public function testTypography(){
3741
3842 public function testTypographyActingAsUser (){
3943 $ user = factory ('App\User ' )->create ();
44+ Role::create (['name ' => 'user ' ]);
4045 $ user ->assignRole ('user ' );
4146 $ response = $ this ->actingAs ($ user )->get ( '/typography ' );
4247 $ response ->assertStatus (200 );
@@ -50,6 +55,7 @@ public function testBaseBreadcrumb(){
5055
5156 public function testBaseBreadcrumbActingAsUser (){
5257 $ user = factory ('App\User ' )->create ();
58+ Role::create (['name ' => 'user ' ]);
5359 $ user ->assignRole ('user ' );
5460 $ response = $ this ->actingAs ($ user )->get ( '/base/breadcrumb ' );
5561 $ response ->assertStatus (200 );
@@ -62,6 +68,7 @@ public function testBaseCards(){
6268
6369 public function testBaseCardsActingAsUser (){
6470 $ user = factory ('App\User ' )->create ();
71+ Role::create (['name ' => 'user ' ]);
6572 $ user ->assignRole ('user ' );
6673 $ response = $ this ->actingAs ($ user )->get ( '/base/cards ' );
6774 $ response ->assertStatus (200 );
@@ -74,6 +81,7 @@ public function testBaseCarousel(){
7481
7582 public function testBaseCarouselActingAsUser (){
7683 $ user = factory ('App\User ' )->create ();
84+ Role::create (['name ' => 'user ' ]);
7785 $ user ->assignRole ('user ' );
7886 $ response = $ this ->actingAs ($ user )->get ( '/base/carousel ' );
7987 $ response ->assertStatus (200 );
@@ -86,6 +94,7 @@ public function testBaseCollapse(){
8694
8795 public function testBaseCollapseActingAsUser (){
8896 $ user = factory ('App\User ' )->create ();
97+ Role::create (['name ' => 'user ' ]);
8998 $ user ->assignRole ('user ' );
9099 $ response = $ this ->actingAs ($ user )->get ( '/base/collapse ' );
91100 $ response ->assertStatus (200 );
@@ -98,6 +107,7 @@ public function testBaseForms(){
98107
99108 public function testBaseFormsActingAsUser (){
100109 $ user = factory ('App\User ' )->create ();
110+ Role::create (['name ' => 'user ' ]);
101111 $ user ->assignRole ('user ' );
102112 $ response = $ this ->actingAs ($ user )->get ( '/base/forms ' );
103113 $ response ->assertStatus (200 );
@@ -110,6 +120,7 @@ public function testBaseJumbotron(){
110120
111121 public function testBaseJumbotronActingAsUser (){
112122 $ user = factory ('App\User ' )->create ();
123+ Role::create (['name ' => 'user ' ]);
113124 $ user ->assignRole ('user ' );
114125 $ response = $ this ->actingAs ($ user )->get ( '/base/jumbotron ' );
115126 $ response ->assertStatus (200 );
@@ -122,6 +133,7 @@ public function testBaseListgroup(){
122133
123134 public function testBaseBaseListgroupActingAsUser (){
124135 $ user = factory ('App\User ' )->create ();
136+ Role::create (['name ' => 'user ' ]);
125137 $ user ->assignRole ('user ' );
126138 $ response = $ this ->actingAs ($ user )->get ( '/base/list-group ' );
127139 $ response ->assertStatus (200 );
@@ -134,6 +146,7 @@ public function testBaseNavs(){
134146
135147 public function testBaseNavsActingAsUser (){
136148 $ user = factory ('App\User ' )->create ();
149+ Role::create (['name ' => 'user ' ]);
137150 $ user ->assignRole ('user ' );
138151 $ response = $ this ->actingAs ($ user )->get ( '/base/navs ' );
139152 $ response ->assertStatus (200 );
@@ -146,6 +159,7 @@ public function testBasePagination(){
146159
147160 public function testBasePaginationActingAsUser (){
148161 $ user = factory ('App\User ' )->create ();
162+ Role::create (['name ' => 'user ' ]);
149163 $ user ->assignRole ('user ' );
150164 $ response = $ this ->actingAs ($ user )->get ( '/base/pagination ' );
151165 $ response ->assertStatus (200 );
@@ -158,6 +172,7 @@ public function testBasePopovers(){
158172
159173 public function testBasePopoversActingAsUser (){
160174 $ user = factory ('App\User ' )->create ();
175+ Role::create (['name ' => 'user ' ]);
161176 $ user ->assignRole ('user ' );
162177 $ response = $ this ->actingAs ($ user )->get ( '/base/popovers ' );
163178 $ response ->assertStatus (200 );
@@ -170,6 +185,7 @@ public function testBaseProgress(){
170185
171186 public function testBaseProgressActingAsUser (){
172187 $ user = factory ('App\User ' )->create ();
188+ Role::create (['name ' => 'user ' ]);
173189 $ user ->assignRole ('user ' );
174190 $ response = $ this ->actingAs ($ user )->get ( '/base/progress ' );
175191 $ response ->assertStatus (200 );
@@ -182,6 +198,7 @@ public function testBaseScrollSpy(){
182198
183199 public function testBaseScrollspyActingAsUser (){
184200 $ user = factory ('App\User ' )->create ();
201+ Role::create (['name ' => 'user ' ]);
185202 $ user ->assignRole ('user ' );
186203 $ response = $ this ->actingAs ($ user )->get ( '/base/scrollspy ' );
187204 $ response ->assertStatus (200 );
@@ -194,6 +211,7 @@ public function testBaseSwitches(){
194211
195212 public function testBaseSwitchesActingAsUser (){
196213 $ user = factory ('App\User ' )->create ();
214+ Role::create (['name ' => 'user ' ]);
197215 $ user ->assignRole ('user ' );
198216 $ response = $ this ->actingAs ($ user )->get ( '/base/switches ' );
199217 $ response ->assertStatus (200 );
@@ -206,6 +224,7 @@ public function testBaseTables(){
206224
207225 public function testBaseTablesActingAsUser (){
208226 $ user = factory ('App\User ' )->create ();
227+ Role::create (['name ' => 'user ' ]);
209228 $ user ->assignRole ('user ' );
210229 $ response = $ this ->actingAs ($ user )->get ( '/base/tables ' );
211230 $ response ->assertStatus (200 );
@@ -218,6 +237,7 @@ public function testBaseTabs(){
218237
219238 public function testBaseTabsActingAsUser (){
220239 $ user = factory ('App\User ' )->create ();
240+ Role::create (['name ' => 'user ' ]);
221241 $ user ->assignRole ('user ' );
222242 $ response = $ this ->actingAs ($ user )->get ( '/base/tabs ' );
223243 $ response ->assertStatus (200 );
@@ -230,6 +250,7 @@ public function testBaseTooltips(){
230250
231251 public function testBaseTooltipsActingAsUser (){
232252 $ user = factory ('App\User ' )->create ();
253+ Role::create (['name ' => 'user ' ]);
233254 $ user ->assignRole ('user ' );
234255 $ response = $ this ->actingAs ($ user )->get ( '/base/tooltips ' );
235256 $ response ->assertStatus (200 );
@@ -243,6 +264,7 @@ public function testButtonsButtons(){
243264
244265 public function testButtonsButtonsActingAsUser (){
245266 $ user = factory ('App\User ' )->create ();
267+ Role::create (['name ' => 'user ' ]);
246268 $ user ->assignRole ('user ' );
247269 $ response = $ this ->actingAs ($ user )->get ( '/buttons/buttons ' );
248270 $ response ->assertStatus (200 );
@@ -255,6 +277,7 @@ public function testButtonsButtongroup(){
255277
256278 public function testButtonsButtonsgroupActingAsUser (){
257279 $ user = factory ('App\User ' )->create ();
280+ Role::create (['name ' => 'user ' ]);
258281 $ user ->assignRole ('user ' );
259282 $ response = $ this ->actingAs ($ user )->get ( '/buttons/button-group ' );
260283 $ response ->assertStatus (200 );
@@ -267,6 +290,7 @@ public function testButtonsDropdowns(){
267290
268291 public function testButtonsDropdownsActingAsUser (){
269292 $ user = factory ('App\User ' )->create ();
293+ Role::create (['name ' => 'user ' ]);
270294 $ user ->assignRole ('user ' );
271295 $ response = $ this ->actingAs ($ user )->get ( '/buttons/dropdowns ' );
272296 $ response ->assertStatus (200 );
@@ -279,6 +303,7 @@ public function testBrandButtons(){
279303
280304 public function testBrandButtonsActingAsUser (){
281305 $ user = factory ('App\User ' )->create ();
306+ Role::create (['name ' => 'user ' ]);
282307 $ user ->assignRole ('user ' );
283308 $ response = $ this ->actingAs ($ user )->get ( '/buttons/brand-buttons ' );
284309 $ response ->assertStatus (200 );
@@ -293,6 +318,7 @@ public function testCharts(){
293318
294319 public function testChartsActingAsUser (){
295320 $ user = factory ('App\User ' )->create ();
321+ Role::create (['name ' => 'user ' ]);
296322 $ user ->assignRole ('user ' );
297323 $ response = $ this ->actingAs ($ user )->get ( '/charts ' );
298324 $ response ->assertStatus (200 );
@@ -306,6 +332,7 @@ public function testIconsCoreuiIcons(){
306332
307333 public function testIconsCoreuiIconsActingAsUser (){
308334 $ user = factory ('App\User ' )->create ();
335+ Role::create (['name ' => 'user ' ]);
309336 $ user ->assignRole ('user ' );
310337 $ response = $ this ->actingAs ($ user )->get ( '/icon/coreui-icons ' );
311338 $ response ->assertStatus (200 );
@@ -318,6 +345,7 @@ public function testIconsFlags(){
318345
319346 public function testIconsFlagsActingAsUser (){
320347 $ user = factory ('App\User ' )->create ();
348+ Role::create (['name ' => 'user ' ]);
321349 $ user ->assignRole ('user ' );
322350 $ response = $ this ->actingAs ($ user )->get ( '/icon/flags ' );
323351 $ response ->assertStatus (200 );
@@ -330,6 +358,7 @@ public function testIconsBrands(){
330358
331359 public function testIconsBrandsActingAsUser (){
332360 $ user = factory ('App\User ' )->create ();
361+ Role::create (['name ' => 'user ' ]);
333362 $ user ->assignRole ('user ' );
334363 $ response = $ this ->actingAs ($ user )->get ( '/icon/brands ' );
335364 $ response ->assertStatus (200 );
@@ -343,6 +372,7 @@ public function testNotificationsAlerts(){
343372
344373 public function testNotificationsAlertsActingAsUser (){
345374 $ user = factory ('App\User ' )->create ();
375+ Role::create (['name ' => 'user ' ]);
346376 $ user ->assignRole ('user ' );
347377 $ response = $ this ->actingAs ($ user )->get ( '/notifications/alerts ' );
348378 $ response ->assertStatus (200 );
@@ -355,6 +385,7 @@ public function testNotificationsBadge(){
355385
356386 public function testNotificationsBadgeActingAsUser (){
357387 $ user = factory ('App\User ' )->create ();
388+ Role::create (['name ' => 'user ' ]);
358389 $ user ->assignRole ('user ' );
359390 $ response = $ this ->actingAs ($ user )->get ( '/notifications/badge ' );
360391 $ response ->assertStatus (200 );
@@ -367,6 +398,7 @@ public function testNotificationsModals(){
367398
368399 public function testNotificationsModalsActingAsUser (){
369400 $ user = factory ('App\User ' )->create ();
401+ Role::create (['name ' => 'user ' ]);
370402 $ user ->assignRole ('user ' );
371403 $ response = $ this ->actingAs ($ user )->get ( '/notifications/modals ' );
372404 $ response ->assertStatus (200 );
@@ -380,6 +412,7 @@ public function testWidgets(){
380412
381413 public function testWidgetsActingAsUser (){
382414 $ user = factory ('App\User ' )->create ();
415+ Role::create (['name ' => 'user ' ]);
383416 $ user ->assignRole ('user ' );
384417 $ response = $ this ->actingAs ($ user )->get ( '/widgets ' );
385418 $ response ->assertStatus (200 );
@@ -403,6 +436,7 @@ public function test404(){
403436
404437 public function test404ActingAsUser (){
405438 $ user = factory ('App\User ' )->create ();
439+ Role::create (['name ' => 'user ' ]);
406440 $ user ->assignRole ('user ' );
407441 $ response = $ this ->actingAs ($ user )->get ( '/404 ' );
408442 $ response ->assertStatus (200 );
@@ -415,6 +449,7 @@ public function test500(){
415449
416450 public function test500ActingAsUser (){
417451 $ user = factory ('App\User ' )->create ();
452+ Role::create (['name ' => 'user ' ]);
418453 $ user ->assignRole ('user ' );
419454 $ response = $ this ->actingAs ($ user )->get ( '/500 ' );
420455 $ response ->assertStatus (200 );
0 commit comments