Skip to content

Commit

Permalink
Resolve merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
arogachev committed Sep 15, 2023
1 parent 7243d88 commit b4c6378
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions tests/Common/AssignmentsStorageTestTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace Yiisoft\Rbac\Tests\Common;

use DateTime;
use SlopeIt\ClockMock\ClockMock;
use Yiisoft\Rbac\Assignment;
use Yiisoft\Rbac\AssignmentsStorageInterface;
Expand Down Expand Up @@ -211,7 +212,7 @@ public function testUserHasItem(string $userId, array $itemNames, bool $expected
public function testAdd(): void
{
$storage = $this->getAssignmentsStorage();
$storage->add(userId: 'john', itemName: 'Operator');
$storage->add(new Assignment(userId: 'john', itemName: 'Operator', createdAt: time()));

$this->assertEquals(
new Assignment(userId: 'john', itemName: 'Operator', createdAt: 1_683_707_079),
Expand All @@ -222,7 +223,7 @@ public function testAdd(): void
public function testAddWithCreatedAt(): void
{
$storage = $this->getAssignmentsStorage();
$storage->add(userId: 'john', itemName: 'Operator', createdAt: 1_694_508_008);
$storage->add(new Assignment(userId: 'john', itemName: 'Operator', createdAt: 1_694_508_008));

$this->assertEquals(
new Assignment(userId: 'john', itemName: 'Operator', createdAt: 1_694_508_008),
Expand Down Expand Up @@ -287,7 +288,13 @@ protected function populateItemsStorage(): void
protected function populateAssignmentsStorage(): void
{
foreach ($this->getFixtures()['assignments'] as $assignmentData) {
$this->getAssignmentsStorage()->add($assignmentData['itemName'], $assignmentData['userId']);
$this->getAssignmentsStorage()->add(
new Assignment(
userId: $assignmentData['userId'],
itemName: $assignmentData['itemName'],
createdAt: time(),
),
);
}
}

Expand Down

0 comments on commit b4c6378

Please sign in to comment.