Skip to content

Commit fef5d77

Browse files
authored
Merge pull request #8 from mailcarrierapp/feat/tests
Add tests
2 parents bffd657 + 08da0fd commit fef5d77

30 files changed

+2416
-509
lines changed

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
"nunomaduro/larastan": "^2.0.1",
3838
"orchestra/testbench": "^7.0",
3939
"pestphp/pest": "^1.21",
40+
"pestphp/pest-plugin-faker": "^1.0",
4041
"pestphp/pest-plugin-laravel": "^1.1",
4142
"phpstan/extension-installer": "^1.1",
4243
"phpstan/phpstan-deprecation-rules": "^1.0",

composer.lock

Lines changed: 540 additions & 483 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

database/factories/AttachmentFactory.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ public function definition(): array
1616
return [
1717
'log_id' => Log::factory(),
1818
'strategy' => AttachmentLogStrategy::None,
19+
'name' => $this->faker->slug() . '.pdf',
1920
'size' => $this->faker->numberBetween(1, 10000),
2021
'path' => $this->faker->filePath(),
2122
'disk' => null,

database/migrations/1_create_users_table.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44
use Illuminate\Database\Schema\Blueprint;
55
use Illuminate\Support\Facades\Schema;
66

7-
return new class extends Migration
8-
{
7+
return new class extends Migration {
98
/**
109
* Run the migrations.
1110
*/

database/migrations/2_create_layouts_table.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44
use Illuminate\Database\Schema\Blueprint;
55
use Illuminate\Support\Facades\Schema;
66

7-
return new class extends Migration
8-
{
7+
return new class extends Migration {
98
/**
109
* Run the migrations.
1110
*/

database/migrations/3_create_templates_table.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44
use Illuminate\Database\Schema\Blueprint;
55
use Illuminate\Support\Facades\Schema;
66

7-
return new class extends Migration
8-
{
7+
return new class extends Migration {
98
/**
109
* Run the migrations.
1110
*/

database/migrations/4_create_logs_table.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55
use Illuminate\Support\Facades\Schema;
66
use MailCarrier\Models\Template;
77

8-
return new class extends Migration
9-
{
8+
return new class extends Migration {
109
/**
1110
* Run the migrations.
1211
*/

database/migrations/5_create_attachments_table.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55
use Illuminate\Support\Facades\Schema;
66
use MailCarrier\Models\Log;
77

8-
return new class extends Migration
9-
{
8+
return new class extends Migration {
109
/**
1110
* Run the migrations.
1211
*/

pint.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@
77
"spacing": "one"
88
},
99
"method_argument_space": true,
10-
"single_trait_insert_per_statement": true
10+
"single_trait_insert_per_statement": true,
11+
"curly_braces_position": {
12+
"anonymous_classes_opening_brace": "same_line"
13+
},
14+
"fully_qualified_strict_types": false
1115
}
1216
}

routes/web.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@
88

99
Route::middleware(['web', 'auth:' . Config::get('filament.auth.guard')])->group(function () {
1010
Route::get('preview/logs/{log}', [LogController::class, 'preview'])->name('logs.preview');
11-
Route::get('attachment/{attachment}', [MailCarrierController::class, 'downloadAttachment'])->name('download.attachment');
11+
Route::get('attachment/{attachment}', [MailCarrierController::class, 'downloadAttachment'])
12+
->whereUuid('attachment')
13+
->name('download.attachment');
1214
});
1315

1416
Route::prefix('auth')->middleware(['web', 'guest'])->group(function () {

0 commit comments

Comments
 (0)