File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 88</html>
99<?php
1010ini_set ('display_errors ' , 'On ' );
11-
1211use Contentstack \Contentstack ;
1312include_once "../src/index.php " ;
14-
1513 $ stack = Contentstack::Stack ('<API-KEY> ' , '<ACCESS-TOKEN> ' , '<ENVIRONMENT> ' );
16-
1714try {
1815 //$result = $stack->ContentType('ctwithallfields')->Query()->addParam('include_dimensions', 'true')->toJSON()->find();
1916 //$result = $stack->ContentType('ctwithallfields')->Query()->addParam('include_dimension', 'true')->toJSON()->find();
2017 //$result = $stack->ContentType('ctwithallfields')->Query()->includeCount('include_dimensions', true)->toJSON()->find();
2118 //$result = $stack->ContentType('ctwithallfields')->Entry('blt8d1ab7600ba4c2b4')->addParam('include_dimensions', true)->toJSON()->fetch();
22-
2319 //$result = $stack->Assets('blt9b5825dd804a9067')->addParam('include_dimension', 'true')->toJSON()->fetch();
2420 // \Contentstack\Utility\debug(($result));
25-
26-
2721} catch (Exception $ e ) {
2822 echo "Message : " .$ e ->getMessage (); // returns message -> API -> error_message
2923 echo "Code : " .$ e ->getCode (); // returns number -> API -> error_code
3024 echo "Errors : " .print_r ($ e ->getErrors ()); // returns array -> API -> errors
31- }
25+ }
Original file line number Diff line number Diff line change @@ -256,6 +256,7 @@ function wrapResult($result = '', $queryObject = '') {
256256 function contentstackRequest ($ queryObject = '' , $ type = '' ){
257257 $ server_output = '' ;
258258 if ($ queryObject ) {
259+ // \Contentstack\Utility\debug(contentstackUrl($queryObject, $type));
259260 $ http = curl_init (contentstackUrl ($ queryObject , $ type ));
260261
261262 // setting the GET request
Original file line number Diff line number Diff line change @@ -76,6 +76,21 @@ public function testAssetsFindLimit() {
7676 $ this ->assertTrue (checkAssetsSorting ($ _assets [0 ]));
7777 }
7878
79+ public function testAssetsAddParam () {
80+ $ _assets = self ::$ Stack ->Assets ()->Query ()->addParam ('include_dimension ' , 'true ' )->toJSON ()->find ();
81+ $ _object = self ::$ Stack ->Assets ()->Query ()->toJSON ()->find ();
82+ $ _uid = $ _object [0 ][0 ]['uid ' ];
83+ $ _asset = self ::$ Stack ->Assets ($ _uid )->addParam ('include_dimension ' , 'true ' )->toJSON ()->fetch ();
84+ $ this ->assertTrue (array_key_exists ('dimension ' , $ _asset ));
85+ }
86+
87+ public function testAssetsmultipleAddParam () {
88+ $ _assets = self ::$ Stack ->Assets ()->Query ()->addParam ('include_dimension ' , 'true ' )->toJSON ()->find ();
89+ $ this ->assertTrue (array_key_exists ('dimension ' , $ _assets [0 ][0 ]));
90+
91+ }
92+
93+
7994 public function testAssetsFindCount () {
8095 $ _assets = self ::$ Stack ->Assets ()->Query ()->toJSON ()->count ()->find ();
8196 $ assets = self ::$ Stack ->Assets ()->Query ()->toJSON ()->find ();
You can’t perform that action at this time.
0 commit comments