Skip to content

Commit

Permalink
Test updating group
Browse files Browse the repository at this point in the history
  • Loading branch information
Art4 committed Jan 11, 2024
1 parent 62ab4a9 commit 44226fc
Showing 1 changed file with 21 additions and 11 deletions.
32 changes: 21 additions & 11 deletions tests/End2End/Group/GroupTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,15 @@ public function testInteractionWithGroup(): void
'name' => $groupName,
]);

$data = json_decode(json_encode($xmlData), true);
$groupData = json_decode(json_encode($xmlData), true);

$this->assertIsArray($data, json_encode($data));
$this->assertIsString($data['id']);
$this->assertSame($groupName, $data['name']);
$this->assertIsArray($groupData, json_encode($groupData));
$this->assertIsString($groupData['id']);
$this->assertSame($groupName, $groupData['name']);

$groupId = (int) $data['id'];
$groupId = (int) $groupData['id'];

// List groups
$data = $groupApi->list();

$this->assertSame(
[
'groups' => [
Expand All @@ -45,20 +43,32 @@ public function testInteractionWithGroup(): void
],
],
],
$data
$groupApi->list()
);

// Read group
$data = $groupApi->show($groupId);

$this->assertSame(
[
'group' => [
'id' => $groupId,
'name' => $groupName,
]
],
$data
$groupApi->show($groupId)
);

// Update group
$result = $groupApi->update($groupId, ['name' => 'new group name']);
$this->assertSame('', $result);

$this->assertSame(
[
'group' => [
'id' => $groupId,
'name' => 'new group name',
]
],
$groupApi->show($groupId)
);
}
}

0 comments on commit 44226fc

Please sign in to comment.