@@ -14,7 +14,7 @@ class ImageTest extends TestCase
14
14
15
15
public function test_image_upload ()
16
16
{
17
- $ page = Page::first ();
17
+ $ page = Page::query ()-> first ();
18
18
$ admin = $ this ->getAdmin ();
19
19
$ this ->actingAs ($ admin );
20
20
@@ -38,7 +38,7 @@ public function test_image_upload()
38
38
39
39
public function test_image_display_thumbnail_generation_does_not_increase_image_size ()
40
40
{
41
- $ page = Page::first ();
41
+ $ page = Page::query ()-> first ();
42
42
$ admin = $ this ->getAdmin ();
43
43
$ this ->actingAs ($ admin );
44
44
@@ -108,7 +108,7 @@ public function test_gallery_get_list_format()
108
108
109
109
public function test_image_usage ()
110
110
{
111
- $ page = Page::first ();
111
+ $ page = Page::query ()-> first ();
112
112
$ editor = $ this ->getEditor ();
113
113
$ this ->actingAs ($ editor );
114
114
@@ -128,7 +128,7 @@ public function test_image_usage()
128
128
129
129
public function test_php_files_cannot_be_uploaded ()
130
130
{
131
- $ page = Page::first ();
131
+ $ page = Page::query ()-> first ();
132
132
$ admin = $ this ->getAdmin ();
133
133
$ this ->actingAs ($ admin );
134
134
@@ -150,7 +150,7 @@ public function test_php_files_cannot_be_uploaded()
150
150
151
151
public function test_php_like_files_cannot_be_uploaded ()
152
152
{
153
- $ page = Page::first ();
153
+ $ page = Page::query ()-> first ();
154
154
$ admin = $ this ->getAdmin ();
155
155
$ this ->actingAs ($ admin );
156
156
@@ -202,7 +202,7 @@ public function test_url_entities_removed_from_filenames()
202
202
];
203
203
foreach ($ badNames as $ name ) {
204
204
$ galleryFile = $ this ->getTestImage ($ name );
205
- $ page = Page::first ();
205
+ $ page = Page::query ()-> first ();
206
206
$ badPath = $ this ->getTestImagePath ('gallery ' , $ name );
207
207
$ this ->deleteImage ($ badPath );
208
208
@@ -227,7 +227,7 @@ public function test_secure_images_uploads_to_correct_place()
227
227
config ()->set ('filesystems.images ' , 'local_secure ' );
228
228
$ this ->asEditor ();
229
229
$ galleryFile = $ this ->getTestImage ('my-secure-test-upload.png ' );
230
- $ page = Page::first ();
230
+ $ page = Page::query ()-> first ();
231
231
$ expectedPath = storage_path ('uploads/images/gallery/ ' . Date ('Y-m ' ) . '/my-secure-test-upload.png ' );
232
232
233
233
$ upload = $ this ->call ('POST ' , '/images/gallery ' , ['uploaded_to ' => $ page ->id ], [], ['file ' => $ galleryFile ], []);
@@ -245,7 +245,7 @@ public function test_secure_images_included_in_exports()
245
245
config ()->set ('filesystems.images ' , 'local_secure ' );
246
246
$ this ->asEditor ();
247
247
$ galleryFile = $ this ->getTestImage ('my-secure-test-upload.png ' );
248
- $ page = Page::first ();
248
+ $ page = Page::query ()-> first ();
249
249
$ expectedPath = storage_path ('uploads/images/gallery/ ' . Date ('Y-m ' ) . '/my-secure-test-upload.png ' );
250
250
251
251
$ upload = $ this ->call ('POST ' , '/images/gallery ' , ['uploaded_to ' => $ page ->id ], [], ['file ' => $ galleryFile ], []);
@@ -282,7 +282,7 @@ public function test_system_images_remain_public()
282
282
283
283
public function test_image_delete ()
284
284
{
285
- $ page = Page::first ();
285
+ $ page = Page::query ()-> first ();
286
286
$ this ->asAdmin ();
287
287
$ imageName = 'first-image.png ' ;
288
288
$ relPath = $ this ->getTestImagePath ('gallery ' , $ imageName );
@@ -304,7 +304,7 @@ public function test_image_delete()
304
304
305
305
public function test_image_delete_does_not_delete_similar_images ()
306
306
{
307
- $ page = Page::first ();
307
+ $ page = Page::query ()-> first ();
308
308
$ this ->asAdmin ();
309
309
$ imageName = 'first-image.png ' ;
310
310
@@ -383,7 +383,7 @@ public function test_user_images_deleted_on_user_deletion()
383
383
384
384
public function test_deleted_unused_images ()
385
385
{
386
- $ page = Page::first ();
386
+ $ page = Page::query ()-> first ();
387
387
$ admin = $ this ->getAdmin ();
388
388
$ this ->actingAs ($ admin );
389
389
0 commit comments