@@ -36,11 +36,9 @@ public function testFind() {
3636 }
3737
3838 public function testAssetsFind () {
39-
4039 $ _assets = self ::$ Stack ->Assets ()->Query ()->toJSON ()->find ();
4140 $ this ->assertArrayHasKey (0 , $ _assets );
4241 $ this ->assertTrue (checkAssetsSorting ($ _assets [0 ]));
43-
4442 }
4543
4644 public function testAssetsFetch () {
@@ -55,12 +53,31 @@ public function testImageTransformation() {
5553 $ _object = self ::$ Stack ->Assets ()->Query ()->toJSON ()->find ();
5654 $ _uid = $ _object [0 ][0 ]['uid ' ];
5755 $ _asset = self ::$ Stack ->Assets ($ _uid )->fetch ();
58- $ _imagetransformation = self ::$ Stack ->ImageTrasformation ($ _asset , array ('height ' => 100 , 'weight ' => 100 , 'disable ' => 'upscale ' ));
59- $ data = parse_url ($ result , PHP_URL_QUERY );
60- parse_str ($ data , $ get_array );
61- $ default_array = array ('height ' => 100 , 'weight ' => 100 , 'disable ' => 'upscale ' );
62- $ result =array_diff ($ get_array , $ default_array );
63- $ this ->assertEquals ($ get_array , $ default_array );
56+ $ _url = $ _asset ->get ('url ' );
57+ if ($ _url ){
58+
59+ $ _resizeimagetransformation = self ::$ Stack ->ImageTrasformation ($ _url , array ('height ' => 100 , 'weight ' => 100 , 'disable ' => 'upscale ' ));
60+ $ _cropimagetransformation = self ::$ Stack ->ImageTrasformation ($ _url , array ('crop ' => 100 ,200 ));
61+ $ _resizecropimagetransformation = self ::$ Stack ->ImageTrasformation ($ _url , array ('height ' => 100 , 'weight ' => 100 , 'disable ' => 'upscale ' , 'crop ' => 100 ,200 ));
62+
63+ $ resize_data = parse_url ($ _resizeimagetransformation , PHP_URL_QUERY );
64+ $ crop_data = parse_url ($ _cropimagetransformation , PHP_URL_QUERY );
65+ $ resizecrop_data = parse_url ($ _resizecropimagetransformation , PHP_URL_QUERY );
66+
67+ parse_str ($ resize_data , $ get_array_resize );
68+ parse_str ($ crop_data , $ get_array_crop );
69+ parse_str ($ resizecrop_data , $ get_array_resizecrop );
70+
71+ $ resize_default_array = array ('height ' => 100 ,'weight ' => 100 , 'disable ' => 'upscale ' );
72+ $ crop_default_array = array ('crop ' => 100 ,200 );
73+ $ resizecrop_default_array = array ('height ' => 100 ,'weight ' => 100 , 'disable ' => 'upscale ' , 'crop ' => 100 ,200 );
74+
75+ $ this ->assertEquals ($ get_array_resize , $ resize_default_array );
76+ $ this ->assertEquals ($ get_array_crop , $ crop_default_array );
77+ $ this ->assertEquals ($ get_array_resizecrop , $ resizecrop_default_array );
78+ }
79+
80+
6481 }
6582
6683
0 commit comments