File tree Expand file tree Collapse file tree 2 files changed +59
-0
lines changed Expand file tree Collapse file tree 2 files changed +59
-0
lines changed Original file line number Diff line number Diff line change @@ -340,6 +340,18 @@ public function it_cannot_retrieve_by_credentials_with_multiple_conditions()
340
340
$ this ->assertNull ($ result );
341
341
}
342
342
343
+ /** @test */
344
+ public function it_cannot_retrieve_by_credentials_if_key_is_not_supported ()
345
+ {
346
+ $ provider = new AuthUserProvider ($ this ->hasher , UserA::class);
347
+
348
+ $ result = $ provider ->retrieveByCredentials ([
349
+ 'foo ' => 'bar '
350
+ ]);
351
+
352
+ $ this ->assertNull ($ result );
353
+ }
354
+
343
355
/** @test */
344
356
public function it_can_validate_credentials ()
345
357
{
Original file line number Diff line number Diff line change @@ -387,6 +387,53 @@ public function it_can_process_filter_between()
387
387
$ this ->assertEquals ($ params , $ query ['params ' ]);
388
388
}
389
389
390
+ /** @test */
391
+ public function it_can_process_nested_filters ()
392
+ {
393
+ $ params = [
394
+ 'TableName ' => 'ProductCatalog ' ,
395
+ 'FilterExpression ' => '(((#1 = :1 and #2 = :2) or (#1 = :3 and #3 < :4)) or #3 >= :5) ' ,
396
+ 'ExpressionAttributeNames ' => [
397
+ '#1 ' => 'ProductCategory ' ,
398
+ '#2 ' => 'Brand ' ,
399
+ '#3 ' => 'Price '
400
+ ],
401
+ 'ExpressionAttributeValues ' => [
402
+ ':1 ' => [
403
+ 'S ' => 'Bicycle '
404
+ ],
405
+ ':2 ' => [
406
+ 'S ' => 'Mountain A '
407
+ ],
408
+ ':3 ' => [
409
+ 'S ' => 'Book '
410
+ ],
411
+ ':4 ' => [
412
+ 'N ' => 10
413
+ ],
414
+ ':5 ' => [
415
+ 'N ' => 500
416
+ ]
417
+ ]
418
+ ];
419
+
420
+ $ query = $ this ->newQuery ('ProductCatalog ' )->filter (function ($ query ) {
421
+ $ query ->where (function ($ query ) {
422
+ $ query ->where (function ($ query ) {
423
+ $ query ->where ('ProductCategory ' , 'Bicycle ' );
424
+ $ query ->where ('Brand ' , 'Mountain A ' );
425
+ });
426
+ $ query ->orWhere (function ($ query ) {
427
+ $ query ->where ('ProductCategory ' , 'Book ' );
428
+ $ query ->where ('Price ' , '< ' , 10 );
429
+ });
430
+ });
431
+ $ query ->orWhere ('Price ' , '>= ' , 500 );
432
+ })->scan ();
433
+
434
+ $ this ->assertEquals ($ params , $ query ['params ' ]);
435
+ }
436
+
390
437
/** @test */
391
438
public function it_can_process_attribute_exists_function ()
392
439
{
You can’t perform that action at this time.
0 commit comments