File tree 1 file changed +27
-0
lines changed
packages/framework/tests/Feature
1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -143,4 +143,31 @@ public function test_get_metadata_array()
143
143
'contentUrl ' => null ,
144
144
], $ image ->getMetadataArray ());
145
145
}
146
+
147
+ public function test_get_link_resolves_remote_paths ()
148
+ {
149
+ $ image = new Image ([
150
+ 'uri ' => 'https://example.com/image.jpg ' ,
151
+ ]);
152
+
153
+ $ this ->assertEquals ('https://example.com/image.jpg ' , $ image ->getLink ());
154
+ }
155
+
156
+ public function test_get_link_resolves_local_paths ()
157
+ {
158
+ $ image = new Image ([
159
+ 'path ' => 'image.jpg ' ,
160
+ ]);
161
+
162
+ $ this ->assertEquals ('media/image.jpg ' , $ image ->getLink ());
163
+ }
164
+
165
+ public function test_get_link_resolves_local_paths_when_on_nested_page ()
166
+ {
167
+ $ image = new Image ([
168
+ 'path ' => 'image.jpg ' ,
169
+ ]);
170
+
171
+ $ this ->assertEquals ('../media/image.jpg ' , $ image ->getLink ('foo/bar ' ));
172
+ }
146
173
}
You can’t perform that action at this time.
0 commit comments