Skip to content

Commit 0ce2011

Browse files
PratikshaPratiksha
authored andcommitted
winp
1 parent 73851d0 commit 0ce2011

File tree

6 files changed

+3
-22
lines changed

6 files changed

+3
-22
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ test
1111
.phpunit.result.cache
1212

1313
#PHP-CS-FIXER
14-
.php-cs-fixer.php
14+
1515
.php-cs-fixer.cache
1616

1717

src/BasicAuthentication.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ class BasicAuthentication implements AuthenticateInterface
1111

1212
public function __construct(?string $username = null, ?string $password = null)
1313
{
14-
// Use provided values or fallback to environment variables
1514
$this->username = $username ?? getenv("NEO4J_USERNAME") ?: '';
1615
$this->password = $password ?? getenv("NEO4J_PASSWORD") ?: '';
1716
}

src/Objects/Person.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class Person extends Node
1515
*/
1616
public function __construct(array $properties)
1717
{
18-
// Pass the label 'Person' along with the properties to the parent Node constructor.
18+
1919
parent::__construct(['Person'], $properties);
2020
}
2121
}

tests/Integration/Neo4jOGMTest.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -385,10 +385,6 @@ public function testWithPath()
385385
$this->assertEquals($expectedResult, $actual);
386386
}
387387

388-
389-
390-
391-
392388
#[DataProvider('nullDataProvider')]
393389
public function testWithNull(string $query, array $parameters, ?string $expectedResult): void
394390
{

tests/Integration/Neo4jQueryAPIIntegrationTest.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -182,23 +182,17 @@ public function testProfileCreateKnowsBidirectionalRelationshipsMock(): void
182182

183183
$handler = HandlerStack::create($mockSack);
184184
$client = new Client(['handler' => $handler]);
185-
186-
// Use environment variables for authentication
187185
$auth = Authentication::fromEnvironment();
188186

189-
// Pass both client and authentication to Neo4jQueryAPI
190187
$api = new Neo4jQueryAPI($client, $auth);
191188

192-
// Execute the query
193189
$result = $api->run($query);
194190

195191
$plan = $result->getProfiledQueryPlan();
196192
$this->assertNotNull($plan, "The result of the query should not be null.");
197193

198-
// Load expected data
199194
$expected = require __DIR__ . '/../resources/expected/complex-query-profile.php';
200195

201-
// Assert the profiled query plan matches the expected result
202196
$this->assertEquals($expected->getProfiledQueryPlan(), $plan, "Profiled query plan does not match the expected value.");
203197
}
204198

tests/Integration/Neo4jTransactionIntegrationTest.php

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -53,27 +53,19 @@ private function populateTestData(): void
5353
}
5454
public function testTransactionCommit(): void
5555
{
56-
// Begin a new transaction
56+
5757
$tsx = $this->api->beginTransaction();
5858

59-
// Generate a random name for the node
6059
$name = (string)mt_rand(1, 100000);
61-
62-
// Create a node within the transaction
6360
$tsx->run("CREATE (x:Human {name: \$name})", ['name' => $name]);
6461

65-
// Validate that the node does not exist in the database before the transaction is committed
6662
$results = $this->api->run("MATCH (x:Human {name: \$name}) RETURN x", ['name' => $name]);
6763
$this->assertCount(0, $results);
6864

69-
// Validate that the node exists within the transaction
7065
$results = $tsx->run("MATCH (x:Human {name: \$name}) RETURN x", ['name' => $name]);
7166
$this->assertCount(1, $results);
7267

73-
// Commit the transaction
7468
$tsx->commit();
75-
76-
// Validate that the node now exists in the database
7769
$results = $this->api->run("MATCH (x:Human {name: \$name}) RETURN x", ['name' => $name]);
7870
$this->assertCount(1, $results); // Updated to expect 1 result
7971
}

0 commit comments

Comments
 (0)