Skip to content

Commit e00e9b3

Browse files
committed
Support GetPlayerItems and fix it's tests
1 parent b1bdef5 commit e00e9b3

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

examples/item/GetPlayerItems.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Array
22
(
33
[numberOfBackpackSlots] => 50
4-
[items] => NukaCode\Database\Collection Object
4+
[items] => Illuminate\Support\Collection Object
55
(
66
[items:protected] => Array
77
(

src/Syntax/SteamApi/Steam/Item.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public function GetPlayerItems($appId, $steamId)
4040
$items = $this->convertToObjects($client->result->items);
4141

4242
// Return a full inventory
43-
return (array) new Inventory($client->result->num_backpack_slots, $items);
43+
return new Inventory($client->result->num_backpack_slots, $items);
4444
}
4545

4646
protected function convertToObjects($items)

tests/BaseTester.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class BaseTester extends TestCase {
1818

1919
protected $packageId = 32848;
2020

21-
protected $itemid = 440;
21+
protected $itemAppId = 440;
2222

2323
protected $groupId = 103582791429521412;
2424

tests/ItemTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@
66
class ItemTest extends BaseTester
77
{
88
/** @test */
9-
public function it_gets_items_for_an_by_user_id()
9+
public function it_gets_items_for_an_app_by_user_id()
1010
{
11-
$items = $this->steamClient->item()->GetPlayerItems($this->itemid, $this->id64);
11+
$inventory = $this->steamClient->item()->GetPlayerItems($this->appId, $this->id64);
1212

13-
$this->assertCount(1, $items);
13+
$this->assertCount(3, $inventory->items);
1414

15-
$item = $items->first();
15+
$item = $inventory->items->first();
1616

1717
$this->checkItemProperties($item);
1818
}

0 commit comments

Comments
 (0)