|
2 | 2 |
|
3 | 3 | namespace Neo4j\QueryAPI\Tests\Unit\Authentication;
|
4 | 4 |
|
5 |
| -use DG\BypassFinals; |
6 | 5 | use Neo4j\QueryAPI\Authentication\NoAuth;
|
7 | 6 | use PHPUnit\Framework\TestCase;
|
8 | 7 | use Psr\Http\Message\RequestInterface;
|
9 | 8 |
|
10 |
| -final class NoAuthUnitTest extends TestCase |
| 9 | +class NoAuthUnitTest extends TestCase |
11 | 10 | {
|
12 |
| - private NoAuth $auth; |
13 |
| - private RequestInterface $requestMock; |
14 |
| - |
15 |
| - #[\Override] |
16 |
| - protected function setUp(): void |
| 11 | + public function testGetHeaderReturnsEmptyString() |
17 | 12 | {
|
18 |
| - BypassFinals::enable(); |
19 |
| - |
20 |
| - $this->auth = new NoAuth(); |
21 |
| - $this->requestMock = $this->createMock(RequestInterface::class); |
| 13 | + $auth = new NoAuth(); |
| 14 | + $this->assertSame('', $auth->getHeader()); |
22 | 15 | }
|
23 | 16 |
|
24 |
| - public function testAuthenticateReturnsUnmodifiedRequest(): void |
| 17 | + public function testGetTypeReturnsNoAuth() |
25 | 18 | {
|
26 |
| - $this->assertSame($this->requestMock, $this->auth->authenticate($this->requestMock)); |
| 19 | + $auth = new NoAuth(); |
| 20 | + $this->assertSame('NoAuth', $auth->getType()); |
27 | 21 | }
|
28 | 22 |
|
29 |
| - public function testGetHeaderReturnsEmptyString(): void |
| 23 | + public function testAuthenticateReturnsSameRequest() |
30 | 24 | {
|
31 |
| - $this->assertEquals('', $this->auth->getHeader()); |
32 |
| - } |
33 | 25 |
|
34 |
| - public function testGetTypeReturnsNoAuth(): void |
35 |
| - { |
36 |
| - $this->assertEquals('NoAuth', $this->auth->getType()); |
| 26 | + $requestMock = $this->createMock(RequestInterface::class); |
| 27 | + |
| 28 | + $auth = new NoAuth(); |
| 29 | + $result = $auth->authenticate($requestMock); |
| 30 | + |
| 31 | + $this->assertSame($requestMock, $result); |
37 | 32 | }
|
38 | 33 | }
|
0 commit comments