Skip to content

Commit e5fc522

Browse files
PratikshaPratiksha
authored andcommitted
Debug
1 parent ec7693a commit e5fc522

File tree

1 file changed

+19
-14
lines changed

1 file changed

+19
-14
lines changed

tests/Unit/Authentication/NoAuthUnitTest.php

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,32 +2,37 @@
22

33
namespace Neo4j\QueryAPI\Tests\Unit\Authentication;
44

5+
use DG\BypassFinals;
56
use Neo4j\QueryAPI\Authentication\NoAuth;
67
use PHPUnit\Framework\TestCase;
78
use Psr\Http\Message\RequestInterface;
89

9-
class NoAuthUnitTest extends TestCase
10+
final class NoAuthUnitTest extends TestCase
1011
{
11-
public function testGetHeaderReturnsEmptyString()
12+
private NoAuth $auth;
13+
private RequestInterface $requestMock;
14+
15+
#[\Override]
16+
protected function setUp(): void
1217
{
13-
$auth = new NoAuth();
14-
$this->assertSame('', $auth->getHeader());
18+
BypassFinals::enable();
19+
20+
$this->auth = new NoAuth();
21+
$this->requestMock = $this->createMock(RequestInterface::class);
1522
}
1623

17-
public function testGetTypeReturnsNoAuth()
24+
public function testAuthenticateReturnsUnmodifiedRequest(): void
1825
{
19-
$auth = new NoAuth();
20-
$this->assertSame('NoAuth', $auth->getType());
26+
$this->assertSame($this->requestMock, $this->auth->authenticate($this->requestMock));
2127
}
2228

23-
public function testAuthenticateReturnsSameRequest()
29+
public function testGetHeaderReturnsEmptyString(): void
2430
{
31+
$this->assertEquals('', $this->auth->getHeader());
32+
}
2533

26-
$requestMock = $this->createMock(RequestInterface::class);
27-
28-
$auth = new NoAuth();
29-
$result = $auth->authenticate($requestMock);
30-
31-
$this->assertSame($requestMock, $result);
34+
public function testGetTypeReturnsNoAuth(): void
35+
{
36+
$this->assertEquals('NoAuth', $this->auth->getType());
3237
}
3338
}

0 commit comments

Comments
 (0)