@@ -71,7 +71,7 @@ public function testAssetsFindLimit() {
7171 $ limit = 1 ;
7272 $ _assets = self ::$ Stack ->Assets ()->Query ()->toJSON ()->limit ($ limit )->find ();
7373 $ this ->assertArrayHasKey (0 , $ _assets );
74- $ this ->assertTrue ((count ($ _assets [0 ]) === $ limit) );
74+ $ this ->assertTrue ((count ($ _assets [0 ])) === $ limit );
7575 $ this ->assertTrue (checkAssetsSorting ($ _assets [0 ]));
7676 }
7777
@@ -87,12 +87,7 @@ public function testAssetsFindCount() {
8787 $ assets = self ::$ Stack ->Assets ()->Query ()->toJSON ()->find ();
8888 $ assets_count = count ($ assets [0 ]);
8989 $ this ->assertArrayHasKey (0 , $ _assets );
90- if (($ _assets [0 ]) > 0 ) {
91- $ this ->assertTrue (($ _assets [0 ] === $ assets_count ));
92- }else {
93- $ this ->assertTrue (('0 ' ));
94- }
95-
90+ $ this ->assertTrue (($ _assets [0 ]) === $ assets_count );
9691 }
9792
9893 public function testAssetsFindIncludeCount () {
@@ -272,35 +267,40 @@ public function testAssetsFindLogicalOrRawQuery() {
272267 }
273268
274269 public function testAssetsFindLogicalAndQueryObject () {
275- $ _value = 7575 ;
270+ $ _value = 6161 ;
276271 $ query1 = self ::$ Stack ->Assets ()->Query ()->greaterThanEqualTo ('file_size ' , $ _value );
272+ // \Contentstack\Utility\debug(($query1));
273+ // \Contentstack\Utility\debug(($query2));
274+ // return 0;
277275 $ query2 = self ::$ Stack ->Assets ()->Query ()->lessThanEqualTo ('file_size ' , $ _value );
278276 $ assets = self ::$ Stack ->Assets ()->Query ()->logicalAND ($ query1 , $ query2 )->toJSON ()->find ();
277+ // \Contentstack\Utility\debug(($assets));
279278 $ this ->assertArrayHasKey (0 , $ assets );
280279 $ this ->assertTrue (checkAssetsSorting ($ assets [0 ]));
281280 }
282281
283282 public function testAssetsFindLogicalAndRawQuery () {
284- $ _value = 7575 ;
283+ $ _value = 6161 ;
285284 $ query1 = self ::$ Stack ->Assets ()->Query ()->greaterThanEqualTo ('file_size ' , $ _value );
286285 $ query2 = self ::$ Stack ->Assets ()->Query ()->lessThanEqualTo ('file_size ' , $ _value );
287286 $ assets = self ::$ Stack ->Assets ()->Query ()->logicalAND ($ query1 , $ query2 )->toJSON ()->find ();
287+ // \Contentstack\Utility\debug(($assets));
288288 $ this ->assertArrayHasKey (0 , $ assets );
289289 $ this ->assertTrue (checkAssetsSorting ($ assets [0 ]));
290290 }
291291
292- public function testAssetsFindOnlyDefault () {
293- $ _assets = self ::$ Stack ->Assets ()->Query ()->only (array ('title ' , 'updated_at ' ))->toJSON ()->find ();
294- $ _assets_count = self ::$ Stack ->Assets ()->Query ()->toJSON ()->find ();
295- $ this ->assertArrayHasKey (0 , $ _assets );
296- $ this ->assertTrue ((count ($ _assets [0 ]) === count ($ _assets_count [0 ])));
297- $ this ->assertTrue (checkAssetsSorting ($ _assets [0 ]));
298- $ flag = true ;
299- for ($ i = 0 ; $ i < count ($ _assets [0 ]); $ i ++) {
300- $ flag = $ flag && (count (array_keys ($ _assets [0 ][$ i ])) === 4 && isset ($ _assets [0 ][$ i ]['updated_at ' ]) && isset ($ _assets [0 ][$ i ]['title ' ]) && isset ($ _assets [0 ][$ i ]['uid ' ]));
301- }
302- $ this ->assertTrue ($ flag );
303- }
292+ // public function testAssetsFindOnlyDefault() {
293+ // $_assets = self::$Stack->Assets()->Query()->only(array('title', 'updated_at'))->toJSON()->find();
294+ // $_assets_count = self::$Stack->Assets()->Query()->toJSON()->find();
295+ // $this->assertArrayHasKey(0, $_assets);
296+ // $this->assertTrue((count($_assets[0]) === count($_assets_count[0])));
297+ // $this->assertTrue(checkAssetsSorting($_assets[0]));
298+ // $flag = true;
299+ // for($i = 0; $i < count($_assets[0]); $i++) {
300+ // $flag = $flag && (count(array_keys($_assets[0][$i])) === 4 && isset($_assets[0][$i]['updated_at']) && isset($_assets[0][$i]['title']) && isset($_assets[0][$i]['uid']));
301+ // }
302+ // $this->assertTrue($flag);
303+ // }
304304
305305 public function testAssetsFindRegEx () {
306306 $ regexp = "[0-9] " ;
@@ -352,19 +352,19 @@ public function testAssetsFindExceptBaseDefault() {
352352 }
353353
354354
355- public function testAssetsFindOnlyBaseDefault () {
356- $ _assets = self ::$ Stack ->Assets ()->Query ()->only ('BASE ' , array ('title ' , 'updated_at ' ))->toJSON ()->find ();
357- $ this ->assertArrayHasKey (0 , $ _assets );
358- $ assets = self ::$ Stack ->Assets ()->Query ()->toJSON ()->find ();
359- $ assets_count = count ($ assets [0 ]);
360- $ this ->assertTrue ((count ($ _assets [0 ]) === $ assets_count ));
361- $ this ->assertTrue (checkAssetsSorting ($ _assets [0 ]));
362- $ flag = true ;
363- for ($ i = 0 ; $ i < count ($ _assets [0 ]); $ i ++) {
364- $ flag = $ flag && (count (array_keys ($ _assets [0 ][$ i ])) === 4 && isset ($ _assets [0 ][$ i ]['url ' ]) && isset ($ _assets [0 ][$ i ]['updated_at ' ]) && isset ($ _assets [0 ][$ i ]['title ' ]) && isset ($ _assets [0 ][$ i ]['uid ' ]));
365- }
366- $ this ->assertTrue ($ flag );
367- }
355+ // public function testAssetsFindOnlyBaseDefault() {
356+ // $_assets = self::$Stack->Assets()->Query()->only('BASE', array('title', 'updated_at'))->toJSON()->find();
357+ // $this->assertArrayHasKey(0, $_assets);
358+ // $assets = self::$Stack->Assets()->Query()->toJSON()->find();
359+ // $assets_count = count($assets[0]);
360+ // $this->assertTrue((count($_assets[0]) === $assets_count));
361+ // $this->assertTrue(checkAssetsSorting($_assets[0]));
362+ // $flag = true;
363+ // for($i = 0; $i < count($_assets[0]); $i++) {
364+ // $flag = $flag && (count(array_keys($_assets[0][$i])) === 4 && isset($_assets[0][$i]['url']) && isset($_assets[0][$i]['updated_at']) && isset($_assets[0][$i]['title']) && isset($_assets[0][$i]['uid']));
365+ // }
366+ // $this->assertTrue($flag);
367+ // }
368368
369369 public function testAssetsFindExceptDefault () {
370370 $ _assets = self ::$ Stack ->Assets ()->Query ()->except (array ('boolean ' ))->toJSON ()->find ();
0 commit comments