Skip to content

Commit 187bded

Browse files
committed
tests: add test case for PR #42
1 parent 9a9cdbf commit 187bded

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

tests/Unit/Transformer/ElementTransformerTest.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
namespace MultiTheftAuto\Sdk\Transformer;
1616

17+
use MultiTheftAuto\Sdk\Exception\NotCallableResourceException;
1718
use MultiTheftAuto\Sdk\Model\Element;
1819
use MultiTheftAuto\Sdk\Model\Resource;
1920
use PHPUnit\Framework\TestCase;
@@ -54,4 +55,12 @@ public function testItReturnsNullIfDataIsEmpty(): void
5455

5556
$this->assertNull($fromInput);
5657
}
58+
59+
public function testItThrowsExceptionOnUnparseableData(): void
60+
{
61+
$this->expectException(NotCallableResourceException::class);
62+
63+
$input = 'Resource not running';
64+
ElementTransformer::fromServer($input);
65+
}
5766
}

0 commit comments

Comments
 (0)