A free open source IT asset/license management system
Fixed a few more tests and strings
snipe24a17b09a55e
diff --git a/app/Providers/BreadcrumbsServiceProvider.php b/app/Providers/BreadcrumbsServiceProvider.phpindex 1b799e2034..89a9ac9676 100644--- a/app/Providers/BreadcrumbsServiceProvider.php+++ b/app/Providers/BreadcrumbsServiceProvider.php@@ -70,7 +70,7 @@ class BreadcrumbsServiceProvider extends ServiceProviderBreadcrumbs::for('hardware.edit', fn (Trail $trail, Asset $asset) =>$trail->parent('hardware.index', route('hardware.index'))- ->push(trans('general.actions.edit_item', ['name' => $asset->asset_tag]), route('home'))+ ->push(trans('general.breadcrumb_button_actions.edit_item', ['name' => $asset->asset_tag]), route('home')));// Non-resource routes@@ -101,7 +101,7 @@ class BreadcrumbsServiceProvider extends ServiceProviderBreadcrumbs::for('models.edit', fn (Trail $trail, AssetModel $model) =>$trail->parent('models.index', route('models.index'))- ->push(trans('general.actions.edit_item', ['name' => $model->name]), route('home'))+ ->push(trans('general.breadcrumb_button_actions.edit_item', ['name' => $model->name]), route('home')));@@ -125,7 +125,7 @@ class BreadcrumbsServiceProvider extends ServiceProviderBreadcrumbs::for('accessories.edit', fn (Trail $trail, Accessory $accessory) =>$trail->parent('accessories.index', route('accessories.index'))- ->push(trans('general.actions.edit_item', ['name' => $accessory->name]), route('home'))+ ->push(trans('general.breadcrumb_button_actions.edit_item', ['name' => $accessory->name]), route('home')));@@ -149,7 +149,7 @@ class BreadcrumbsServiceProvider extends ServiceProviderBreadcrumbs::for('categories.edit', fn (Trail $trail, Category $category) =>$trail->parent('categories.index', route('categories.index'))- ->push(trans('general.actions.edit_item', ['name' => $category->name]), route('home'))+ ->push(trans('general.breadcrumb_button_actions.edit_item', ['name' => $category->name]), route('home')));@@ -174,7 +174,7 @@ class BreadcrumbsServiceProvider extends ServiceProviderBreadcrumbs::for('companies.edit', fn (Trail $trail, Company $company) =>$trail->parent('companies.index', route('companies.index'))- ->push(trans('general.actions.edit_item', ['name' => $company->name]), route('home'))+ ->push(trans('general.breadcrumb_button_actions.edit_item', ['name' => $company->name]), route('home')));@@ -198,7 +198,7 @@ class BreadcrumbsServiceProvider extends ServiceProviderBreadcrumbs::for('components.edit', fn (Trail $trail, Component $component) =>$trail->parent('components.index', route('components.index'))- ->push(trans('general.actions.edit_item', ['name' => $component->name]), route('home'))+ ->push(trans('general.breadcrumb_button_actions.edit_item', ['name' => $component->name]), route('home')));@@ -222,7 +222,7 @@ class BreadcrumbsServiceProvider extends ServiceProviderBreadcrumbs::for('consumables.edit', fn (Trail $trail, Consumable $consumable) =>$trail->parent('consumables.index', route('consumables.index'))- ->push(trans('general.actions.edit_item', ['name' => $consumable->name]), route('home'))+ ->push(trans('general.breadcrumb_button_actions.edit_item', ['name' => $consumable->name]), route('home')));@@ -247,7 +247,7 @@ class BreadcrumbsServiceProvider extends ServiceProviderBreadcrumbs::for('departments.edit', fn (Trail $trail, Department $department) =>$trail->parent('departments.index', route('departments.index'))- ->push(trans('general.actions.edit_item', ['name' => $department->name]), route('home'))+ ->push(trans('general.breadcrumb_button_actions.edit_item', ['name' => $department->name]), route('home')));@@ -271,7 +271,7 @@ class BreadcrumbsServiceProvider extends ServiceProviderBreadcrumbs::for('depreciations.edit', fn (Trail $trail, Depreciation $depreciation) =>$trail->parent('depreciations.index', route('depreciations.index'))- ->push(trans('general.actions.edit_item', ['name' => $depreciation->name]), route('home'))+ ->push(trans('general.breadcrumb_button_actions.edit_item', ['name' => $depreciation->name]), route('home')));/**@@ -294,7 +294,7 @@ class BreadcrumbsServiceProvider extends ServiceProviderBreadcrumbs::for('groups.edit', fn (Trail $trail, Group $group) =>$trail->parent('groups.index', route('groups.index'))- ->push(trans('general.actions.edit_item', ['name' => $group->name]), route('home'))+ ->push(trans('general.breadcrumb_button_actions.edit_item', ['name' => $group->name]), route('home')));@@ -318,7 +318,7 @@ class BreadcrumbsServiceProvider extends ServiceProviderBreadcrumbs::for('licenses.edit', fn (Trail $trail, License $license) =>$trail->parent('licenses.index', route('licenses.index'))- ->push(trans('general.actions.edit_item', ['name' => $license->name]), route('home'))+ ->push(trans('general.breadcrumb_button_actions.edit_item', ['name' => $license->name]), route('home')));@@ -354,7 +354,7 @@ class BreadcrumbsServiceProvider extends ServiceProviderBreadcrumbs::for('locations.edit', fn (Trail $trail, Location $location) =>$trail->parent('locations.index', route('locations.index'))- ->push(trans('general.actions.edit_item', ['name' => $location->name]), route('home'))+ ->push(trans('general.breadcrumb_button_actions.edit_item', ['name' => $location->name]), route('home')));@@ -378,7 +378,7 @@ class BreadcrumbsServiceProvider extends ServiceProviderBreadcrumbs::for('manufacturers.edit', fn (Trail $trail, Manufacturer $manufacturer) =>$trail->parent('manufacturers.index', route('manufacturers.index'))- ->push(trans('general.actions.edit_item', ['name' => $manufacturer->name]), route('home'))+ ->push(trans('general.breadcrumb_button_actions.edit_item', ['name' => $manufacturer->name]), route('home')));@@ -402,7 +402,7 @@ class BreadcrumbsServiceProvider extends ServiceProviderBreadcrumbs::for('statuslabels.edit', fn (Trail $trail, Statuslabel $statuslabel) =>$trail->parent('statuslabels.index', route('statuslabels.index'))- ->push(trans('general.actions.edit_item', ['name' => $statuslabel->name]), route('home'))+ ->push(trans('general.breadcrumb_button_actions.edit_item', ['name' => $statuslabel->name]), route('home')));@@ -426,7 +426,7 @@ class BreadcrumbsServiceProvider extends ServiceProviderBreadcrumbs::for('suppliers.edit', fn (Trail $trail, Supplier $supplier) =>$trail->parent('suppliers.index', route('suppliers.index'))- ->push(trans('general.actions.edit_item', ['name' => $supplier->name]), route('home'))+ ->push(trans('general.breadcrumb_button_actions.edit_item', ['name' => $supplier->name]), route('home')));@@ -451,7 +451,7 @@ class BreadcrumbsServiceProvider extends ServiceProviderBreadcrumbs::for('users.edit', fn (Trail $trail, User $user) =>$trail->parent('users.index', route('users.index'))- ->push(trans('general.actions.edit_item', ['name' => $user->name]), route('home'))+ ->push(trans('general.breadcrumb_button_actions.edit_item', ['name' => $user->name]), route('home')));diff --git a/resources/lang/en-US/general.php b/resources/lang/en-US/general.phpindex a35704de78..b2a58a952f 100644--- a/resources/lang/en-US/general.php+++ b/resources/lang/en-US/general.php@@ -587,7 +587,7 @@ return ['notes' => 'Add a note',],- 'actions' => [+ 'breadcrumb_button_actions' => ['edit_item' => 'Edit :name','checkout_item' => 'Checkout :name','checkin_item' => 'Checkin :name',diff --git a/tests/Feature/Checkouts/Ui/AssetCheckoutTest.php b/tests/Feature/Checkouts/Ui/AssetCheckoutTest.phpindex c92baa2fe4..f364064a1d 100644--- a/tests/Feature/Checkouts/Ui/AssetCheckoutTest.php+++ b/tests/Feature/Checkouts/Ui/AssetCheckoutTest.php@@ -260,7 +260,7 @@ class AssetCheckoutTest extends TestCase$asset->forceSave();$this->actingAs(User::factory()->admin()->create())- ->get(route('hardware.checkout.create', ['assetId' => $asset->id]))+ ->get(route('hardware.checkout.create', $asset))->assertStatus(302)->assertSessionHas('error')->assertRedirect(route('hardware.show', $asset));diff --git a/tests/Feature/Checkouts/Ui/LicenseCheckoutTest.php b/tests/Feature/Checkouts/Ui/LicenseCheckoutTest.phpindex f322bee1b3..1750b75647 100644--- a/tests/Feature/Checkouts/Ui/LicenseCheckoutTest.php+++ b/tests/Feature/Checkouts/Ui/LicenseCheckoutTest.php@@ -24,7 +24,7 @@ class LicenseCheckoutTest extends TestCase$licenseSeat = LicenseSeat::factory()->create();$this->actingAs($admin)- ->post("/licenses/{$licenseSeat->license->id}/checkout", [+ ->post(route('licenses.checkout', $licenseSeat->license), ['checkout_to_type' => 'asset','assigned_to' => null,'asset_id' => $asset->id,@@ -47,7 +47,7 @@ class LicenseCheckoutTest extends TestCase$licenseSeat = LicenseSeat::factory()->create();$this->actingAs($admin)- ->post("/licenses/{$licenseSeat->license->id}/checkout", [+ ->post(route('licenses.checkout', $licenseSeat->license), ['checkout_to_type' => 'user','assigned_to' => $admin->id,'asset_id' => null,@@ -69,8 +69,8 @@ class LicenseCheckoutTest extends TestCase$license = License::factory()->create();$this->actingAs(User::factory()->admin()->create())- ->from(route('licenses.checkout', ['licenseId' => $license->id]))- ->post(route('licenses.checkout', ['licenseId' => $license->id]), [+ ->from(route('licenses.checkout', $license))+ ->post(route('licenses.checkout', $license), ['assigned_to' => User::factory()->create()->id,'redirect_option' => 'index','assigned_qty' => 1,@@ -84,8 +84,8 @@ class LicenseCheckoutTest extends TestCase$license = License::factory()->create();$this->actingAs(User::factory()->admin()->create())- ->from(route('licenses.checkout', ['licenseId' => $license->id]))- ->post(route('licenses.checkout' , ['licenseId' => $license->id]), [+ ->from(route('licenses.checkout', $license))+ ->post(route('licenses.checkout', $license), ['assigned_to' => User::factory()->create()->id,'redirect_option' => 'item',])@@ -99,7 +99,7 @@ class LicenseCheckoutTest extends TestCase$license = License::factory()->create();$this->actingAs(User::factory()->admin()->create())- ->from(route('licenses.checkout', ['licenseId' => $license->id]))+ ->from(route('licenses.checkout', $license))->post(route('licenses.checkout' , $license), ['assigned_to' => $user->id,'redirect_option' => 'target',@@ -113,7 +113,7 @@ class LicenseCheckoutTest extends TestCase$license = License::factory()->create();$this->actingAs(User::factory()->admin()->create())- ->from(route('licenses.checkout', ['licenseId' => $license->id]))+ ->from(route('licenses.checkout', $license))->post(route('licenses.checkout' , $license), ['asset_id' => $asset->id,'redirect_option' => 'target',