Skip to content

Commit ec7693a

Browse files
PratikshaPratiksha
authored andcommitted
Debug
1 parent a7df996 commit ec7693a

File tree

2 files changed

+19
-21
lines changed

2 files changed

+19
-21
lines changed

composer.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515
"friendsofphp/php-cs-fixer": "^3.68",
1616
"vimeo/psalm": "^6.8",
1717
"dg/bypass-finals": "^1.9",
18-
"psalm/plugin-phpunit": "^0.19.2"
18+
"psalm/plugin-phpunit": "^0.19.2",
19+
"pcov/clobber": "^2.0"
1920
},
2021

2122
"autoload": {
@@ -51,7 +52,9 @@
5152
"scripts": {
5253
"cs": "vendor/bin/php-cs-fixer fix --dry-run --diff --allow-risky=yes",
5354
"cs:fix": "vendor/bin/php-cs-fixer fix --allow-risky=yes",
54-
"psalm": "vendor/bin/psalm --no-cache --show-info=true"
55+
"psalm": "vendor/bin/psalm --no-cache --show-info=true",
56+
"coverage": "php -dpcov.enabled=1 -dpcov.directory=. vendor/bin/phpunit --coverage-html coverage-report"
57+
5558
}
5659

5760
}

tests/Unit/Authentication/NoAuthUnitTest.php

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

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

5-
use DG\BypassFinals;
65
use Neo4j\QueryAPI\Authentication\NoAuth;
76
use PHPUnit\Framework\TestCase;
87
use Psr\Http\Message\RequestInterface;
98

10-
final class NoAuthUnitTest extends TestCase
9+
class NoAuthUnitTest extends TestCase
1110
{
12-
private NoAuth $auth;
13-
private RequestInterface $requestMock;
14-
15-
#[\Override]
16-
protected function setUp(): void
11+
public function testGetHeaderReturnsEmptyString()
1712
{
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());
2215
}
2316

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

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

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);
3732
}
3833
}

0 commit comments

Comments
 (0)