Skip to content

Commit a56b2ac

Browse files
Rohit MishraRohit Mishra
authored andcommitted
updated in testcase files
1 parent c08acb5 commit a56b2ac

5 files changed

Lines changed: 20 additions & 8 deletions

File tree

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,7 @@ composer.phar
44
composer.lock
55
vendor/
66
test/report.html
7+
test/AssetsTestReport.html
8+
test/EntryTestReport.html
9+
test/ImagetransformTestReport.html
710
test/result.json

composer.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"require-dev": {
3+
"apigen/apigen": "^4.1"
4+
}
5+
}

examples/index.php

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,15 @@
1212
include_once "../src/index.php";
1313
$stack = Contentstack::Stack('<API-KEY>', '<ACCESS-TOKEN>', '<ENVIRONMENT>');
1414
try {
15-
//$result = $stack->ContentType('ctwithallfields')->Query()->addParam('include_dimensions', 'true')->toJSON()->find();
15+
// $result = $stack->ContentType('ctwithallfields')->Query()->addParam('include_count', 'true')->toJSON()->find();
16+
//$result = $stack->ContentType('ctwithallfields')->Query()->includeCount()->toJSON()->find();
17+
1618
//$result = $stack->ContentType('ctwithallfields')->Query()->addParam('include_dimension', 'true')->toJSON()->find();
17-
//$result = $stack->ContentType('ctwithallfields')->Query()->includeCount('include_dimensions', true)->toJSON()->find();
19+
// $result = $stack->ContentType('ctwithallfields')->Query()->addParam('include_dimensions', true)->toJSON()->find();
1820
//$result = $stack->ContentType('ctwithallfields')->Entry('blt8d1ab7600ba4c2b4')->addParam('include_dimensions', true)->toJSON()->fetch();
19-
//$result = $stack->Assets('blt9b5825dd804a9067')->addParam('include_dimension', 'true')->toJSON()->fetch();
20-
// \Contentstack\Utility\debug(($result));
21+
// $result = $stack->Assets()->Query()->addParam('key', 'true')->toJSON()->find();
22+
//$result = $stack->Assets('blt9b5825dd804a9067')->addParam('include_dimension', 'true')->fetch();
23+
// \Contentstack\Utility\debug(($result[0][]));
2124
} catch(Exception $e) {
2225
echo "Message : ".$e->getMessage(); // returns message -> API -> error_message
2326
echo "Code : ".$e->getCode(); // returns number -> API -> error_code

src/lib/models/base_query.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ public function __construct($data = '', $parent = '') {
1919
$this->queryObject = $parent;
2020
$this->queryObject->_query = array();
2121
$this->subQuery = array();
22+
2223
}elseif ($data->type === 'asset'){
2324
$this->stack = $data;
2425
$this->queryObject = $parent;
@@ -28,7 +29,7 @@ public function __construct($data = '', $parent = '') {
2829
$this->contentType = $data;
2930
$this->queryObject = $parent;
3031
$this->queryObject->_query = array();
31-
$this->subQuery = array();
32+
$this->subQuery = array();
3233
}
3334
}
3435

@@ -232,9 +233,10 @@ public function includeOwner() {
232233

233234
/*
234235
* addParam
235-
* To sort the entries in addParam
236+
* To add key and values in string form using addParam method
236237
* @param
237-
* field_uid - field uid to be sorted
238+
* key - Name of key in string
239+
* value - Value of the key in string
238240
* @return Query
239241
* */
240242
public function addParam($key = '', $value = '') {

src/lib/utility.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,6 @@ function wrapResult($result = '', $queryObject = '') {
256256
function contentstackRequest($queryObject = '', $type = ''){
257257
$server_output = '';
258258
if($queryObject) {
259-
// \Contentstack\Utility\debug(contentstackUrl($queryObject, $type));
260259
$http = curl_init(contentstackUrl($queryObject, $type));
261260

262261
// setting the GET request

0 commit comments

Comments
 (0)