File tree 2 files changed +41
-22
lines changed
2 files changed +41
-22
lines changed Original file line number Diff line number Diff line change @@ -431,28 +431,28 @@ public function it_can_save_new_instance()
431
431
$ user ->save ();
432
432
}
433
433
434
- /** @test */
435
- public function it_can_static_create_new_instance ()
436
- {
437
- $ params = [
438
- 'TableName ' => 'User ' ,
439
- 'Item ' => [
440
- 'partition ' => [
441
- 'S ' => 'p '
442
- ]
443
- ],
444
- 'ConditionExpression ' => 'attribute_not_exists(#1) ' ,
445
- 'ExpressionAttributeNames ' => [
446
- '#1 ' => 'partition '
447
- ]
448
- ];
449
-
450
- $ connection = $ this ->newConnectionMock ();
451
- $ connection ->shouldReceive ('putItem ' )->with ($ params );
452
- $ this ->setConnectionResolver ($ connection );
453
-
454
- $ user = UserA ::create (['partition ' => 'p ' ]);
455
- }
434
+ /** @test */
435
+ public function it_can_static_create_new_instance ()
436
+ {
437
+ $ params = [
438
+ 'TableName ' => 'User ' ,
439
+ 'Item ' => [
440
+ 'partition ' => [
441
+ 'S ' => 'p '
442
+ ]
443
+ ],
444
+ 'ConditionExpression ' => 'attribute_not_exists(#1) ' ,
445
+ 'ExpressionAttributeNames ' => [
446
+ '#1 ' => 'partition '
447
+ ]
448
+ ];
449
+
450
+ $ connection = $ this ->newConnectionMock ();
451
+ $ connection ->shouldReceive ('putItem ' )->with ($ params );
452
+ $ this ->setConnectionResolver ($ connection );
453
+
454
+ UserD ::create (['partition ' => 'p ' ]);
455
+ }
456
456
457
457
/** @test */
458
458
public function it_cannot_save_new_instance_without_required_key ()
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ namespace Kitar \Dynamodb \Tests \Model ;
4
+
5
+ use Kitar \Dynamodb \Model \Model ;
6
+ use Illuminate \Auth \Authenticatable ;
7
+ use Illuminate \Contracts \Auth \Authenticatable as AuthenticatableContract ;
8
+
9
+ class UserD extends Model implements AuthenticatableContract
10
+ {
11
+ use Authenticatable;
12
+
13
+ protected $ table = 'User ' ;
14
+ protected $ primaryKey = 'partition ' ;
15
+ protected $ fillable = [
16
+ 'partition '
17
+ ];
18
+ public $ timestamps = false ;
19
+ }
You can’t perform that action at this time.
0 commit comments