Skip to content

Commit 446f5f3

Browse files
committed
Run pint on tests
1 parent d84eb43 commit 446f5f3

300 files changed

Lines changed: 3001 additions & 3228 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

tests/CreatesApplication.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,14 @@
33
namespace Tests;
44

55
use Illuminate\Contracts\Console\Kernel;
6+
use Illuminate\Foundation\Application;
67

78
trait CreatesApplication
89
{
910
/**
1011
* Creates the application.
1112
*
12-
* @return \Illuminate\Foundation\Application
13+
* @return Application
1314
*/
1415
public function createApplication()
1516
{
@@ -19,4 +20,4 @@ public function createApplication()
1920

2021
return $app;
2122
}
22-
}
23+
}

tests/Feature/Accessories/Api/AccessoriesForSelectListTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public function test_adheres_to_full_multiple_companies_support_scoping()
4545
->assertResponseContainsInResults($accessoryB);
4646
}
4747

48-
public function testCanGetAccessoriesForSelectList()
48+
public function test_can_get_accessories_for_select_list()
4949
{
5050
[$accessoryA, $accessoryB] = Accessory::factory()->count(2)->create();
5151

tests/Feature/Accessories/Api/AccessoryFilesTest.php

Lines changed: 41 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
class AccessoryFilesTest extends TestCase
1111
{
12-
public function testAccessoryApiAcceptsFileUpload()
12+
public function test_accessory_api_accepts_file_upload()
1313
{
1414
// Upload a file to a model
1515

@@ -19,17 +19,17 @@ public function testAccessoryApiAcceptsFileUpload()
1919
// Create a superuser to run this as
2020
$user = User::factory()->superuser()->create();
2121

22-
//Upload a file
22+
// Upload a file
2323
$this->actingAsForApi($user)
2424
->post(
2525
route('api.files.store', ['object_type' => 'accessories', 'id' => $accessory->id]), [
26-
'file' => [UploadedFile::fake()->create("test.jpg", 100)]
26+
'file' => [UploadedFile::fake()->create('test.jpg', 100)],
2727
]
2828
)
2929
->assertOk();
3030
}
3131

32-
public function testAccessoryApiListsFiles()
32+
public function test_accessory_api_lists_files()
3333
{
3434
// List all files on a model
3535

@@ -47,13 +47,13 @@ public function testAccessoryApiListsFiles()
4747
->assertOk()
4848
->assertJsonStructure(
4949
[
50-
'rows',
51-
'total',
50+
'rows',
51+
'total',
5252
]
5353
);
5454
}
5555

56-
public function testAccessoryFailsIfInvalidTypePassedInUrl()
56+
public function test_accessory_fails_if_invalid_type_passed_in_url()
5757
{
5858
// List all files on a model
5959

@@ -71,7 +71,7 @@ public function testAccessoryFailsIfInvalidTypePassedInUrl()
7171
->assertStatus(404);
7272
}
7373

74-
public function testAccessoryFailsIfInvalidIdPassedInUrl()
74+
public function test_accessory_fails_if_invalid_id_passed_in_url()
7575
{
7676
// List all files on a model
7777

@@ -90,7 +90,7 @@ public function testAccessoryFailsIfInvalidIdPassedInUrl()
9090
->assertStatusMessageIs('error');
9191
}
9292

93-
public function testAccessoryApiDownloadsFile()
93+
public function test_accessory_api_downloads_file()
9494
{
9595
// Download a file from a model
9696

@@ -104,30 +104,30 @@ public function testAccessoryApiDownloadsFile()
104104
$this->actingAsForApi($user)
105105
->post(
106106
route('api.files.store', ['object_type' => 'accessories', 'id' => $accessory->id]), [
107-
'file' => [UploadedFile::fake()->create("test.jpg", 100)],
107+
'file' => [UploadedFile::fake()->create('test.jpg', 100)],
108108
]
109109
)
110110
->assertOk()
111111
->assertJsonStructure(
112112
[
113-
'status',
114-
'messages',
113+
'status',
114+
'messages',
115115
]
116116
);
117117

118118
// Upload a file with notes
119119
$this->actingAsForApi($user)
120120
->post(
121121
route('api.files.store', ['object_type' => 'accessories', 'id' => $accessory->id]), [
122-
'file' => [UploadedFile::fake()->create("test.jpg", 100)],
123-
'notes' => 'manual'
122+
'file' => [UploadedFile::fake()->create('test.jpg', 100)],
123+
'notes' => 'manual',
124124
]
125125
)
126126
->assertOk()
127127
->assertJsonStructure(
128128
[
129-
'status',
130-
'messages',
129+
'status',
130+
'messages',
131131
]
132132
);
133133

@@ -139,19 +139,19 @@ public function testAccessoryApiDownloadsFile()
139139
->assertOk()
140140
->assertJsonStructure(
141141
[
142-
'total',
143-
'rows'=>[
144-
'*' => [
145-
'id',
146-
'filename',
147-
'url',
148-
'created_by',
149-
'created_at',
150-
'deleted_at',
151-
'note',
152-
'available_actions'
153-
]
154-
]
142+
'total',
143+
'rows' => [
144+
'*' => [
145+
'id',
146+
'filename',
147+
'url',
148+
'created_by',
149+
'created_at',
150+
'deleted_at',
151+
'note',
152+
'available_actions',
153+
],
154+
],
155155
]
156156
)
157157
->assertJsonPath('rows.0.note', null)
@@ -162,16 +162,16 @@ public function testAccessoryApiDownloadsFile()
162162
->get(
163163
route(
164164
'api.files.show', [
165-
'object_type' => 'accessories',
166-
'id' => $accessory->id,
167-
'file_id' => $result->decodeResponseJson()->json()["rows"][0]["id"],
165+
'object_type' => 'accessories',
166+
'id' => $accessory->id,
167+
'file_id' => $result->decodeResponseJson()->json()['rows'][0]['id'],
168168
]
169169
)
170170
)
171171
->assertOk();
172172
}
173173

174-
public function testAccessoryApiDeletesFile()
174+
public function test_accessory_api_deletes_file()
175175
{
176176
// Delete a file from a model
177177

@@ -181,11 +181,11 @@ public function testAccessoryApiDeletesFile()
181181
// Create a superuser to run this as
182182
$user = User::factory()->superuser()->create();
183183

184-
//Upload a file
184+
// Upload a file
185185
$this->actingAsForApi($user)
186186
->post(
187187
route('api.files.store', ['object_type' => 'accessories', 'id' => $accessory->id]), [
188-
'file' => [UploadedFile::fake()->create("test.jpg", 100)]
188+
'file' => [UploadedFile::fake()->create('test.jpg', 100)],
189189
]
190190
)
191191
->assertOk();
@@ -202,18 +202,18 @@ public function testAccessoryApiDeletesFile()
202202
->delete(
203203
route(
204204
'api.files.destroy', [
205-
'object_type' => 'accessories',
206-
'id' => $accessory->id,
207-
'file_id' => $result->decodeResponseJson()->json()["rows"][0]["id"],
205+
'object_type' => 'accessories',
206+
'id' => $accessory->id,
207+
'file_id' => $result->decodeResponseJson()->json()['rows'][0]['id'],
208208
]
209209
)
210210
)
211211
->assertOk()
212212
->assertJsonStructure(
213213
[
214-
'status',
215-
'messages',
214+
'status',
215+
'messages',
216216
]
217217
);
218218
}
219-
}
219+
}

tests/Feature/Accessories/Api/DeleteAccessoriesTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,13 @@ public function test_adheres_to_full_multiple_companies_support_scoping()
5656

5757
public static function checkedOutAccessories()
5858
{
59-
yield 'checked out to user' => [fn() => Accessory::factory()->checkedOutToUser()->create()];
60-
yield 'checked out to asset' => [fn() => Accessory::factory()->checkedOutToAsset()->create()];
61-
yield 'checked out to location' => [fn() => Accessory::factory()->checkedOutToLocation()->create()];
59+
yield 'checked out to user' => [fn () => Accessory::factory()->checkedOutToUser()->create()];
60+
yield 'checked out to asset' => [fn () => Accessory::factory()->checkedOutToAsset()->create()];
61+
yield 'checked out to location' => [fn () => Accessory::factory()->checkedOutToLocation()->create()];
6262
}
6363

6464
#[DataProvider('checkedOutAccessories')]
65-
public function testCannotDeleteAccessoryThatHasCheckouts($data)
65+
public function test_cannot_delete_accessory_that_has_checkouts($data)
6666
{
6767
$accessory = $data();
6868

@@ -73,7 +73,7 @@ public function testCannotDeleteAccessoryThatHasCheckouts($data)
7373
$this->assertNotSoftDeleted($accessory);
7474
}
7575

76-
public function testCanDeleteAccessory()
76+
public function test_can_delete_accessory()
7777
{
7878
$accessory = Accessory::factory()->create();
7979

tests/Feature/Accessories/Api/IndexAccessoryCheckoutsTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public function test_adheres_to_full_multiple_companies_support_scoping()
4646
->assertOk();
4747
}
4848

49-
public function testCanGetAccessoryCheckouts()
49+
public function test_can_get_accessory_checkouts()
5050
{
5151
[$userA, $userB] = User::factory()->count(2)->create();
5252

@@ -62,7 +62,7 @@ public function testCanGetAccessoryCheckouts()
6262
->assertJsonPath('rows.1.assigned_to.id', $userB->id);
6363
}
6464

65-
public function testCanGetAccessoryCheckoutsWithOffsetAndLimitInQueryString()
65+
public function test_can_get_accessory_checkouts_with_offset_and_limit_in_query_string()
6666
{
6767
[$userA, $userB, $userC] = User::factory()->count(3)->create();
6868

tests/Feature/Accessories/Api/IndexAccessoryTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public function test_adheres_to_full_multiple_companies_support_scoping()
5454
->assertResponseContainsInRows($accessoryC);
5555
}
5656

57-
public function testCanGetAccessories()
57+
public function test_can_get_accessories()
5858
{
5959
$user = User::factory()->viewAccessories()->create();
6060

tests/Feature/Accessories/Api/ShowAccessoryTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public function test_adheres_to_full_multiple_companies_support_scoping()
4444
]);
4545
}
4646

47-
public function testCanGetSingleAccessory()
47+
public function test_can_get_single_accessory()
4848
{
4949
$accessory = Accessory::factory()->checkedOutToUser()->create(['name' => 'My Accessory']);
5050

tests/Feature/Accessories/Api/StoreAccessoryTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public function test_adheres_to_full_multiple_companies_support_scoping()
4444
]);
4545
}
4646

47-
public function testValidation()
47+
public function test_validation()
4848
{
4949
$this->actingAsForApi(User::factory()->createAccessories()->create())
5050
->postJson(route('api.accessories.store'), [
@@ -58,7 +58,7 @@ public function testValidation()
5858
]);
5959
}
6060

61-
public function testCanStoreAccessory()
61+
public function test_can_store_accessory()
6262
{
6363
$category = Category::factory()->forAccessories()->create();
6464
$company = Company::factory()->create();

tests/Feature/Accessories/Api/UpdateAccessoryTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public function test_adheres_to_full_multiple_companies_support_scoping()
5555
$this->assertEquals('New Name', $accessoryC->fresh()->name);
5656
}
5757

58-
public function testCanUpdateAccessoryViaPatch()
58+
public function test_can_update_accessory_via_patch()
5959
{
6060
[$categoryA, $categoryB] = Category::factory()->count(2)->create();
6161
[$companyA, $companyB] = Company::factory()->count(2)->create();

tests/Feature/Accessories/Ui/AccessoriesIndexTest.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,15 @@ public function test_requires_permission()
1515
->assertForbidden();
1616
}
1717

18-
19-
public function testRendersAccessoriesIndexPage()
18+
public function test_renders_accessories_index_page()
2019
{
2120
$this->actingAs(User::factory()->viewAccessories()->create())
2221
->get(route('accessories.index'))
2322
->assertOk()
2423
->assertViewIs('accessories.index');
2524
}
26-
27-
public function testPageRenders()
25+
26+
public function test_page_renders()
2827
{
2928
$this->actingAs(User::factory()->superuser()->create())
3029
->get(route('accessories.index'))

0 commit comments

Comments
 (0)