-
Notifications
You must be signed in to change notification settings - Fork 263
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add live tests to confirm that iterating over help center objects now…
… works
- Loading branch information
Showing
1 changed file
with
39 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<?php | ||
|
||
namespace Zendesk\API\LiveTests; | ||
|
||
class HelpCenterTest extends BasicTest | ||
{ | ||
/** | ||
* @throws \Zendesk\API\Exceptions\MissingParametersException | ||
*/ | ||
public function testIterateOverHelpCenterArticles() | ||
{ | ||
$iterator = $this->client->helpCenter->articles()->iterator(); | ||
|
||
$actual = iterator_to_array($iterator); | ||
|
||
// Generally, there should be at least one article in the help center, even if these are just the default articles. | ||
$this->assertTrue(is_array($actual) && count($actual) > 0, 'Should return a non-empty array of articles.'); | ||
} | ||
|
||
public function testIterateOverHelpCenterSections() | ||
{ | ||
$iterator = $this->client->helpCenter->sections()->iterator(); | ||
|
||
$actual = iterator_to_array($iterator); | ||
|
||
// Generally, there should be at least one section in the help center, even if these are just the default sections. | ||
$this->assertTrue(is_array($actual) && count($actual) > 0, 'Should return a non-empty array of sections.'); | ||
} | ||
|
||
public function testIterateOverHelpCenterCategories() | ||
{ | ||
$iterator = $this->client->helpCenter->categories()->iterator(); | ||
|
||
$actual = iterator_to_array($iterator); | ||
|
||
// Generally, there should be at least one category in the help center, even if these are just the default categories. | ||
$this->assertTrue(is_array($actual) && count($actual) > 0, 'Should return a non-empty array of categories.'); | ||
} | ||
} |