Skip to content

Commit

Permalink
Test curl error conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
Firehed committed Oct 16, 2024
1 parent bb9a055 commit 3bd1c6b
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions tests/Exception/NetworkTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?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(Network::class)]
#[Small]
class NetworkTest extends TestCase
{
public function testConstruct(): void
{
$code = CURLE_OPERATION_TIMEDOUT;
$e = new Network($code);
// @phpstan-ignore argument.type (curl_strerror will not return null here)
self::assertStringContainsString(curl_strerror($code), $e->getMessage());
}
}

0 comments on commit 3bd1c6b

Please sign in to comment.