Skip to content

Commit

Permalink
Add live tests to confirm that iterating over help center objects now…
Browse files Browse the repository at this point in the history
… works
  • Loading branch information
token-cjg committed Jan 15, 2025
1 parent dfcbddb commit 80cffd1
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions tests/Zendesk/API/LiveTests/HelpCenterTest.php
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.');
}
}

0 comments on commit 80cffd1

Please sign in to comment.