Skip to content

Commit 41e6bd6

Browse files
committed
test(Bp4ELhAA): reset with generated dto
1 parent bf6096d commit 41e6bd6

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

test/functional/Client/ClientTest.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
use Articus\DataTransfer\Service as DataTransferService;
66
use ClientTest\OpenAPI\V1\DTO\ResourceListResult;
7+
use ClientTest\OpenAPI\V1\DTO\ResourceResult;
78
use Exception;
89
use GuzzleHttp\Exception\ConnectException;
910
use GuzzleHttp\Psr7\Request;
@@ -86,6 +87,20 @@ public function testServiceUnavailable(Response|Exception $response): void
8687
self::assertErrorOfType($response, Message::SERVICE_UNAVAILABLE);
8788
}
8889

90+
public function testResetFunction(): void
91+
{
92+
$this->markTestIncomplete('Indirect modification of overloaded property ClientTest\OpenAPI\V1\DTO\ResourceResult::$messages has no effect');
93+
$message = new \ClientTest\OpenAPI\V1\DTO\Message();
94+
$message->level = Message::ERROR;
95+
$message->type = Message::UNDEFINED_TYPE;
96+
$message->text = 'Some error details.';
97+
$result = new ResourceResult();
98+
$result->messages = [$message];
99+
100+
$firstMessage = reset($result->messages);
101+
self::assertEquals($firstMessage, $message);
102+
}
103+
89104
private static function assertErrorOfType(ResourceListResult $response, string $errorType): void
90105
{
91106
self::assertCount(1, $response->messages);

0 commit comments

Comments
 (0)