Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions test/ZammadAPIClient/Resource/AbstractBaseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use PHPUnit\Framework\TestCase;

use ZammadAPIClient\Client;
use ZammadAPIClient\Exception\AlreadyFetchedObjectException;

abstract class AbstractBaseTest extends TestCase
{
Expand Down Expand Up @@ -190,11 +191,12 @@ public function testGet()
}

/**
* @expectedException \ZammadAPIClient\Exception\AlreadyFetchedObjectException
* @depends testCreate
*/
public function testGetOnFilledObjects()
{
$this->expectException(AlreadyFetchedObjectException::class);

foreach ( self::$created_objects as $created_object ) {
$created_object_id = $created_object->getID();
if ( empty( $created_object_id) ) {
Expand Down Expand Up @@ -328,11 +330,12 @@ public function testAllPagination()
}

/**
* @expectedException \ZammadAPIClient\Exception\AlreadyFetchedObjectException
* @depends testCreate
*/
public function testAllOnFilledObjects()
{
$this->expectException(AlreadyFetchedObjectException::class);

foreach ( self::$created_objects as $created_object ) {
$created_object_id = $created_object->getID();
if ( empty( $created_object_id) ) {
Expand Down
13 changes: 6 additions & 7 deletions test/ZammadAPIClient/Resource/TicketTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace ZammadAPIClient\Resource;

use ZammadAPIClient\Exception\AlreadyFetchedObjectException;
use ZammadAPIClient\ResourceType;

class TicketTest extends AbstractBaseTest
Expand Down Expand Up @@ -189,11 +190,7 @@ public function testCreate( $values, $expected_success, $expected_article_count

// Compare article data.
$articles = $object->getTicketArticles();
$this->assertInternalType(
'array',
$articles,
'Articles of ticket object must be returned as array.'
);
$this->assertIsArray($articles);

$this->assertCount(
$expected_article_count,
Expand Down Expand Up @@ -226,11 +223,12 @@ public function testGet()
}

/**
* @expectedException \ZammadAPIClient\Exception\AlreadyFetchedObjectException
* @depends testCreate
*/
public function testGetOnFilledObjects()
{
$this->expectException(AlreadyFetchedObjectException::class);

return parent::testGetOnFilledObjects();
}

Expand Down Expand Up @@ -259,11 +257,12 @@ public function testAllPagination()
}

/**
* @expectedException \ZammadAPIClient\Exception\AlreadyFetchedObjectException
* @depends testCreate
*/
public function testAllOnFilledObjects()
{
$this->expectException(AlreadyFetchedObjectException::class);

return parent::testAllOnFilledObjects();
}

Expand Down