@@ -23,19 +23,37 @@ public function setUp(): void
2323 [
2424 'slug ' => 'test ' ,
2525 'files ' => [
26- ['filename ' => 'a.jpg ' ],
27- ['filename ' => 'b.jpg ' ],
28- ['filename ' => 'c.jpg ' ]
26+ [
27+ 'filename ' => 'a.jpg ' ,
28+ 'content ' => ['uuid ' => 'test-a ' ],
29+ ],
30+ [
31+ 'filename ' => 'b.jpg ' ,
32+ 'content ' => ['uuid ' => 'test-b ' ],
33+ ],
34+ [
35+ 'filename ' => 'c.jpg ' ,
36+ 'content ' => ['uuid ' => 'test-c ' ],
37+ ],
2938 ]
3039 ]
3140 ],
3241 'drafts ' => [
3342 [
3443 'slug ' => 'test-draft ' ,
3544 'files ' => [
36- ['filename ' => 'a.jpg ' ],
37- ['filename ' => 'b.jpg ' ],
38- ['filename ' => 'c.jpg ' ]
45+ [
46+ 'filename ' => 'a.jpg ' ,
47+ 'content ' => ['uuid ' => 'draft-a ' ],
48+ ],
49+ [
50+ 'filename ' => 'b.jpg ' ,
51+ 'content ' => ['uuid ' => 'draft-b ' ],
52+ ],
53+ [
54+ 'filename ' => 'c.jpg ' ,
55+ 'content ' => ['uuid ' => 'draft-c ' ],
56+ ],
3957 ]
4058 ]
4159 ]
@@ -77,8 +95,8 @@ public function testValue(): void
7795 ]);
7896
7997 $ expected = [
80- 'test/a.jpg ' ,
81- 'test/b.jpg '
98+ 'file://test-a ' ,
99+ 'file://test-b '
82100 ];
83101
84102 $ this ->assertSame ($ expected , $ field ->value ());
@@ -129,8 +147,8 @@ public function testFilesInDraft(): void
129147 ]);
130148
131149 $ expected = [
132- 'test-draft/a.jpg ' ,
133- 'test-draft/b.jpg '
150+ 'file://draft-a ' ,
151+ 'file://draft-b '
134152 ];
135153
136154 $ this ->assertSame ($ expected , $ field ->value ());
@@ -200,9 +218,18 @@ public function testApiItems(): void
200218 [
201219 'slug ' => 'test ' ,
202220 'files ' => [
203- ['filename ' => 'a.jpg ' ],
204- ['filename ' => 'b.jpg ' ],
205- ['filename ' => 'c.jpg ' ],
221+ [
222+ 'filename ' => 'a.jpg ' ,
223+ 'content ' => ['uuid ' => 'my-a ' ],
224+ ],
225+ [
226+ 'filename ' => 'b.jpg ' ,
227+ 'content ' => ['uuid ' => 'my-b ' ],
228+ ],
229+ [
230+ 'filename ' => 'c.jpg ' ,
231+ 'content ' => ['uuid ' => 'my-c ' ],
232+ ],
206233 ],
207234 'blueprint ' => [
208235 'title ' => 'Test ' ,
@@ -227,8 +254,8 @@ public function testApiItems(): void
227254 $ api = $ app ->api ()->call ('pages/test/fields/gallery/items ' );
228255
229256 $ this ->assertCount (2 , $ api );
230- $ this ->assertSame ('a.jpg ' , $ api [0 ]['id ' ]);
231- $ this ->assertSame ('b.jpg ' , $ api [1 ]['id ' ]);
257+ $ this ->assertSame ('file://my-a ' , $ api [0 ]['id ' ]);
258+ $ this ->assertSame ('file://my-b ' , $ api [1 ]['id ' ]);
232259 }
233260
234261 public function testParentModel (): void
0 commit comments