@@ -24,7 +24,7 @@ public static function setUpBeforeClass() : void {
2424 */
2525 public static function tearDownAfterClass () : void {
2626 if (ENV !== 'TEST_LOCAL ' ) {
27- self ::$ rest ->deleteStack ();
27+ // self::$rest->deleteStack();
2828 }
2929 }
3030
@@ -36,9 +36,10 @@ public function testAssetsFind() {
3636
3737 public function testAssetsFetch () {
3838 $ _object = self ::$ Stack ->Assets ()->Query ()->toJSON ()->find ();
39+ $ _title = $ _object [0 ][0 ]['title ' ];
3940 $ _uid = $ _object [0 ][0 ]['uid ' ];
4041 $ _asset = self ::$ Stack ->Assets ($ _uid )->fetch ();
41- $ this ->assertEquals ($ _asset ->get ('title ' ), $ _object [ 0 ][ 0 ][ ' title ' ] );
42+ $ this ->assertEquals ($ _asset ->get ('title ' ), $ _title );
4243 }
4344
4445 public function testAssetsFindSkip () {
@@ -77,7 +78,6 @@ public function testAssetsFindLimit() {
7778 public function testAssetsAddParam () {
7879 $ _assets = self ::$ Stack ->Assets ()->Query ()->addParam ('include_dimension ' , 'true ' )->toJSON ()->find ();
7980 $ this ->assertTrue (array_key_exists ('dimension ' , $ _assets [0 ][0 ]));
80-
8181 }
8282
8383
@@ -161,7 +161,6 @@ public function testAssetsFindDescending() {
161161 public function testAssetsFindLessThan () {
162162 $ _set = 7575 ;
163163 $ assets = self ::$ Stack ->Assets ()->Query ()->toJSON ()->lessThan ('file_size ' , $ _set )->find ();
164- Utility::debug ($ assets );
165164 $ this ->assertArrayHasKey (0 , $ assets );
166165 if (count ($ assets [0 ]) !== 0 ){
167166 foreach ($ assets [0 ] as $ key => $ val ) {
@@ -173,7 +172,7 @@ public function testAssetsFindLessThan() {
173172 }
174173
175174 public function testAssetsFindLessThanEqualTo () {
176- $ _set = 12 ;
175+ $ _set = 12000 ;
177176 $ assets = self ::$ Stack ->Assets ()->Query ()->toJSON ()->lessThanEqualTo ('file_size ' , $ _set )->find ();
178177 $ this ->assertArrayHasKey (0 , $ assets );
179178 if (count ($ assets [0 ]) !== 0 ) {
@@ -268,9 +267,10 @@ public function testAssetsFindLogicalOrRawQuery() {
268267
269268 public function testAssetsFindLogicalAndQueryObject () {
270269 $ _value = 6161 ;
270+ $ _value2 = 15000 ;
271271 $ query1 = self ::$ Stack ->Assets ()->Query ()->greaterThanEqualTo ('file_size ' , $ _value );
272272
273- $ query2 = self ::$ Stack ->Assets ()->Query ()->lessThanEqualTo ('file_size ' , $ _value );
273+ $ query2 = self ::$ Stack ->Assets ()->Query ()->lessThanEqualTo ('file_size ' , $ _value2 );
274274 $ assets = self ::$ Stack ->Assets ()->Query ()->logicalAND ($ query1 , $ query2 )->toJSON ()->find ();
275275
276276 $ this ->assertArrayHasKey (0 , $ assets );
@@ -279,25 +279,26 @@ public function testAssetsFindLogicalAndQueryObject() {
279279
280280 public function testAssetsFindLogicalAndRawQuery () {
281281 $ _value = 6161 ;
282+ $ _value2 = 15000 ;
282283 $ query1 = self ::$ Stack ->Assets ()->Query ()->greaterThanEqualTo ('file_size ' , $ _value );
283- $ query2 = self ::$ Stack ->Assets ()->Query ()->lessThanEqualTo ('file_size ' , $ _value );
284+ $ query2 = self ::$ Stack ->Assets ()->Query ()->lessThanEqualTo ('file_size ' , $ _value2 );
284285 $ assets = self ::$ Stack ->Assets ()->Query ()->logicalAND ($ query1 , $ query2 )->toJSON ()->find ();
285286 $ this ->assertArrayHasKey (0 , $ assets );
286287 $ this ->assertTrue (checkAssetsSorting ($ assets [0 ]));
287288 }
288289
289- // public function testAssetsFindOnlyDefault() {
290- // $_assets = self::$Stack->Assets()->Query()->only(array('title', 'updated_at'))->toJSON()->find();
291- // $_assets_count = self::$Stack->Assets()->Query()->toJSON()->find();
292- // $this->assertArrayHasKey(0, $_assets);
293- // $this->assertTrue((count($_assets[0]) === count($_assets_count[0])));
294- // $this->assertTrue(checkAssetsSorting($_assets[0]));
295- // $flag = true;
296- // for($i = 0; $i < count($_assets[0]); $i++) {
297- // $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']));
298- // }
299- // $this->assertTrue($flag);
300- // }
290+ public function testAssetsFindOnlyDefault () {
291+ $ _assets = self ::$ Stack ->Assets ()->Query ()->only (' BASE ' , array ('title ' , 'updated_at ' ))->toJSON ()->find ();
292+ $ _assets_count = self ::$ Stack ->Assets ()->Query ()->toJSON ()->find ();
293+ $ this ->assertArrayHasKey (0 , $ _assets );
294+ $ this ->assertTrue ((count ($ _assets [0 ]) === count ($ _assets_count [0 ])));
295+ $ this ->assertTrue (checkAssetsSorting ($ _assets [0 ]));
296+ $ flag = true ;
297+ for ($ i = 0 ; $ i < count ($ _assets [0 ]); $ i ++) {
298+ $ flag = $ flag && (count (array_keys ($ _assets [0 ][$ i ])) === 6 && isset ($ _assets [0 ][$ i ]['updated_at ' ]) && isset ( $ _assets [ 0 ][ $ i ][ ' filename ' ]) && isset ( $ _assets [ 0 ][ $ i ][ ' ACL ' ]) && isset ($ _assets [0 ][$ i ]['title ' ]) && isset ($ _assets [0 ][$ i ]['uid ' ]));
299+ }
300+ $ this ->assertTrue ($ flag );
301+ }
301302
302303 public function testAssetsFindRegEx () {
303304 $ regexp = "[0-9] " ;
@@ -348,20 +349,19 @@ public function testAssetsFindExceptBaseDefault() {
348349 $ this ->assertTrue ($ flag );
349350 }
350351
351-
352- // public function testAssetsFindOnlyBaseDefault() {
353- // $_assets = self::$Stack->Assets()->Query()->only('BASE', array('title', 'updated_at'))->toJSON()->find();
354- // $this->assertArrayHasKey(0, $_assets);
355- // $assets = self::$Stack->Assets()->Query()->toJSON()->find();
356- // $assets_count = count($assets[0]);
357- // $this->assertTrue((count($_assets[0]) === $assets_count));
358- // $this->assertTrue(checkAssetsSorting($_assets[0]));
359- // $flag = true;
360- // for($i = 0; $i < count($_assets[0]); $i++) {
361- // $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']));
362- // }
363- // $this->assertTrue($flag);
364- // }
352+ public function testAssetsFindOnlyBaseDefault () {
353+ $ _assets = self ::$ Stack ->Assets ()->Query ()->only ('BASE ' , array ('title ' , 'updated_at ' ))->toJSON ()->find ();
354+ $ this ->assertArrayHasKey (0 , $ _assets );
355+ $ assets = self ::$ Stack ->Assets ()->Query ()->toJSON ()->find ();
356+ $ assets_count = count ($ assets [0 ]);
357+ $ this ->assertTrue ((count ($ _assets [0 ]) === $ assets_count ));
358+ $ this ->assertTrue (checkAssetsSorting ($ _assets [0 ]));
359+ $ flag = true ;
360+ for ($ i = 0 ; $ i < count ($ _assets [0 ]); $ i ++) {
361+ $ flag = $ flag && (count (array_keys ($ _assets [0 ][$ i ])) === 6 && isset ($ _assets [0 ][$ i ]['updated_at ' ]) && isset ($ _assets [0 ][$ i ]['filename ' ]) && isset ($ _assets [0 ][$ i ]['ACL ' ]) && isset ($ _assets [0 ][$ i ]['title ' ]) && isset ($ _assets [0 ][$ i ]['uid ' ]));
362+ }
363+ $ this ->assertTrue ($ flag );
364+ }
365365
366366 public function testAssetsFindExceptDefault () {
367367 $ _assets = self ::$ Stack ->Assets ()->Query ()->except ('BASE ' ,array ('boolean ' ))->toJSON ()->find ();
@@ -380,9 +380,9 @@ public function testAssetsFindExceptDefault() {
380380 public function testAssetsFindSearch () {
381381 $ _assets = self ::$ Stack ->Assets ()->Query ()->search ('image/jpeg ' )->toJSON ()->find ();
382382 $ this ->assertArrayHasKey (0 , $ _assets );
383- $ assets = self ::$ Stack ->Assets ()->Query ()->toJSON ()->find ();
384- $ assets_count = count ($ assets [0 ]);
385- $ this ->assertTrue ((count ($ _assets [0 ]) === $ assets_count ));
383+ // $assets = self::$Stack->Assets()->Query()->toJSON()->find();
384+ // $assets_count = count($assets[0]);
385+ $ this ->assertTrue ((count ($ _assets [0 ]) === 2 ));
386386 $ this ->assertTrue (checkAssetsSorting ($ _assets [0 ]));
387387 $ flag = true ;
388388 for ($ i = 0 ; $ i < count ($ _assets [0 ]); $ i ++) {
0 commit comments