test: add category suggestions integration test
Verifies getCategorySuggestions() returns id/name/path shaped results from the eBay sandbox Taxonomy API. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
0fdb4979c1
commit
929f5a0b2d
1 changed files with 16 additions and 0 deletions
|
|
@ -134,4 +134,20 @@ final class EbayTaxonomyIntegrationTest extends TestCase
|
||||||
$names = array_map(static fn (array $a) => $a['name'], $aspects);
|
$names = array_map(static fn (array $a) => $a['name'], $aspects);
|
||||||
$this->assertNotEmpty($names);
|
$this->assertNotEmpty($names);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function test_category_suggestions_returns_results(): void
|
||||||
|
{
|
||||||
|
$results = $this->taxonomy->getCategorySuggestions('Notebook');
|
||||||
|
|
||||||
|
$this->assertNotEmpty($results, 'Sandbox must return at least one suggestion for "Notebook"');
|
||||||
|
|
||||||
|
foreach ($results as $result) {
|
||||||
|
$this->assertArrayHasKey('id', $result);
|
||||||
|
$this->assertArrayHasKey('name', $result);
|
||||||
|
$this->assertArrayHasKey('path', $result);
|
||||||
|
$this->assertIsString($result['id']);
|
||||||
|
$this->assertNotEmpty($result['id']);
|
||||||
|
$this->assertIsString($result['name']);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue