Skip to content

Commit 5266a6a

Browse files
authored
Make sure all our exception is initializeable (#360)
* Make sure all our exception is initializeable * minor * cs
1 parent bb5a047 commit 5266a6a

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

Diff for: tests/Unit/Exception/InitializeExceptionTest.php

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace Buzz\Test\Unit\Exception;
6+
7+
use Buzz\Exception as BuzzException;
8+
use Nyholm\Psr7\Request;
9+
use PHPUnit\Framework\TestCase;
10+
11+
class InitializeExceptionTest extends TestCase
12+
{
13+
public function testInitialize()
14+
{
15+
$e[] = new BuzzException\ClientException();
16+
$e[] = new BuzzException\InvalidArgumentException();
17+
$e[] = new BuzzException\LogicException();
18+
$e[] = new BuzzException\NetworkException(new Request('GET', '/'));
19+
$e[] = new BuzzException\RequestException(new Request('GET', '/'));
20+
21+
foreach ($e as $exception) {
22+
$this->assertInstanceOf(BuzzException\ExceptionInterface::class, $exception);
23+
}
24+
}
25+
}

0 commit comments

Comments
 (0)