File tree Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change 2
2
3
3
declare (strict_types=1 );
4
4
5
+ use Storyblok \ManagementApi \Data \AssetsData ;
5
6
use Storyblok \ManagementApi \Endpoints \AssetApi ;
6
7
use Storyblok \ManagementApi \ManagementApiClient ;
7
8
27
28
expect ($ storyblokData ->get ("id " ))
28
29
->toBe (111 )
29
30
->and ($ storyblokData ->filenameCDN ())->toBe ("https://a.storyblok.com/f/222/3799x6005/3af265ee08/mypic.jpg " )
30
- ->and ($ storyblokResponse ->getResponseStatusCode ())->toBe (200 );
31
+ ->and ($ storyblokResponse ->getResponseStatusCode ())->toBe (200 )
32
+ ->and ($ storyblokData ->contentType ())->toBe ("image/jpeg " )
33
+ ->and ($ storyblokData ->contentLength ())->toBe (3094788 )
34
+ ->and ($ storyblokData ->createdAt ())->toBe ('2025-01-18 ' )
35
+ ->and ($ storyblokData ->updatedAt ())->toBe ('2025-01-19 ' );
31
36
32
37
$ storyblokResponse = $ assetApi ->get ("111notexists " );
33
38
expect ( $ storyblokResponse ->getResponseStatusCode ())->toBe (404 ) ;
48
53
49
54
$ storyblokResponse = $ assetApi ->page ();
50
55
51
- /** @var \Storyblok\ManagementApi\Data\ AssetsData $storyblokData */
56
+ /** @var AssetsData $storyblokData */
52
57
$ storyblokData = $ storyblokResponse ->data ();
53
58
foreach ($ storyblokData as $ asset ) {
54
59
expect ($ asset ->id ())->toBeGreaterThan (10 );
64
69
expect ( $ storyblokResponse ->asJson ())->toBe ('["This record could not be found"] ' );
65
70
expect ( $ storyblokResponse ->isOk ())->toBeFalse () ;
66
71
expect ( $ storyblokResponse ->getErrorMessage ())->toStartWith ("404 - Not Found. " ) ;
72
+
73
+ $ assetsData = AssetsData::make ([]);
74
+ expect ($ assetsData )->toBeInstanceOf (AssetsData::class);
67
75
});
68
76
69
77
Original file line number Diff line number Diff line change 3
3
"filename" : " https:\/\/ s3.amazonaws.com\/ a.storyblok.com\/ f\/ 222\/ 3799x6005\/ 3af265ee08\/ mypic.jpg" ,
4
4
"space_id" : 222 ,
5
5
"created_at" : " 2025-01-18T08:01:02.759Z" ,
6
- "updated_at" : " 2025-01-18T08 :01:08.652Z" ,
6
+ "updated_at" : " 2025-01-19T08 :01:08.652Z" ,
7
7
"file" : null ,
8
8
"asset_folder_id" : null ,
9
9
"deleted_at" : null ,
You can’t perform that action at this time.
0 commit comments