Skip to content

Commit 2bfce54

Browse files
remove unnecessary comments and phpunit.xml
1 parent 02b363f commit 2bfce54

13 files changed

+27
-60
lines changed

phpunit.xml

Lines changed: 0 additions & 27 deletions
This file was deleted.

tests/unit/Collector/Neo4jDataCollectorTest.php renamed to tests/Unit/Collector/Neo4jDataCollectorTest.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
declare(strict_types=1);
44

5-
namespace Neo4j\Neo4jBundle\Tests\unit\Collector;
5+
namespace Neo4j\Neo4jBundle\Tests\Unit\Collector;
66

77
use Neo4j\Neo4jBundle\Collector\Neo4jDataCollector;
88
use Neo4j\Neo4jBundle\EventListener\Neo4jProfileListener;
@@ -21,8 +21,6 @@ protected function setUp(): void
2121
$this->collector = new Neo4jDataCollector($this->subscriber);
2222
}
2323

24-
25-
2624
public function testGetName(): void
2725
{
2826
$this->assertSame('neo4j', $this->collector->getName());
@@ -41,7 +39,10 @@ public function testGetQueryCount(): void
4139
public function testRecursiveToArray(): void
4240
{
4341
$obj = new class {
44-
public function toArray(): array { return ['key' => 'value']; }
42+
public function toArray(): array
43+
{
44+
return ['key' => 'value'];
45+
}
4546
};
4647
$reflection = new \ReflectionClass($this->collector);
4748
$method = $reflection->getMethod('recursiveToArray');

tests/unit/SymfonyClientTest.php renamed to tests/Unit/Decorators/SymfonyClientTest.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,22 +29,18 @@ class SymfonyClientTest extends TestCase
2929

3030
protected function setUp(): void
3131
{
32-
// Mocks
3332
$this->driverSetupManagerMock = $this->createMock(DriverSetupManager::class);
3433
$this->driverFactoryMock = $this->createMock(SymfonyDriverFactory::class);
3534
$this->sessionMock = $this->createMock(SymfonySession::class);
3635
$this->transactionMock = $this->createMock(SymfonyTransaction::class);
3736

38-
// Use real instances for final classes
3937
$this->sessionConfig = new SessionConfiguration();
4038
$this->transactionConfig = new TransactionConfiguration();
4139

42-
// Setup default alias return value
4340
$this->driverSetupManagerMock
4441
->method('getDefaultAlias')
4542
->willReturn('default');
4643

47-
// Create SymfonyClient instance
4844
$this->client = new SymfonyClient(
4945
$this->driverSetupManagerMock,
5046
$this->sessionConfig,

tests/unit/SymfonySessionTest.php renamed to tests/Unit/Decorators/SymfonySessionTest.php

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
11
<?php
22

3-
namespace Neo4j\Neo4jBundle\Tests\unit;
4-
use Neo4j\Neo4jBundle\Decorators\SymfonyTransaction;
3+
namespace Neo4j\Neo4jBundle\Tests\Unit\Decorators;
54

65
use Laudis\Neo4j\Basic\Session;
76
use Laudis\Neo4j\Databags\Bookmark;
87
use Laudis\Neo4j\Databags\Statement;
9-
use Laudis\Neo4j\Databags\TransactionConfiguration;
108
use Laudis\Neo4j\Databags\SummarizedResult;
119
use Laudis\Neo4j\Types\CypherList;
12-
use Laudis\Neo4j\Types\CypherMap;
1310
use Neo4j\Neo4jBundle\Decorators\SymfonySession;
11+
use Neo4j\Neo4jBundle\Decorators\SymfonyTransaction;
1412
use Neo4j\Neo4jBundle\EventHandler;
1513
use Neo4j\Neo4jBundle\Factories\SymfonyDriverFactory;
1614
use PHPUnit\Framework\TestCase;
@@ -26,12 +24,12 @@ class SymfonySessionTest extends TestCase
2624

2725
protected function setUp(): void
2826
{
29-
// Create mock objects
27+
3028
$this->sessionMock = $this->createMock(Session::class);
3129
$this->handlerMock = $this->createMock(EventHandler::class);
3230
$this->factoryMock = $this->createMock(SymfonyDriverFactory::class);
3331

34-
// Initialize SymfonySession with mocks
32+
3533
$this->symfonySession = new SymfonySession(
3634
$this->sessionMock,
3735
$this->handlerMock,
@@ -46,12 +44,12 @@ public function testRunStatement()
4644
$statementMock = $this->createMock(Statement::class);
4745
$resultMock = $this->createMock(SummarizedResult::class);
4846

49-
// Mock the EventHandler handleQuery method
47+
5048
$this->handlerMock
5149
->expects($this->once())
5250
->method('handleQuery')
5351
->with(
54-
$this->callback(fn ($callback) => is_callable($callback)),
52+
$this->callback(fn($callback) => is_callable($callback)),
5553
$statementMock,
5654
$this->alias,
5755
$this->schema,
@@ -70,7 +68,7 @@ public function testRunStatements()
7068
$resultMock1 = $this->createMock(SummarizedResult::class);
7169
$resultMock2 = $this->createMock(SummarizedResult::class);
7270

73-
// Mock the handler for both statements
71+
7472
$this->handlerMock
7573
->method('handleQuery')
7674
->willReturnOnConsecutiveCalls($resultMock1, $resultMock2);
@@ -85,13 +83,13 @@ public function testBeginTransaction()
8583
{
8684
$transactionMock = $this->createMock(SymfonyTransaction::class);
8785

88-
// Mock the factory to return a SymfonyTransaction
86+
8987
$this->factoryMock
9088
->expects($this->once())
9189
->method('createTransaction')
9290
->with(
9391
$this->sessionMock,
94-
$this->anything(), // TransactionConfiguration (nullable)
92+
$this->anything(),
9593
$this->alias,
9694
$this->schema
9795
)
@@ -106,7 +104,6 @@ public function testWriteTransaction()
106104
{
107105
$transactionMock = $this->createMock(SymfonyTransaction::class);
108106

109-
// Mock the factory to return a SymfonyTransaction when beginTransaction() is called
110107
$this->factoryMock
111108
->expects($this->once())
112109
->method('createTransaction')

tests/unit/SymfonyTransactionTest.php renamed to tests/Unit/Decorators/SymfonyTransactionTest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,13 @@
22

33
declare(strict_types=1);
44

5-
namespace Tests\Neo4j\Neo4jBundle\Decorators;
5+
namespace Tests\Neo4j\Neo4jBundle\tests\unit\Decorators;
66

77
use Laudis\Neo4j\Contracts\UnmanagedTransactionInterface;
88
use Laudis\Neo4j\Databags\Statement;
99
use Laudis\Neo4j\Databags\SummarizedResult;
1010
use Laudis\Neo4j\Enum\TransactionState;
1111
use Laudis\Neo4j\Types\CypherList;
12-
use Laudis\Neo4j\Types\CypherMap;
1312
use Neo4j\Neo4jBundle\Decorators\SymfonyTransaction;
1413
use Neo4j\Neo4jBundle\EventHandler;
1514
use PHPUnit\Framework\TestCase;

tests/unit/DependencyInjection/Neo4jExtensionTest.php renamed to tests/Unit/DependencyInjection/Neo4jExtensionTest.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,17 @@
55
namespace Neo4j\Neo4jBundle\Tests\Unit\DependencyInjection;
66

77
use Neo4j\Neo4jBundle\DependencyInjection\Neo4jExtension;
8-
use Neo4j\Neo4jBundle\EventHandler;
9-
use Neo4j\Neo4jBundle\EventListener\Neo4jProfileListener;
10-
use Neo4j\Neo4jBundle\Collector\Neo4jDataCollector;
8+
119
use PHPUnit\Framework\TestCase;
1210
use Symfony\Component\DependencyInjection\ContainerBuilder;
13-
use Symfony\Component\DependencyInjection\Reference;
11+
1412

1513
class Neo4jExtensionTest extends TestCase
1614
{
1715
public function testLoad(): void
1816
{
1917
$container = new ContainerBuilder();
20-
$container->setParameter('kernel.debug', false); // Define missing parameter
18+
$container->setParameter('kernel.debug', false);
2119

2220
$extension = new Neo4jExtension();
2321
$configs = [

tests/unit/Event/FailureEventTest.php renamed to tests/Unit/Event/FailureEventTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
declare(strict_types=1);
44

5-
namespace Neo4j\Neo4jBundle\Tests\unit\Event;
5+
namespace Neo4j\Neo4jBundle\Tests\Unit\Event;
66

77
use Laudis\Neo4j\Databags\Statement;
88
use Laudis\Neo4j\Exception\Neo4jException;

tests/unit/EventListener/Neo4jProfileListenerTest.php renamed to tests/Unit/EventListener/Neo4jProfileListenerTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
declare(strict_types=1);
44

5-
namespace Neo4j\Neo4jBundle\Tests\unit\EventListener;
5+
namespace Neo4j\Neo4jBundle\Tests\Unit\EventListener;
66

77
use Laudis\Neo4j\Databags\ResultSummary;
88
use Laudis\Neo4j\Databags\Statement;
@@ -21,8 +21,8 @@ public function testOnPostRun(): void
2121

2222
$alias = 'default';
2323
$resultMock = $this->createMock(ResultSummary::class);
24-
$resultMock->method('getResultAvailableAfter')->willReturn(10.0); // Ensure float type
25-
$resultMock->method('getResultConsumedAfter')->willReturn(5.0); // Ensure float type
24+
$resultMock->method('getResultAvailableAfter')->willReturn(10.0);
25+
$resultMock->method('getResultConsumedAfter')->willReturn(5.0);
2626

2727
$time = new \DateTimeImmutable();
2828
$scheme = 'bolt';

tests/unit/EventhandlerTest.php renamed to tests/Unit/EventhandlerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
declare(strict_types=1);
44

5-
namespace Neo4j\Neo4jBundle\Tests\unit;
5+
namespace Neo4j\Neo4jBundle\Tests\Unit;
66

77
use Laudis\Neo4j\Databags\Statement;
88
use Laudis\Neo4j\Databags\SummarizedResult;

tests/unit/Factories/StopwatchEventNameFactoryTest.php renamed to tests/Unit/Factories/StopwatchEventNameFactoryTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
namespace Neo4j\Neo4jBundle\Tests\unit\Factories;
3+
namespace Neo4j\Neo4jBundle\Tests\Unit\Factories;
44

55
use Neo4j\Neo4jBundle\Factories\StopwatchEventNameFactory;
66
use Laudis\Neo4j\Enum\TransactionState;

tests/unit/Factories/SymfonyDriverFactoryTest.php renamed to tests/Unit/Factories/SymfonyDriverFactoryTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,9 @@ public function testGenerateTransactionIdWithUuidFactory(): void
9292
$this->assertSame('test-uuid', $id);
9393
}
9494

95+
/**
96+
* @throws \ReflectionException
97+
*/
9598
public function testGenerateTransactionIdWithoutUuidFactory(): void
9699
{
97100
$factory = new SymfonyDriverFactory($this->eventHandler, null);

0 commit comments

Comments
 (0)