|
22 | 22 |
|
23 | 23 | afterEach(function () { |
24 | 24 | if ($this->post->image) { |
25 | | - Storage::disk('public')->delete('blog/' . $this->post->image); |
| 25 | + Storage::disk('public')->delete('blog/'.$this->post->image); |
26 | 26 | } |
27 | 27 | }); |
28 | 28 |
|
|
32 | 32 | $response->assertStatus(200); |
33 | 33 |
|
34 | 34 | $response->assertInertia( |
35 | | - fn(Assert $page) => $page |
| 35 | + fn (Assert $page) => $page |
36 | 36 | ->component('BlogPost/PostIndex') |
37 | 37 | ->has( |
38 | 38 | 'posts.data', |
39 | 39 | 1, |
40 | | - fn(Assert $page) => $page |
| 40 | + fn (Assert $page) => $page |
41 | 41 | ->where('id', $this->post->id) |
42 | 42 | ->where('image_url', $this->post->image_url) |
43 | 43 | ->where('title', $this->post->title) |
|
52 | 52 | $response->assertStatus(200); |
53 | 53 |
|
54 | 54 | $response->assertInertia( |
55 | | - fn(Assert $page) => $page |
| 55 | + fn (Assert $page) => $page |
56 | 56 | ->component('BlogPost/PostForm') |
57 | 57 | ); |
58 | 58 | }); |
|
78 | 78 | }); |
79 | 79 |
|
80 | 80 | test('post edit page can be rendered', function () { |
81 | | - $response = $this->loggedRequest->get('/admin/blog-post/' . $this->post->id . '/edit'); |
| 81 | + $response = $this->loggedRequest->get('/admin/blog-post/'.$this->post->id.'/edit'); |
82 | 82 |
|
83 | 83 | $response->assertStatus(200); |
84 | 84 |
|
85 | 85 | $response->assertInertia( |
86 | | - fn(Assert $page) => $page |
| 86 | + fn (Assert $page) => $page |
87 | 87 | ->component('BlogPost/PostForm') |
88 | 88 | ->has( |
89 | 89 | 'post', |
90 | | - fn(Assert $page) => $page |
| 90 | + fn (Assert $page) => $page |
91 | 91 | ->where('id', $this->post->id) |
92 | 92 | ->where('blog_author_id', $this->post->blog_author_id) |
93 | 93 | ->where('blog_category_id', $this->post->blog_category_id) |
|
106 | 106 | }); |
107 | 107 |
|
108 | 108 | test('post can be updated', function () { |
109 | | - $response = $this->loggedRequest->put('/admin/blog-post/' . $this->post->id, [ |
| 109 | + $response = $this->loggedRequest->put('/admin/blog-post/'.$this->post->id, [ |
110 | 110 | 'blog_author_id' => null, |
111 | 111 | 'blog_category_id' => null, |
112 | 112 | 'title' => 'New Post Title', |
|
121 | 121 |
|
122 | 122 | $redirectResponse = $this->loggedRequest->get('/admin/blog-post'); |
123 | 123 | $redirectResponse->assertInertia( |
124 | | - fn(Assert $page) => $page |
| 124 | + fn (Assert $page) => $page |
125 | 125 | ->component('BlogPost/PostIndex') |
126 | 126 | ->has( |
127 | 127 | 'posts.data', |
128 | 128 | 1, |
129 | | - fn(Assert $page) => $page |
| 129 | + fn (Assert $page) => $page |
130 | 130 | ->where('id', $this->post->id) |
131 | 131 | ->where('title', 'New Post Title') |
132 | 132 | ->where('image_url', $this->post->image_url) |
|
136 | 136 | }); |
137 | 137 |
|
138 | 138 | test('post can be deleted', function () { |
139 | | - $response = $this->loggedRequest->delete('/admin/blog-post/' . $this->user->id); |
| 139 | + $response = $this->loggedRequest->delete('/admin/blog-post/'.$this->user->id); |
140 | 140 |
|
141 | 141 | $response->assertRedirect('/admin/blog-post'); |
142 | 142 |
|
|
0 commit comments