Skip to content

Commit

Permalink
test malformed response message
Browse files Browse the repository at this point in the history
  • Loading branch information
Firehed committed Oct 16, 2024
1 parent 6987b26 commit 4b1dbcf
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions tests/Exception/MalformedResponseTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?php

declare(strict_types=1);

namespace SnapAuth\Exception;

use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\Small;
use PHPUnit\Framework\MockObject\MockObject;
use PHPUnit\Framework\TestCase;

#[CoversClass(MalformedResponse::class)]
#[Small]
class MalformedResponseTest extends TestCase
{
public function testConstruct(): void
{
$e = new MalformedResponse('Invalid data', 503);
self::assertStringContainsString('Invalid data', $e->getMessage());
self::assertSame(503, $e->getCode());
}
}

0 comments on commit 4b1dbcf

Please sign in to comment.