File tree 4 files changed +8
-9
lines changed
4 files changed +8
-9
lines changed Original file line number Diff line number Diff line change 4
4
5
5
namespace App \Events ;
6
6
7
- use App \Contracts \ReplyInterface ;
8
7
use App \Models \Discussion ;
9
8
use App \Models \Reply ;
10
9
use Illuminate \Queue \SerializesModels ;
13
12
{
14
13
use SerializesModels;
15
14
16
- public function __construct (public Reply $ reply , public Discussion | ReplyInterface $ discussion ) {}
15
+ public function __construct (public Reply $ reply , public Discussion $ discussion ) {}
17
16
}
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ parameters:
12
12
# Remove this config after migrate everything to livewire
13
13
- app/Http/Controllers/*
14
14
- app/Markdown/*
15
- - app/Traits/HasSlug.php
15
+ - app/Models/ Traits/HasSlug.php
16
16
ignoreErrors :
17
17
- " #^Cannot access property \\$transaction on array\\|object\\.$ #"
18
18
- identifier : missingType.iterableValue
Original file line number Diff line number Diff line change 47
47
it ('generates a slug when valid url characters provided ' , function (): void {
48
48
$ discussion = Discussion::factory ()->make (['slug ' => 'Help with eloquent ' ]);
49
49
50
- expect ($ discussion ->slug () )->toEqual ('help-with-eloquent ' );
50
+ expect ($ discussion ->slug )->toEqual ('help-with-eloquent ' );
51
51
});
52
52
53
53
it ('generates a unique slug when valid url characters provided ' , function (): void {
54
54
$ discussionOne = Discussion::factory ()->create (['slug ' => 'Help with eloquent ' ]);
55
55
$ discussionTwo = Discussion::factory ()->create (['slug ' => 'Help with eloquent ' ]);
56
56
57
- expect ($ discussionTwo ->slug () )->toEqual ('help-with-eloquent-1 ' );
57
+ expect ($ discussionTwo ->slug )->toEqual ('help-with-eloquent-1 ' );
58
58
});
59
59
60
60
it ('generates a slug when invalid url characters provided ' , function (): void {
61
61
$ discussion = Discussion::factory ()->make (['slug ' => '한글 테스트 ' ]);
62
62
63
63
// When providing a slug with invalid url characters, a random 5 character string is returned.
64
- expect ($ discussion ->slug () )->toMatch ('/\w{5}/ ' );
64
+ expect ($ discussion ->slug )->toMatch ('/\w{5}/ ' );
65
65
});
Original file line number Diff line number Diff line change 145
145
it ('generates a slug when valid url characters provided ' , function (): void {
146
146
$ thread = Thread::factory ()->make (['slug ' => 'Help with eloquent ' ]);
147
147
148
- expect ($ thread ->slug () )->toEqual ('help-with-eloquent ' );
148
+ expect ($ thread ->slug )->toEqual ('help-with-eloquent ' );
149
149
});
150
150
151
151
it ('generates a unique slug when valid url characters provided ' , function (): void {
152
152
Thread::factory ()->create (['slug ' => 'Help with eloquent ' ]);
153
153
$ thread = Thread::factory ()->create (['slug ' => 'Help with eloquent ' ]);
154
154
155
- expect ($ thread ->slug () )->toEqual ('help-with-eloquent-1 ' );
155
+ expect ($ thread ->slug )->toEqual ('help-with-eloquent-1 ' );
156
156
});
157
157
158
158
it ('generates a slug when invalid url characters provided ' , function (): void {
159
159
$ thread = Thread::factory ()->make (['slug ' => '한글 테스트 ' ]);
160
160
161
161
// When providing a slug with invalid url characters, a random 5 character string is returned.
162
- expect ($ thread ->slug () )->toMatch ('/\w{5}/ ' );
162
+ expect ($ thread ->slug )->toMatch ('/\w{5}/ ' );
163
163
});
You can’t perform that action at this time.
0 commit comments