user->attachPermission(Permission::where('name', 'read-admin-panel')->firstOrFail()); $this->loginAs()->withExceptionHandling(); foreach (['courier-payables', 'courier-payables-final'] as $section) { $directory = route('business.pages.show', ['section' => $section]); $this->get($directory) ->assertOk() ->assertDontSeeText('运费对账') ->assertSee(route('business.pages.show', ['section' => $section, 'page' => 'shipping-data']), false); $this->from($directory)->get(route('business.pages.show', [ 'section' => $section, 'page' => 'freight-reconciliation', ]))->assertRedirect($directory); $this->getJson(route('business.pages.show', [ 'section' => $section, 'page' => 'freight-reconciliation', 'courier_summary' => 1, ]), ['X-Requested-With' => 'XMLHttpRequest'])->assertNotFound(); } } }