Skip to content

Commit d9ab578

Browse files
committed
fix test
need to disable timestamps to pass the test.
1 parent 3cfbf32 commit d9ab578

File tree

2 files changed

+41
-22
lines changed

2 files changed

+41
-22
lines changed

tests/Model/ModelTest.php

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -431,28 +431,28 @@ public function it_can_save_new_instance()
431431
$user->save();
432432
}
433433

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+
}
456456

457457
/** @test */
458458
public function it_cannot_save_new_instance_without_required_key()

tests/Model/UserD.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
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+
}

0 commit comments

Comments
 (0)