Skip to content

Commit

Permalink
feat: supplementary test code
Browse files Browse the repository at this point in the history
  • Loading branch information
anoxia committed Oct 8, 2023
1 parent a14afcd commit 7d9e75c
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tests/GorseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use Gorse\Feedback;
use Gorse\Gorse;
use Gorse\Item;
use Gorse\User;
use GuzzleHttp\Exception\ClientException;
use GuzzleHttp\Exception\GuzzleException;
Expand Down Expand Up @@ -40,6 +41,21 @@ public function testUsers(): void
}
}

/**
* @throws GuzzleException
*/
public function testItems(): void
{
$client = new Gorse(self::ENDPOINT, self::API_KEY);
$item = new Item("1", false, ["a", "b", "c"], "2020-02-02T20:20:02.02Z", ["red", "fast", "sky"], "comment");
// Insert an item.
$rowsAffected = $client->insertItem($item);
$this->assertEquals(1, $rowsAffected->rowAffected);
// Get this item.
$returnItem = $client->getItem("1");
$this->assertEquals($item, $returnItem);
}

/**
* @throws GuzzleException
*/
Expand Down

0 comments on commit 7d9e75c

Please sign in to comment.